Building Minfast/Reroot with egcs on DigitalUnix Alphas
This page summarizes my experience of building the Minfast and Reroot
packages for use on Alphas running DigitalUnix under the egcs compiler
system. My apologies for some of the long line lengths, path names
will do that, particularly with egcs, it seems. If you print
this out from Netscape, it will simply truncate them for you. How
convenient! If there are any comments or questions about anything
here, feel free to e-mail me at mualem@hep.umn.edu
.
Requirements:
The packages require the root libraries, available from CERN
. The current version is 2.21/08. I used version 2.20/06, which
was the latest version at the time. Binaries of the root libraries
are built for various platforms. I had trouble with the native DEC/CXX
version that was available, so I used the egcs 1.1 version, which of course
requires egcs to be installed. (I didn't write down precisely what
the troubles were, but I believe it had to do with the Makefile, other
parts seemed to work.)
Building egcs:
Using the egcs version introduced some problems, the first of which was
that our site did not have an egcs system running. First I built
that, which went smoothly. Egcs is available from cygnus
at http://egcs.cygnus.com.
Pitfalls in egcs build:
Be sure to build egcs with --enable-shared, otherwise root won't find the
right .so library.
Be sure to use gmake, gnu make, and not the DU make.
Building Minfast/Reroot:
There were some difficulties in building with the egcs compiler, since
the makefile was set up for the native compiler I had to alter the setup.source...
file that came with the Minfast distribution. The changes were to
the osf1 section of the setup.source. I changed it
to read:
if ($arch == 'osf1') then
# Path to shared libraries: using egcs-1.1.1 in /data/minos1/mualem/bin
setenv LD_LIBRARY_PATH .:${ROOTSYS}/lib:/data/minos1/mualem/bin/lib/gcc-lib/alphaev56-dec-osf4.0d/egcs-2.91.60:/data/minos1/mualem/egcsminfast/MINFAST/lib.osf1
endif
Yes, the library names do get rather long with egcs.
The second change, is to the Make.include file. Again,
the changes are to the osf1 section. It now reads:
ifeq ($(arch),osf1)
# alpha with egcs-1.1.1 installed in /data/minos1/mualem/bin/
CXX = g++
CXXFLAGS = -O -I$(ROOTSYS)/include -fPIC -fno-rtti -fno-exceptions \
-mcpu=ev5 -D__osf__ -D__alpha
LD = g++
LDFLAGS = -g
SOFLAGS = -Wl,-expect_unresolved,* -shared
GLIBS = $(ROOTLIBS) $(ROOTGLIBS) -L/usr/X11R6/lib \
-lXpm -lX11 -lm -lfor -lg2c
DllSuf := so
FORT := g77
FORTOPTS := $(FFLAGS) -fno-second-underscore -g -c -O $(F77INCS)
RANLIB := ranlib
INCLUDES := $(INCLUDES) \
-I/data/minos1/mualem/bin/lib/gcc-lib/alphaev56-dec-osf4.0d/egcs-2.91.6
0/include \
-I/data/minos1/mualem/bin/lib/gcc-lib/alphaev56-dec-osf4.0d/egcs-2.91.6
0/include/g++
SOCMD = $(LD)
endif
Pitfalls:
Again, be sure to use gmake, gnu make, and
not the DU make.
Be sure to use your new egcs compiler, and one that matches your root distribution,
otherwise there will be trouble. Use which to find out which
gcc etc., and rehash if necessary if you changed your path.
There was a pesky little problem in ADAMO_READ.F that I had to fix by editing
the source. It appears that the egcs g77 compiler did not like having
an unknown length string concatenation in the error print statements.
For example:
It did not like:
print *,' File: '//ADAMO_FILE(1:LENOCC(ADAMO_FILE)), ....
While it was fine with:
print *,' File: ',ADAMO_FILE(1:LENOCC(ADAMO_FILE)), ....
where the only difference was in the concatenation.
There were 6 lines changed in this way. It is interesting though that
in other statements, not print statements the syntax was acceptable.
This may be a local version problem, but the LABYRINTH environment variables
from the current distribution have underscores in them, while the minfast/reroot
env variables do not. e.g. LABYRINTH_LIB, and LABYRINTHLIB.
I worked around this by defining the LABYRINTH env variables first, and
then setenv'ing them to the non-underscored variety. For example:
setenv LABYRINTHLIB $LABYRINTH_LIB
This may also be a local config problem, but one I found. The adamo
library libtap.a is not found in $LABYRINTHLIB/libtap.a as is expected.
My workaround was to find it, and just relink rerootjob with it specified
explicitly.
Running
Running with the egcs version requires some setup also. Since the
libraries are not necessarily setup for you. This can be done in
a .login, or as a separate script. I chose to do it separately, in
a script called minvars which is as follows:
#
setenv EGCS_DIR /data/minos1/mualem/bin
setenv MINFASTDIR /data/minos1/mualem/egcsminfast
setenv ROOTSYS /data/minos1/mualem/egcsroot/root
setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${MINFASTDIR}/MINFAST/lib.osf1:${EGCS_DIR}/lib/gcc-lib/alphaev56-dec-osf4.0d/egcs-2.91.60
After this, it is possible to run from the directory where minfastjob and
rerootjob were built.
Pitfalls:
This may be mine alone, but running rerootjob, you
have to tell it to get N+1 events if you want N events. rerootjob
-n 2 will get you one event from each input file (specified in
reco_minos.gaf_list), and one geometry event.