Attempting to build DD4hep on a Mac
Ingredients
- CMake 2.8 or higher
- Xerces-C (might be optional)
- Geant4
- CLHEP (might be optional)
- Root
- DD4hep
Problems
- Need CMake 2.8 or newer
- Geant4 must be compiled with GDML
- Downloaded root binary needs libpcre.dylib
- DD4hep needs libssl.1.0.0.dylib
- ILCSoft is required and did not install on a Mac
Installation Steps
Would be great if this could have been done simpler, but after a lot of frustrating trial and error I collected this list of must do’s:
CMake:
- get cmake-2.8.12.2 from http://www.cmake.org
- unpack
- cd cmake-2.8.12.2/
- ./bootstrap --prefix=/Users/protopop/DD4hep
- make
- make install
- export PATH=$PATH:/Users/protopop/DD4hep/cmake-2.8.12.2/bin
Xerces-C:
- get Xerces-C from http://xerces.apache.org/xerces-c
- unpack
- cd xerces-c-3.1.1/
- ./configure (after editing ac_default_prefix install path in the script itself)
- make
- make install
Geant4:
- get geant4.9.5.p02 source from http://geant4.web.cern.ch/geant4/support/source_archive.shtml
- unpack
- cd geant4.9.5.p02/
- mkdir build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=/Users/protopop/DD4hep/Geant4 -DGEANT4_USE_GDML=ON -DXERCESC_INCLUDE_DIR=/Users/protopop/DD4hep/xercesc/include -DXERCESC_LIBRARY=/Users/protopop/DD4hep/xercesc/lib/libxerces-c.dylib ..
- make
- make install
CHLEP:
- get chlep from http://proj-clhep.web.cern.ch/proj-clhep/
- unpack
Root:
- get root precompiled binary from http://root.cern.ch/drupal/content/production-version-534
- unpack
and find out that root requires
libpcre.dylib ...
- get pcre from http://sourceforge.net/projects/pcre/
- cd pcre-8.35/
- ./configure
- make
- make install prefix=/Users/protopop/DD4hep/pcre
- export DYLD_LIBRARY_PATH=/Users/protopop/DD4hep/pcre/lib
- now root will run
OpenSSL:
- get openssl via macports with 'sudo port install openssl’
- export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/local/lib
Now the actual DD4hep compilation:
- get DD4hep with svn co https://svnsrv.desy.de/public/aidasoft/DD4hep/trunk DD4hep
- cd DD4hep
- edit DDG4/src/Geant4UIManager.cpp and change line 55 to ui = new G4UIExecutive(1,(char**)args);//,m_sessionType.c_str());
- mkdir build
- cd build/
- source /Users/protopop/DD4hep/root-v5-34-00-patches/bin/thisroot.sh
- source /Users/protopop/DD4hep/Geant4/bin/geant4.sh
- export CLHEP_BASE_DIR="/Users/protopop/DD4hep/chlep_x86_64-mac106-gcc42-opt
- export DYLD_LIBRARY_PATH=/Users/protopop/DD4hep/pcre/lib:/opt/local/lib
- cmake -DCMAKE_INSTALL_PREFIX=/Users/protopop/DD4hep -DDD4HEP_WITH_GEANT4=on -DGeant4_DIR=/Users/protopop/DD4hep/Geant4/lib/Geant4-9.5.2 -DDD4HEP_USE_XERCESC=ON -DXERCESC_ROOT_DIR=/Users/protopop/DD4hep/xercesc ..
- make
- cd lib/
- export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/protopop/DD4hep/xercesc/lib
- /Users/protopop/DD4hep/root-v5-34-00-patches/bin/genmap -debug -i libDD4hepG4Legacy.dylib -o libDD4hepG4Legacy.rootmap
- cd ../
- make install
To try the first examples, we need
gear:
- download GEAR from http://ilcsoft.desy.de/portal/software_packages/gear/index_eng.html
- and this needs ilcutils ...
- ... but ilcsoft doesn’t want to install on a Mac
so back to the
linux box ...