*-----------------------------------------------------------------------* * File LIBMACS.KUMAC - macros for library work * * **** Version for VAX, ALPHA, HP, IBMRT, SGI, OSF ***** * * This Kumac must be executed before you do work on the NA44 CMZ * * files or libraries. Ideally only one person per site * * (the librarian) should be allowed to work on the libraries. * * ... * * Sept 93 Doug Fields and Hubert van Hecke, LANL * * Some modifications for CERN site * * January '94 Gilbert Poulard CERN * * New macro 'mk_delta' to generate 'delta' files * * New macro 'corrlib ' to create the correction library on CERNVM * * February '94 G.P. * * New cde in DST44 for column wise ntuple July '94 G.P. * * New version of CMZ: ytoc -> arc 21 Mar 94 HvH * * added /pad_source compile switch to suppress numerous * * compile-time warnings (cern only) 23 Aug 95 HvH * * Integrated vax/alpha, hpux/ibmrt/sgi, general cleanup 28 Sep 95 HvH * * Use FSITE to switch cern compile options, * * Added OSF1 (from Atsushi), removed VM/CMS 15 dec 95 HvH * * Added the DEBUG option (from Doug), SGI (from Jerry) 12 Feb 96 HvH * * Modified for the new directory structure 26 Mar 95 HvH * *-----------------------------------------------------------------------* macro start message ' LIBMACS version of 29 Mar 96 - 10:45' * * (1) The following are the selections for IF-SELECTED code. * Check that these are appropriate for your site. * select . select na44 * choose your site: select lanl * select cern * select nevis * select your-site-here * *---------------------------------------------------------------------- * * (2) Set the directory for source code, library name, * standard fortran compiler directives, and default * editor, CMZ file directory. *---------------------------------------------------------------------- if ( $MACHINE = VAX .and. $OS = VMS ) then if ( $ENV(FSITE) = CERNCLUSTER ) then message ' LIBMACS:: setting up for NA44 CMZ library work on a Cern VAX' set 'for/list=fscratch:/obj=ffor:/noopt/deb/check/pad_source _ $COMPFILE' -c else message ' LIBMACS:: setting up for NA44 CMZ library work on a VAX' set 'for/list=fscratch:/obj=ffor:/noopt/deb/check _ $COMPFILE' -c endif * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - elseif ( $MACHINE = ALPHA .and. $OS = VMS ) then if ( $ENV(FSITE) = CERNCLUSTER ) then message ' LIBMACS:: setting up for NA44 CMZ library work on a Cern ALPHA' set 'for/SEPARATE/list=fscratch:/obj=ffor:/noopt/deb/check/pad_source _ $COMPFILE' -c else message ' LIBMACS:: setting up for NA44 CMZ library work on an ALPHA' set 'for/SEPARATE/list=fscratch:/obj=ffor:/noopt/deb/check _ $COMPFILE' -c endif endif * - - common vms stuff: - - - - - - - - - - - - - - - - - - - - - - - - if ( ($MACHINE = VAX .or. $MACHINE = ALPHA) .and. $OS = VMS ) then select VAX alias/create cmzpath 'FCMZ:' alias/create forpath 'FFOR:' alias/create libpath 'FLIB:' alias/create forext '.for' alias/create libext '.olb' * host_edit edt endif *---------------------------------------------------------------------- if ( $MACHINE = HPUX ) then message ' LIBMACS:: setting up for NA44 CMZ library work on a HPUX' select HPUX set 'f77 -K +ppu -w +E1 +U77 -c -C +T $compfile' -c if ( $ENV(FSITE) = CERNCLUSTER ) then host_edit ved elseif ( $ENV(FSITE) = lanl ) then host_edit edt endif * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - elseif ( $MACHINE = IBMRT ) then message ' LIBMACS:: setting up for NA44 CMZ library work on a IBMRT' select IBMRT set 'f77 -qextname -qcharlen=32767 -c -C $compfile' -c host_edit vi *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - elseif ( $MACHINE = SGI ) then message ' LIBMACS:: setting up for NA44 CMZ library work on a SGI' select SGI set 'f77 -static -nocpp -backslash -w -tU -c -C $compfile' -c host_edit emacs *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - elseif ( $MACHINE = VAX .and. $OS = OSF1 ) then message ' LIBMACS:: setting up for NA44 CMZ library work under DEC/OSF1' select OSF set 'f77 -static -G 3 -check_bounds -c $compfile' -c host_edit vi endif *- - common unix stuff: - - - - - - - - - - - - - - - - - - - - - - - - if ( $MACHINE = HPUX .or. $MACHINE = IBMRT .or. $MACHINE = sgi ) then alias/create cmzpath '$FCMZ/' alias/create forpath '$FFOR' alias/create libpath '$FLIB' * alias/create forext '.f' alias/create libext '.a' endif *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if ( forext .eq. ' ') then message ' *** Error from LIBMACS: ****' message ' *** edit the file for this machine: ' $MACHINE message ' *** Also notify Gilbert and Hubert ****' go to end endif *---------------------------------------------------------------------- * * (3) More macro names and aliases alias/create newlib 'exec libmacs#newl' alias/create mk_new 'exec libmacs#make_new' alias/create def_seq 'exec libmacs#defseq' alias/create attread 'exec libmacs#attrd' alias/create attwork 'exec libmacs#attwk' alias/create cdf_make 'exec libmacs#cdf_patch' alias/create cdf_import 'exec libmacs#cdfimport' alias/create patch 'exec libmacs#na44_patch' alias/create mk_cor 'exec libmacs#make_cor' alias/create backup 'exec libmacs#back' alias/create mk_delta 'exec libmacs#make_delta' alias/create debug 'exec libmacs#debg' alias/delete na44help alias/create na44help 'exec libmacs#helpna44' alias/delete na44_help alias/create na44_help 'exec libmacs#helpna44' alias/delete help_na44 alias/create help_na44 'exec libmacs#helpna44' alias/delete helpna44 alias/create helpna44 'exec libmacs#helpna44' alias/create dir 'ls -l' * exec libmacs#helpna44 MESSAGE ' ' end: return * ! logon *----------------------------------------------------------------------* * End of main. Macros follow *----------------------------------------------------------------------* macro helpna44 MESSAGE ' ' MESSAGE ' Valid macros for an NA44 librarians use are:' MESSAGE ' ' MESSAGE ' newlib - Creates xxx.a - defined by the set_file -L command in' MESSAGE ' this kumac file. One only needs to build the full library' MESSAGE ' once. Afterwards, use macro mk_new.' MESSAGE ' mk_new - Recompiles all decks that are out-of-date compared to' MESSAGE ' the default library.' MESSAGE ' def_seq - Defines all sequences (keeps) to be used by CMZ. This' MESSAGE ' need to be executed every time you make changes.' MESSAGE ' attread - Connects to all NA44 CMZ files in directory defined by' MESSAGE ' cmzpath in read-only mode.' MESSAGE ' attwork - Connects to all NA44 CMZ files in directory defined by' MESSAGE ' cmzpath in write mode.' MESSAGE ' cdf_make - Updates the KUIP command definition files for INTER and' MESSAGE ' DBTOOLS. (inserts fortran into CMZ files)' MESSAGE ' cdf_import Reads back files produced with CDF_MAKE (for IBM)' MESSAGE ' mk_cor - Creates correction cradles by comparison to vrs. 1 of the' MESSAGE ' CMZ files.' MESSAGE ' mk_delta - Creates delta files ' MESSAGE ' mk_delta - Comparison with version xx.yy/00 of CMZ file. ' MESSAGE ' patch - Applies the correction cradles *.cra to the CMZ files' MESSAGE ' backup - Writes out card copies of entire CMZ files.' MESSAGE ' debug - Turn on DEBUG switches.' MESSAGE ' corrlib - Creates correction library (mainly CERNVM).' MESSAGE ' na44help - Displays this message.' return * ! na44help *---------------------------------------------------------------------- macro make_delta * * To generate DELTA.files : xxx.delta * MESSAGE ' Start to generate delta files xxx.delta' * exec cdelta CALIB ; exec cdelta DBTOOLS ; exec cdelta DETFOC exec cdelta DRZEB ; exec cdelta DST44 ; exec cdelta FATM44 exec cdelta FKEEPS ; exec cdelta GEOFOC ; exec cdelta HANSGEN exec cdelta HD ; exec cdelta HFOC ; exec cdelta HFRZ exec cdelta INTER ; exec cdelta MC ; exec cdelta NA44DOC exec cdelta PID ; exec cdelta RC ; exec cdelta TFILE exec cdelta TURTLEE ; exec cdelta UT ; exec cdelta TRKH exec cdelta wcnew ; exec cdelta ticpid MESSAGE ' All NA44 Delta files built from CMZ ' return * ! make_delta *---------------------------------------------------------------------- macro cdelta * MESSAGE ' - - - - - - - - - - - - - - - - - - - - -' MESSAGE Now generating 'delta' for file: [1] * file cmzpath/[1] paux = $lower([1]) filev = V$/[paux] MESS File version [1] [%filev] deltav = $substring([%filev],1,$index([%filev],'/')) * > Force comparison with 'original' version deltav = [deltav]/00 MESSAGE Generating [1].delta comparing to version [deltav] ycorr -V [deltav] -F [1].delta rel [1] * return * cdelta *---------------------------------------------------------------------- macro make_cor * * To generate CORRECTION files : xxxc.cra * MESSAGE ' Start to generate correction files xxxC.CRA' * if ( $OS = VMS ) then shell delete temp.cmz;* else shell rm temp.cmz endif exec ccomp CALIB exec ccomp DBTOOLS ; exec ccomp DETFOC exec ccomp DRZEB ; exec ccomp DST44 ; exec ccomp FATM44 exec ccomp FKEEPS ; exec ccomp GEOFOC ; exec ccomp HANSGEN exec ccomp HD ; exec ccomp HFOC ; exec ccomp HFRZ exec ccomp INTER ; exec ccomp MC ; exec ccomp NA44DOC exec ccomp PID ; exec ccomp RC ; exec ccomp TFILE exec ccomp TURTLEE ; exec ccomp UT ; exec ccomp TRKH exec ccomp wcnew ; exec ccomp ticpid MESSAGE ' All NA44 Corrections files built from CMZ ' return * ! mk_cor *---------------------------------------------------------------------- macro ccomp MESSAGE ' - - - - - - - - - - - - - - - - - - - - -' MESSAGE Now doing YCORR -H for file: [1] arc carpath/[1].car file cmzpath/[1] * ycorr *;1 -F [1]c.cra rel [1] * if ( $OS = VMS ) then shell delete temp.cmz;* else shell rm temp.cmz endif return * ccomp *----------------------------------------------------------------------* macro makecorr MESSAGE ' - - - - - - - - - - - - - - - - - - - - -' MESSAGE Now doing YCORR -h *;1 for file: [1] file cmzpath/[1] YCORR -h *;1 -F [1]c.cra rel [1] return * !makecorr *---------------------------------------------------------------------- macro newl * * > To Build NA44 object libraries the first time, starting from * > CMZ files. * message ' Doing DEF_SEQ....' seq . def_seq * exec newmake fkeeps ; exec newmake hfoc ; exec newmake hfrz *return *macro dummy exec newmake detfoc ; exec newmake geofoc ; exec newmake inter exec newmake hansgen ; exec newmake tfile ; exec newmake turtlee exec newmake drzeb ; exec newmake rc ; exec newmake mc exec newmake ut ; exec newmake dbtools ; exec newmake fatm44 exec newmake dst44 ; exec newmake calib ; exec newmake hd exec newmake pid ; exec newmake trkh ; exec newmake wcnew exec newmake ticpid * MESSAGE ' Fortran and object libraries have been created.' return * ! newl *---------------------------------------------------------------------- macro newmake if ( $OS = VMS ) then set forpath/[1]//forext -F set libpath/[1]//libext -L exec ffile_R [1] MESS Attaching : $CMZFILE() - $VERSION($lower($CMZFILE())) use . cflib * else set forpath/*//forext -F set libpath/[1]//libext -L exec ffile_R [1] MESS Attaching : $CMZFILE() - $VERSION($lower($CMZFILE())) use . cflib * endif rel [1] return * ! newmake *---------------------------------------------------------------------- macro defseq * * macro for defining all the KEEPS and SEQences. * *seq newdecks * exec ffile_R hfoc if $machine = VAX then seq hfrvax elseif $machine = ALPHA then seq hfrvax elseif $machine = HPUX then seq hfrhpx elseif $machine = IBMRT then seq hfrhpx elseif $MACHINE = IBM then seq hfribm elseif $MACHINE = SGI then seq hfrsgi endif seq hfcde seq hfrseq rel hfoc * exec ffile_R fkeeps ; seq //fkeeps ; rel fkeeps exec ffile_R hd ; seq //hd ; rel hd exec ffile_R detfoc ; seq //detfoc ; rel detfoc exec ffile_R hansgen ; seq //hansgen ; rel hansgen exec ffile_R tfile ; seq //tfile ; rel tfile exec ffile_R turtlee ; seq //turtlee ; rel turtlee exec ffile_R drzeb ; seq //drzeb ; rel drzeb exec ffile_R dbtools ; seq //dbtools ; rel dbtools exec ffile_R fatm44 ; seq //fatm44 ; rel fatm44 exec ffile_R dst44 ; seq //dst44 ; rel dst44 exec ffile_R calib ; seq //calib ; rel calib exec ffile_R pid ; seq //pid ; rel pid exec ffile_R wcnew ; seq //wcnew ; rel wcnew exec ffile_R ticpid ; seq //ticpid ; rel ticpid exec ffile_R rc ; seq //rc ; rel rc exec ffile_R mc ; seq //mc ; rel mc exec ffile_R trkh ; seq //trkh ; rel trkh * MESSAGE ' All SEQuences loaded into memory ' return * ! defseq *---------------------------------------------------------------------- macro ffile file cmzpath/[1] MESS Attaching : $CMZFILE() - $VERSION($lower($CMZFILE())) return * ! ffile *---------------------------------------------------------------------- macro attrd * MESSAGE ' Load NA44 CMZ files in read-only mode' * exec ffile_R ticpid ; exec ffile_R wcnew ; exec ffile_R trkh exec ffile_R na44doc ; exec ffile_R fkeeps ; exec ffile_R hfoc exec ffile_R hfrz ; exec ffile_R detfoc ; exec ffile_R geofoc exec ffile_R inter ; exec ffile_R hansgen ; exec ffile_R tfile exec ffile_R turtlee ; exec ffile_R drzeb ; exec ffile_R rc exec ffile_R mc ; exec ffile_R ut ; exec ffile_R dbtools exec ffile_R fatm44 ; exec ffile_R dst44 ; exec ffile_R calib exec ffile_R hd ; exec ffile_R pid * >> MESSAGE ' All NA44 CMZ files attached in read-only mode' return * * ! attrd *---------------------------------------------------------------------- macro ffile_R file cmzpath//[1] -R MESS Attaching : $CMZFILE() - $VERSION($lower($CMZFILE())) return * ! ffile_R *---------------------------------------------------------------------- macro attwk * * >> NA44 MESSAGE ' Load NA44 CMZ files in write mode' * exec ffile ticpid ; exec ffile wcnew ; exec ffile trkh exec ffile na44doc ; exec ffile fkeeps ; exec ffile hfoc exec ffile hfrz ; exec ffile detfoc ; exec ffile geofoc exec ffile inter ; exec ffile hansgen ; exec ffile tfile exec ffile turtlee ; exec ffile drzeb ; exec ffile rc exec ffile mc ; exec ffile ut ; exec ffile dbtools exec ffile fatm44 ; exec ffile dst44 ; exec ffile calib exec ffile hd ; exec ffile pid * MESSAGE ' All NA44 CMZ files attached in write mode' return * ! attwk *---------------------------------------------------------------------- macro cdf_patch * cdf_make command * * Macro to convert CDF files to fortran files and put them * in their proper place. * if ( $MACHINE = HPUX ) then set_show/host_shell /bin/tcsh elseif ( $MACHINE = SGI ) then set_show/host_shell /bin/tcsh endif EXEC ffile 1 dbtools set 'dbt_cdf.cdf' -F TEXT message ' writing DBT_CDF.CDF to disk...' ctot -y '//dbtools/dbcdf/dbt_cdf' message ' running the KUIP compiler...' shell kuipc 'dbt_cdf.cdf' 'dbt_cdf'//forext message ' reading the resulting fortran back to //DBTOOLS/DBTUTIL ...' CD //DBTOOLS/DBTUTIL delete '//dbtools/dbtutil/dbt_cdf' ftoc 'dbt_cdf'//forext rel dbtools *----- EXEC ffile 2 inter set 'iicdf.cdf' -F TEXT message ' writing IICDF.CDF to disk...' ctot -y '//inter/iicdf/iicdf' message ' running the KUIP compiler...' shell kuipc 'iicdf.cdf' 'iicdf'//forext message ' reading the resulting fortran back to //INTER/INTDECKS ...' CD '//inter/intdecks' delete '//inter/intdecks/ii_cdf' ftoc 'iicdf'//forext rel inter return * ! cdf_patch *---------------------------------------------------------------------- macro cdfimport * cdf_import command EXEC ffile 1 dbtools message ' reading DBT_CDF.FORTRAN back to //DBTOOLS/DBTUTIL ...' CD //DBTOOLS/DBTUTIL delete //dbtools/dbtutil/dbt_cdf ftoc dbt_cdf//forext rel dbtools *----- EXEC ffile 2 INTER message ' reading IICDF.FORTRAN back to //INTER/INTDECKS ...' CD '//inter/intdecks' delete '//inter/intdecks/ii_cdf' ftoc 'iicdf'//forext rel inter return * ! cdf_import *---------------------------------------------------------------------- macro make_new * mk_new command MESSAGE ' ' MESSAGE ' This will recompile decks that are out-of-date w.r.t. the library' MESSAGE ' ' * def_seq * exec mmake_new hfoc ; exec mmake_new hfrz ; exec mmake_new detfoc exec mmake_new geofoc ; exec mmake_new inter ; exec mmake_new hansgen exec mmake_new tfile ; exec mmake_new turtlee ; exec mmake_new drzeb exec mmake_new rc ; exec mmake_new mc ; exec mmake_new ut exec mmake_new dbtools ; exec mmake_new fatm44 ; exec mmake_new dst44 exec mmake_new calib ; exec mmake_new pid ; exec mmake_new hd exec mmake_new trkh ; exec mmake_new wcnew ; exec mmake_new ticpid * return * ! make_new *---------------------------------------------------------------------- macro mmake_new message ' starting '[1] set libpath/[1]//libext -L set forpath/*//forext -F file cmzpath/[1] mkall rel [1] return * ! mmake_new *---------------------------------------------------------------------- macro na44_patch * MESSAGE ' ' MESSAGE ' This will apply the NA44 correction cradles to the xx.cmz files.' MESSAGE ' ' * exec ppatch fkeeps ; exec ppatch hfoc ; exec ppatch hfrz exec ppatch detfoc ; exec ppatch geofoc ; exec ppatch inter exec ppatch hansgen ; exec ppatch tfile ; exec ppatch turtlee exec ppatch drzeb ; exec ppatch rc ; exec ppatch mc exec ppatch ut ; exec ppatch dbtools ; exec ppatch fatm44 exec ppatch dst44 ; exec ppatch calib ; exec ppatch hd exec ppatch pid ; exec ppatch trkh ; exec ppatch wcnew exec ppatch ticpid * return * ! na44_patch *---------------------------------------------------------------------- macro ppatch file cmzpath/[1] use cmzpath/[1]c.cra update * rel [1] return * ! ppatch *---------------------------------------------------------------------- macro back * macro for doing backups message ' Note the card files will be written to FSCRATCH:' exec backsub 23 TICPID ; exec backsub 22 WCNEW ; exec backsub 21 TRKH exec backsub 20 CALIB ; exec backsub 19 DBTOOLS ; exec backsub 18 DETFOC exec backsub 17 DRZEB ; exec backsub 16 DST44 ; exec backsub 15 FATM44 exec backsub 14 FKEEPS ; exec backsub 13 GEOFOC ; exec backsub 12 HANSGEN exec backsub 11 HD ; exec backsub 10 HFOC ; exec backsub 9 HFRZ exec backsub 8 INTER ; exec backsub 7 MC ; exec backsub 6 NA44DOC exec backsub 5 PID ; exec backsub 4 RC ; exec backsub 3 TFILE exec backsub 2 TURTLEE ; exec backsub 1 UT return * back *---------------------------------------------------------------------- macro backsub MESSAGE ' Starting backup for: '[2] EXEC ffile_R [1] [2] CTOY -A fscratch:[2].car REL [2] return * backsub *----------------------------------------------------------------------* * Macro to set debugger compile options. * macro debg if $MACHINE = VAX then set 'for/lis=FSCRATCH:/OBJ=FSCRATCH:/noopt/deb/check $COMPFILE' -c alias/create libpath 'FLIBD:' elseif $MACHINE = ALPHA then set 'for/lis=FSCRATCH:/OBJ=FSCRATCH:/noopt/deb/check $COMPFILE' -c elseif $MACHINE = HPUX then set 'f77 -K +ppu -w -g -p +E1 +U77 -c -C +T $compfile' -c alias/create libpath '$FLIBD' elseif $MACHINE = IBMRT then set 'f77 -qextname -qcharlen=32767 -g -c $compfile' -C f77 alias/create libpath '$FLIBD' elseif $MACHINE = SGI then set 'f77 -K +ppu -w -g -p +E1 +U77 -c -C +T $compfile' -c alias/create libpath '$FLIBD' elseif $MACHINE = SGI then set 'f77 -backslash -static -nocpp -w -g -tU -c -C -extend_source $compfile' -c alias/create libpath '$FLIBD' endif return * ! debg *----------------------------------------------------------------------*