Project

General

Profile

Adding packages to NOvASoft

Create a new package WITH ARTMOD

The ART framework provides a neat executable that will generate the boilerplate code for creating a new module. This is the recommended method for creating a new package/module.
Info on the usage of artmod is here: Using Artmod

Create a new package FROM SCRATCH

Assume that you've created your own development directory as described in Editing Code. Then you simply create a new sub-directory with name of your new package within that development directory; e.g.,

% cd myDevelopment
% mkdir NOvARocks
% cd NOvARocks

... and start creating files. You'll probably want to create a GNUmakefile; look at the GNUmakefiles in the various packages in $SRT_PUBLIC_CONTEXT to get some idea what you need to put in, and/or copy one of them and edit it to suit your needs.

In order to compile your code, you'll need a link in the include/ directory of your development area; e.g.,

% cd myDevelopment/include (include should have been created when you made the release using newrel -t)
% ln -sf ../NOvARocks .

This link is normally made by addpkg, but if you're creating a new package, you have to do this manually.

Create a new package USING THE DEMO TEMPLATE PACKAGE

Assume that you've created your own development directory as described in Editing Code. Copy the Demo package into a directory of your choosing, e.g.,

% cd myDevelopment
% cp -r Demo NOvARocks

If the Demo package doesn't already exist in your test release, you'll need to add it before you copy it:
% cd myDevelopment
% addpkg_svn -h Demo
% cp -r Demo NOvARocks

Now clean it up a bit and add a link to the include directory:
% cd include
% ln -s ../NOvARocks .
% cd NOvARocks
% rm -fR CVS

You'll now need to edit the Module.h, Module.cxx, Object.h and Object.cxx files to fit your needs. Be sure to change the 'demo' namespace found in these files, and use more appropriate names for Modules and Objects.

Adding package to NOvASoft

To add a new package to the offline cvs repository, try the following:

Add the package to SVN

Once your new package in your test release is ready to be committed, you need to import it to SVN. From your test release:

% svn import <package name> svn+ssh://p-novaart@cdcvs.fnal.gov/cvs/projects/novaart/pkgs.svn/trunk/<package name>

E.g., it's time to include your new package NOvARocks:

% cd $SRT_PRIVATE_CONTEXT (i.e. where NOvARocks lives)
% svn import NOvARocks $CVSROOT/trunk/NOvARocks

where $CVSROOT=svn+ssh:///cvs/projects/novaart/pkgs.svn

Note that you need to put in a log message when you do this. If you don't have a -m "insert log message here" in your import, svn tries to open your default editor so that you can type the message there. If the default is not defined, svn throws an error. For information on setting your editor, see https://cdcvs.fnal.gov/redmine/projects/novaart/wiki/Documentation_FOR_BEGINNERS#SVN-Commit-Editor-and-bashrc-files

Grab the SVN-controlled package

We now need to have the SVN-controlled version of our package. To be safe, move your package to a backup area

% mv NOvARocks NOvARocks_backup

We can remove this once we are happy we committed the package successfully.

Now check out our package from SVN:

% addpkg_svn -h NOvARocks

Double check that everything looks correct - if so, remove the backup version.

Now we can make further edits, svn update and svn commit as normal.

Declare package as an Offline standard

If you want to declare your new package as a standard for the offline (so that it is picked up automatically in future installations/updates), you need to add it to the list of development packages in the setup directory by modifying the appropriate setup file:

% cd $SRT_PRIVATE_CONTEXT
% addpkg_svn -h setup
% cd setup
% vi/emacs packages-development

Add your package (in alphabetical order, please) following the format of the file.

Commit the updated setup file and then remove it from your test release. You only need it in order to add your package to SVN list of development packages and you will not be doing this regularly!

% svn commit
% cd ..
% rmpkg -f setup 

Add to Build script

If you want your package to be updated and built nightly (i.e. added to the standard build script - novasoft_build) please inform Liudmila (ldkolupaeva AT yandex.ru ) and/or Dan (pershey AT caltech.edu) and/or Gavin (gsdavies AT fnal.gov), who will add it in the appropriate place.

External packages

NOvASoft external packages, such as ART, ROOT, GENIE etc reside as UPS (UNIX Product Support) packages at /nusoft/app/externals.
UPS is a software support toolkit developed at Fermilab for the management of software products on local systems by the system administrators and users. It was also designed to facilitate the product distribution and configuration management tasks of the product providers.
It is the easiest way to distribute packages to off-site users.

Creating UPS products

The following page explains how to create a UPS product out of an external package

Downloading "bundles" from scisoft.fnal.gov

The script http://scisoft.fnal.gov/scisoft/bundles/tools/pullProducts is used for this purpose (the local version can be found in $EXTERNALS/temp). The topdir for the products is $EXTERNALS on gpvm and /cvmfs/nova.opensciencegrid.org/externals on cvmfs. You can simplify it in the next way:

% cd ~/temp
% curl -O http://scisoft.fnal.gov/scisoft/bundles/tools/pullProducts
% chmod +x pullProducts
% ./pullProducts -r ${EXTERNALS} <os> <package> <eflags> <prof|debug>

See instructions by -h option or here : http://scisoft.fnal.gov/scisoft/bundles/tools/pullProducts