RAPGAP compile

From EIC
Revision as of 16:56, 20 January 2012 by Elke (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CAN ONLY BE COMPILED IN 32BIT

Below are notes on compiling RAPGAP-3.2 The official notes from Hannes which are included in the file are:

 Installation procedure is as follows:
 Please note:
 RAPGAP 3.2 contains the source code of HERACLES 4.6.6 (from http://wwwthep.physik.uni-mainz.de/~hspiesb/djangoh/djangoh.html )
 RAPGAP 3.2 contains the source code of BASES/SPRING 5.1 (from ?)
 RAPGAP 3.2 contains the source code for CERNLIB lite
 RAPGAP 3.2 contains explicitly the block data from pythia.
 to change/update to newer version, please copy the block data
 pydata.f from the latest PYTHIA version into the directory
 rapgap-3.2/src/pythia-bkdata/pydata.f

1) Get the source
 tar xvfz rapgap-3.2xxxx.tar.gz
 cd rapgapxxxx
 2) set environment variables for PYTHIA, CERNLIB and HZTOOL
 example (Please change to the proper path of the libraries):
 
 In csh: 
 setenv PYTHIA "/Users/jung/jung/cvs/pythia6410"
 setenv LHAPDF "/Users/jung/jung/cvs/lhapdf/lhapdf-5.7.0"
 If you want to use ARIADNE, you need:
 setenv ARIADNE "/Users/jung/jung/cvs/ariadne412"  
 If the HZTOOL interface is wanted, you need in addition:
 setenv CERN_LIBS "/sw/lib -lmathlib -lkernlib -lpacklib"
 setenv HZTOOL "/Users/jung/jung/cvs/hztool-4/hztool-4.2"
 3)  Generate the Makefiles (by default creating shared libraries)
 ./configure --disable-shared --prefix=install-path
 if you want to create an execuatble using HZTOOL 
 ./configure --disable-shared --prefix=install-path hzexe=yes
 if you want to create an execuatble using ARIADNE
 ./configure --disable-shared --prefix=install-path ariadne=yes
 4) Compile the binary and the documentation
 make
 Install the program
 make install
 5) the execuatble is in bin
 run it with:
 install-path/rapgap < install-path/share/steer 
 or (if HZTOOL executable is generated)
 install-path/bin/rapgaphztool < install-path/share/steer
 5.) the documentation is in
 install-path/share/rapgap32.pdf'

However, unfortunately, this does not work straight out of the box.

Firstly, the ariadne code which comes with rapgap doesn't work, so you need to download ARIADNE v 4.12 and compile this and set the ARIADNE path to this directory.

Once the PATHS are correctly set, then you need to run the configure script. The configure script was changed so the environment variables for PYTHIA and the needed pythia-libs are correct.
before doing configure you need to do

setenv CXXFLAGS "-m32 -fno-inline"
setenv CFLAGS "-m32 -fno-inline"
setenv FFLAGS "-m32 -fno-inline"
setenv FCFLAGS "-m32 -fno-inline"

and

setenv PYTHIA "/afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-PP"
setenv LHAPDF_DIR "/afs/rhic.bnl.gov/eic/bin32/LHAPDF-5.8.6"
setenv CERN_LIBS "/cern/pro/lib -lmathlib -lkernlib -lpacklib_noshift"
setenv CERNLIBS "/cern/pro/lib -lmathlib -lkernlib -lpacklib_noshift"

Once this is done type ./configure --disable-shared --prefix=/afs/rhic.bnl.gov/eic/PACKAGES/RAPGAP-3.2/rapgap-3.202-beta-0.1/bin

If you then run make, it will run successfully until it gets to the following error:

g77 -I../include -I/afs/rhic.bnl.gov/eic/PACKAGES/RAPGAP-3.2/PYTHIA -fno-automatic -finit-local-zero -fno-backslash -fno-globals -ff90 -fpic -g -O2 -o 
rapgap32 rgmain.o drn.o pyr.o pyname.o upinit.o upevnt.o  ./.libs/librapgap32.a   ../bases51/.libs/libbases.a -L/afs/rhic.bnl.gov/eic/PACKAGES/RAPGAP-3.2/rapgap-3.202-beta-0.1/ariadne412/ariadne-4.12/lib  
-lar4 -L/afs/rhic.bnl.gov/eic/PACKAGES/RAPGAP-3.2/PYTHIA -lpythia6 -L/afs/rhic.bnl.gov/eic/PACKAGES/RAPGAP-3.2/LHAPDF2/lib /afs/rhic.bnl.gov/eic/PACKAGES/macl/NEWRAPGAP/LHAPDF2/lib/libLHAPDF.so 
 -lgfortranbegin -lgfortran ../misc/.libs/libmycern.a   -Wl,--rpath -Wl,/afs/rhic.bnl.gov/eic/PACKAGES/macl/NEWRAPGAP/LHAPDF2/lib -Wl,--rpath -Wl,/afs/rhic.bnl.gov/eic/PACKAGES/macl/NEWRAPGAP/LHAPDF2/lib
 /usr/bin/ld: cannot find -lgfortranbegin

In order to correct this, you have to add in the correct path by inserting:

 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/ 

before the -lgfortranbegin, even if you edit all makefiles by hand and put the path in front of -lgfortranbegin you still need to do

 cd src
 g77 -I../include -I/afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-PP -fno-automatic -finit-local-zero -fno-backslash -fno-globals -ff90 -fpic -m32 -fno-inline -fno-automatic -o rapgap32 rgmain.o drn.o pyr.o pyname.o upinit.o   
 upevnt.o ./.libs/librapgap32.a ../bases51/.libs/libbases.a ../ariadne-dummy/.libs/libar4.a -L/afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-PP/lib -lpythia6 -L/afs/rhic.bnl.gov/eic/bin32/LHAPDF-5.8.6/lib 
 /afs/rhic.bnl.gov/eic/bin32/LHAPDF-5.8.6/lib/libLHAPDF.so -L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/ -lgfortranbegin -lgfortran ../misc/.libs/libmycern.a -Wl,--rpath -Wl,/afs/rhic.bnl.gov/eic/bin32/LHAPDF-5.8.6/lib 
 -Wl,--rpath -Wl,/afs/rhic.bnl.gov/eic/bin32/LHAPDF-5.8.6/lib
 cd -
 make install

There will be errors with the latex part, but these can be ignored.

CAVEATS:

  • ariadne-4.12 cannot be compiled with gfortran, so for the moment you cannot run RAPGAP with the ariadne parton showers