How to create or edit a package (PAM)

  1. Set up directories needed
    • go to your work area, e.g. cd ~/workdir
    • If you are adding a package or module in a standard domain, then you must first check out the domain from cvs:
       cvs co pams/domain  
      Add the directory for the package if needed:
             cd pams/domain
             mkdir package; cd package ; # new package if needed
             mkdir doc                   # doc subdirectory
    • If you are creating a new domain, then you must create the directories under ~/workdir
             mkdir pams; cd pams
             mkdir domain; cd domain;   # what domain you want to have
             mkdir idl
             mkdir inc
             mkdir kumac
             mkdir package(s)            # new package(s)
                cd package
                mkdir doc                  # doc subdirectory
                cd ..
  2. Write Files Needed:
    • For each package, you may have more than one MODULE (e.g. package tpt in $STAR/pams/tpc/tpt/ has 2 modules: tpt & tpt_sts).
    • In pams/domain/package you should have the following:
      1. module.idl
      2. module.c or .F (must have same name as module.idl)
      3. any other source code called by your module (but the only code callable by STAF is the module itself)
      4. any header or include files used only by this package
      5. doc subdirectory with html files
      6. README file
    • In pams/domain/idl - table idl files
    • In pams/domain/inc - include or header files used by more than 1 package.
    • In pams/domain/kumac - For each package, you should have a package_init.kumac and package_run.kumac with separate macros for each module. For each domain, you should have a create_tables_domain.kumac with separate macros for each package or module.
  3. Compile & Make Library
    • Now make shared libraries for each of your domains:
      >cd pams/domain
      >gmake -f $STAR/mgr/
    • If you mess it up and have to do it again, you might need to do:
      > makes clean clean_share NODEPEND=1
  4. To run in STAF
    • > staf
        >make domain   ==> loads all modules in domain
    • now can execute your kumacs scripts
  5. check into CVS (if desired) - ask person responsible for domain if you don't have permission

STAR Collaboration Meeting 7/98                     Kathy Turner, BNL                     Offline Software Tutorials