Difference between revisions of "Solgemc installation outside JLAB"

From Hall A Wiki
Jump to: navigation, search
(move scons_scripts up)
(Rewrite following more straightforward second installation)
Line 1: Line 1:
 
by Rich Holmes
 
by Rich Holmes
  
I have been working on getting the Geant4 simulation and related software up and running on a non JLAB system; here are some notes on what I needed to do. I may be omitting some steps here and I definitely have rearranged the order and left out some steps that I tried but that didn't seem to give useful results, so there are no guarantees this will work for anyone else, but it should cut down on confusion, or so I hope.
+
I have been working on getting the Geant4 simulation and related software up and running on a couple of non JLAB systems; here are some notes on what I did most recently. I may be omitting some steps here and I definitely have rearranged the order and left out some steps that I tried but that didn't seem to give useful results, so there are no guarantees this will work for anyone else, but it should cut down on confusion, or so I hope. This should be a better example to follow than my previous one (thanks to better understanding on my part, and probably some improvements in the solgemc package itself), but you can [[Earlier solgemc installation outside JLAB|read about that too]] if you want.
  
The target system for now is one running CentOS 5.6 (32 bit i386), newly installed. Install developer packages, of course.
+
The target system for now is one running Ubuntu 10.10 (32 bit i386).
 +
 
 +
Generally speaking what I tried to do was to set up a directory structure similar to what is installed using the gemc RPM; qt4 and geant4 already existed on this system but not necessarily configured as needed for gemc, so I put new installations into the new directory tree.
 +
 
 +
== initial setup ==
 +
# mkdir ~/jlab_software ''and cd there''
 +
# mkdir Linux_Ubuntu10.04-i686-gcc4.4.3
 +
 
 +
== environment ==
 +
# svn checkout https://phys12svn.jlab.org/repos/trunk/ce ''in ~/jlab_software''
 +
# ''Edit to set DEFAULT_JLAB_ROOT to ~/jlab_software. Also edit default software versions below that as needed.''
 +
# ''Depending on your Linux distribution you may need to edit ce/osreleast.pl in the obvious place to set an appropriate value for $release. For my Ubuntu 10.10 installation this was not necessary.''
 +
# source ~/jlab_software/ce/jlab.csh
  
 
== scons ==
 
== scons ==
  
# ''go to http://rpm.pbone.net and search for scons. I find a link for RH EL5 i386 version 1.2.0. This is an older version but it's what's on ifarml6. Install with rpm.''
+
# ''Install scons using Ubuntu Software Center''
# svn checkout https://clas12svn.jlab.org/repos/trunk/clas12/scons_scripts/
+
# svn checkout https://clas12svn.jlab.org/repos/trunk/clas12/scons_scripts/ ''in ~/jlab_software''
  
 
== Qt4 ==
 
== Qt4 ==
  
# sudo rpm -ivh http://software.freivald.com/centos/software.freivald.com-1.0.0-1.noarch.rpm
+
# ''Download sources from http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.tar.gz''
# sudo yum update fontconfig fontconfig-devel qt4 qt4-devel ''(Not sure all those are required)''
+
# ''Install following https://gemc.jlab.org/gemc/Support/Entries/2011/1/22_Getting_and_Compiling_qt4.html into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/qt''
  
 
== ROOT ==
 
== ROOT ==
  
# ''Install ROOT as usual from source; use'' configure --enable-qt --enable-qtgsi
+
# ''Install ROOT as usual from source into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/root ; use'' configure --enable-qt --enable-qtgsi
  
== gemc ==
+
== CLHEP ==
  
# sudo rpm -ivh http://www.jlab.org/12gev_phys/RPMS/noarch/jlab-phys-1.3-1.noarch.rpm
+
# ''Install following https://gemc.jlab.org/gemc/Support/Entries/2011/1/22_Getting_and_Compiling_clhep.html into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/clhep''
# sudo yum install gemc-jlab
+
# ''Note that it appears one must work in (t)csh to run gemc. Irritating — I prefer bash — but that's life. To facilitate modifications, copy to user directory and work with that:'' cp -rp /usr/local/jlab_software ~/
+
# setenv JLAB_ROOT ~/jlab_software
+
# ''Edit ~/jlab_software/ce/osrelease.pl. Add a test for CentOS 5.6 in the obvious place.''
+
# sudo ln -s ~/jlab_software/Linux_RHEL5-i686-gcc4.1.2 ~/jlab_software/Linux_CentOS5.6-i686-gcc4.1.2 ''See below for continuation of gemc installation''
+
  
== solgemc ==
+
== geant4 ==
  
# svn checkout https://jlabsvn.jlab.org/svnroot/solid/solgemc ''See below for continuation of solgemc installation''
+
# ''Do a manual install from sources into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/geant4. Sources from http://geant4.web.cern.ch/geant4/support/download.shtml ; manual installation instructions at http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch02s03.html . The ce environment defines the needed environment variables for correct configuration; don't use ./Configure -build .''
# ''from launchpad.net/scons-qt4, download, put in ~/solgemc/site_scons/site_tools/qt4''
+
  
== gemc continued ==
+
== evio ==
  
# cp -rp ~/solgemc/site_scons ~/jlab_software/Linux_CentOS5.6-i686-gcc4.1.2/gemc
+
# svn checkout https://clas12svn.jlab.org/repos/trunk/clas12/evio ''and put into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/evio; cd there.''
# ''Edit ~/jlab_software/Linux_CentOS5.6-i686-gcc4.1.2/gemc/SConstruct: copy the env.Library line at the end, paste, and replace env.Library with env.SharedLibrary''
+
# ./configure
# cd ~/jlab_software/Linux_CentOS5.6-i686-gcc4.1.2/gemc
+
# make
 +
# make install
 +
 
 +
== mysql ==
 +
 
 +
# sudo apt-get install mysql-client libmysqlclient-dev
 +
 
 +
== gemc ==
 +
 
 +
# ''Install following https://gemc.jlab.org/gemc/Support/Entries/2011/1/19_Getting_and_Compiling_gemc.html into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/gemc and cd there.''
 +
# ''Edit ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/gemc/SConstruct: copy the env.Library line at the end, paste, and replace env.Library with env.SharedLibrary .''
 
# scons
 
# scons
# sudo chcon -t texrel_shlib_t ~/jlab_software/Linux_CentOS5.6-i686-gcc4.1.2/gemc/libgemc.so ''to avoid an error caused by selinux''
+
# ''Depending on your Linux installation you may need something like '' sudo chcon -t texrel_shlib_t ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/gemc/libgemc.so ''to avoid an error caused by selinux; this was not necessary for my Ubuntu 10.10 installation.''
  
== solgemc continued ==
+
== solgemc ==
  
# ''Edit ~/solgemc/solgemc_env.csh:''
+
# svn checkout https://jlabsvn.jlab.org/svnroot/solid/solgemc
## ''Comment out '' set UNAME... '' and following test for 64 bit''
+
## ''Add '' unsetenv JLAB_ROOT ''and'' unsetenv JLAB_ROOT_ARCH
+
## ''Add setenv JLAB_ROOT ~/jlab_software/ ''and'' setenv JLAB_ROOT_ARCH $JLAB_ROOT/Linux_CentOS5.6-i686-gcc4.1.2/
+
## ''Add or change'' setenv GEMC $JLAB_ROOT_ARCH/gemc ''and'' setenv GEMC_EVIO2ROOT $JLAB_ROOT_ARCH/bin ''and'' setenv GEMC_HOST      127.0.0.1 ''and'' setenv GEMC_USER      soliduser
+
## ''Change'' setenv G4INSTALL $JLAB_ROOT_ARCH/geant4/4.9.3.p02
+
## ''Comment out'' source $G4INSTALL/env.csh ''and add'' source $JLAB_ROOT/ce/jlab.csh
+
## ''Change'' setenv QTDIR /usr/lib/qt4
+
## ''Change'' setenv EVIO $JLAB_ROOT_ARCH/evio
+
## ''Change'' set PYTHONADD=~/scons_scripts
+
 
# ''To test, set up mysql tunneling. In runnewbaf_solgemc.sh comment out first command and uncomment second, change -N to 10000, then run this. I get a memory allocation crash at the end but the output file is written.''
 
# ''To test, set up mysql tunneling. In runnewbaf_solgemc.sh comment out first command and uncomment second, change -N to 10000, then run this. I get a memory allocation crash at the end but the output file is written.''
 +
 +
(FOLLOWING COPIED FROM OLD ENTRY AND TO BE EDITED LATER)
 +
  
 
== banks ==
 
== banks ==

Revision as of 14:22, 8 June 2011

by Rich Holmes

I have been working on getting the Geant4 simulation and related software up and running on a couple of non JLAB systems; here are some notes on what I did most recently. I may be omitting some steps here and I definitely have rearranged the order and left out some steps that I tried but that didn't seem to give useful results, so there are no guarantees this will work for anyone else, but it should cut down on confusion, or so I hope. This should be a better example to follow than my previous one (thanks to better understanding on my part, and probably some improvements in the solgemc package itself), but you can read about that too if you want.

The target system for now is one running Ubuntu 10.10 (32 bit i386).

Generally speaking what I tried to do was to set up a directory structure similar to what is installed using the gemc RPM; qt4 and geant4 already existed on this system but not necessarily configured as needed for gemc, so I put new installations into the new directory tree.

initial setup

  1. mkdir ~/jlab_software and cd there
  2. mkdir Linux_Ubuntu10.04-i686-gcc4.4.3

environment

  1. svn checkout https://phys12svn.jlab.org/repos/trunk/ce in ~/jlab_software
  2. Edit to set DEFAULT_JLAB_ROOT to ~/jlab_software. Also edit default software versions below that as needed.
  3. Depending on your Linux distribution you may need to edit ce/osreleast.pl in the obvious place to set an appropriate value for $release. For my Ubuntu 10.10 installation this was not necessary.
  4. source ~/jlab_software/ce/jlab.csh

scons

  1. Install scons using Ubuntu Software Center
  2. svn checkout https://clas12svn.jlab.org/repos/trunk/clas12/scons_scripts/ in ~/jlab_software

Qt4

  1. Download sources from http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.tar.gz
  2. Install following https://gemc.jlab.org/gemc/Support/Entries/2011/1/22_Getting_and_Compiling_qt4.html into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/qt

ROOT

  1. Install ROOT as usual from source into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/root ; use configure --enable-qt --enable-qtgsi

CLHEP

  1. Install following https://gemc.jlab.org/gemc/Support/Entries/2011/1/22_Getting_and_Compiling_clhep.html into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/clhep

geant4

  1. Do a manual install from sources into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/geant4. Sources from http://geant4.web.cern.ch/geant4/support/download.shtml ; manual installation instructions at http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch02s03.html . The ce environment defines the needed environment variables for correct configuration; don't use ./Configure -build .

evio

  1. svn checkout https://clas12svn.jlab.org/repos/trunk/clas12/evio and put into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/evio; cd there.
  2. ./configure
  3. make
  4. make install

mysql

  1. sudo apt-get install mysql-client libmysqlclient-dev

gemc

  1. Install following https://gemc.jlab.org/gemc/Support/Entries/2011/1/19_Getting_and_Compiling_gemc.html into ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/gemc and cd there.
  2. Edit ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/gemc/SConstruct: copy the env.Library line at the end, paste, and replace env.Library with env.SharedLibrary .
  3. scons
  4. Depending on your Linux installation you may need something like sudo chcon -t texrel_shlib_t ~/jlab_software/Linux_Ubuntu10.04-i686-gcc4.4.3/gemc/libgemc.so to avoid an error caused by selinux; this was not necessary for my Ubuntu 10.10 installation.

solgemc

  1. svn checkout https://jlabsvn.jlab.org/svnroot/solid/solgemc
  2. To test, set up mysql tunneling. In runnewbaf_solgemc.sh comment out first command and uncomment second, change -N to 10000, then run this. I get a memory allocation crash at the end but the output file is written.

(FOLLOWING COPIED FROM OLD ENTRY AND TO BE EDITED LATER)


banks

  1. svn checkout http://clas12svn.jlab.org/repos/trunk/clas12/banks into ~/solgemc/
  2. unpack tarball sent by Seamus, copy src/example4.cc to ~/solgemc/banks/src/
  3. cp -rp ~/solgemc/site_scons ~/solgemc/banks
  4. ln -s /usr/local/root ~/jlab_software/Linux_CentOS5.6-i686-gcc4.1.2/root/5.28
  5. Edit ~/jlab_software/ce/root.env to replace root/lib/root with root/lib (In a standard ROOT install the libraries are in /usr/local/root/lib, not /usr/local/root/lib/root. However this turns out not to be enough, so we kludge a fix:)
  6. ln -s /usr/local/root/lib /usr/local/root/lib/root
  7. cd ~/solgemc/banks
  8. edit src/bank.cc to replace db.setUserName("clasuser"); with db.setUserName("soliduser"); db.setPassword("ilovesolid");
  9. scons

event generator

  1. svn co 'http://jlabsvn.jlab.org/svnroot/solid/evgen'
  2. follow install instructions for eicRate_20101102 but I needed to add -L /home/$(USER)/lib in definition of GLIBS in Makefile.arch).

root2lund

  1. follow install instructions for root2lund. Did not need any environment variable changes.