July 3, 1997
This page will discuss how to do two elementary things which
are important parts of code development:
The scripts mentioned below are found on fnsimu1 in $MCFAST_DIR/bin.
As in all of these examples, do NOT specify a file type (.inc).
In the system adopted by MCFast, included files are resolved in a preprocessing step which is run before compilation ( the cpp step). To see what directories are searched for include files at cpp time, look at the following lines in your GNUmakefile: INC1=, INC2= etc.
There is one important caveat. If you are looking for QQ include files, you should take them from $QQ_DIR/src/inc, not from any other place in the QQ_DIR heirarchy. This caveat is the main reason that there are separate commands to look for include files and other files: the search for the include files covers a more restricted path.
The script is quite short. It uses the unix "find" command, for which there is a tutorial below.
If the routine is not found by this procedure, there are two likely possibilities. One is that the routine comes from some system library or from the CERN libraries; this can be checked by looking at the map file. The second possibility is discussed below.
This command will be slower than the others. The output of this command is a list of all lines in the source tree which contain the requested character string and the names of the files in which the output was found. In each case the name of the file FOLLOWS the listing of matched lines. It should be clear from the listing where the function is defined and where it is referenced. This script only searches .F and .c files.
% find $MCFAST_DIR/simulator \( -name "*.F" -o -name "*.c" \) \ -exec grep -i trk_trace_param {} \; -print integer function trk_trace_param(hep) 520 trk_trace_param = 0 9998 trk_trace_param = 1 5000 format('trk_trace_param: event ', i6, ' at track ', i5,'.', 9999 trk_trace_param = 2 5001 format('trk_trace_param: Tracing aborted during event ', i6, c $Id$ c $Log$ c Revision 1.1 2000/06/19 19:59:11 eugenio c Initial revision c c Revision 1.2 1998/07/03 23:16:01 kutschke c Updates for new cvs structure. c /home/sim1/bphyslib/release/dev/simulator/track/src/trk_trace_param.F external trk_trace_param integer trk_trace_param & trk_trace_param') status = trk_trace_param(hep) /home/sim1/bphyslib/release/dev/simulator/track/src/trk_trace_scat.F external trk_trace_param, trk_trace_scat integer trk_trace_param, trk_trace_scat status = trk_trace_param(hep) !trace particles through detectors /home/sim1/bphyslib/release/dev/simulator/user/src/usr_before_trigger.FNotice that the filename is printed after the text from that file. From the above one can see that the routine trk_trace_param is defined in the file:
Lynn Garren garren@fnal.gov