Warning, /EICrecon/docs/get-started/manual-build.md is written in an unsupported language. File is not indexed.
0001 # EICrecon manual compiling
0002 These are instructions for building `EICrecon` and all of its dependencies manually.
0003 These are a last resort. Please see [instructions for `eic-shell`](Use_with_eic_shell.md).
0004
0005 ### Let's go!
0006
0007 Start by setting the EICTOPDIR environment variable. This makes it easier
0008 to reference directories in the instructions below. Set this to a
0009 directory where you want to build and keep the software. If you wish to
0010 use your current directory then just do this:
0011 ~~~
0012 export EICTOPDIR=${PWD}
0013 ~~~
0014
0015 ### Python Environment
0016 PODIO requires that the python packages _pyyaml_ and _jinja2_ be installed.
0017 If these are not already installed on your system then you can do so either
0018 at a system level (requires sudo privilege) or just create a virtual environment:
0019
0020 ~~~
0021 mkdir -p ${EICTOPDIR}/python/virtual_environments
0022 python3 -m venv ${EICTOPDIR}/python/virtual_environments/venv
0023 source ${EICTOPDIR}/python/virtual_environments/venv/bin/activate
0024 pip install pyyaml jinja2
0025 ~~~
0026
0027 ### boost
0028 Make sure [boost](https://www.boost.org/) is installed (needed for DD4hep).
0029 On macosx 12.4 I did this with:
0030 ~~~
0031 brew install boost
0032 ~~~
0033
0034 On RHEL7.9 the version installed via yum was too old so I did it from source
0035 like this.
0036 ~~~
0037 export BOOST_VERSION=boost-1.79.0
0038 mkdir -p ${EICTOPDIR}/BOOST
0039 cd ${EICTOPDIR}/BOOST
0040 export Boost_ROOT=${EICTOPDIR}/BOOST/${BOOST_VERSION}/installed
0041 git clone --recursive https://github.com/boostorg/boost.git -b ${BOOST_VERSION} ${BOOST_VERSION}
0042 cmake -S ${BOOST_VERSION} -B build -DCMAKE_INSTALL_PREFIX=${Boost_ROOT} -DCMAKE_CXX_STANDARD=17
0043 cmake --build build --target install -- -j8
0044 ~~~
0045
0046 ### ROOT
0047 We need a modern root version built using the C++17 standard. You may obtain
0048 this in a number of ways for your system, but here is how it may be built
0049 from source. Be aware that this is the longest step in the whole produce
0050 since it may take several minutes (maybe much more). Adjust the number of
0051 threads in the _make_ command to match what is available on your system to
0052 speed it up.
0053 ~~~
0054 mkdir ${EICTOPDIR}/root
0055 cd ${EICTOPDIR}/root
0056 wget https://root.cern/download/root_v6.26.04.source.tar.gz
0057 tar xzf root_v6.26.04.source.tar.gz
0058 mv root-6.26.04 root-6.26.04.src
0059 cmake -S root-6.26.04.src -B root-6.26.04.build -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=root-6.26.04 -Dbuiltin_glew=ON
0060 cmake --build root-6.26.04.build --target install -- -j8
0061
0062 source ${EICTOPDIR}/root/root-6.26.04/bin/thisroot.sh
0063 ~~~
0064
0065 ### JANA
0066 ~~~
0067 export JANA_VERSION=v2.0.7
0068 export JANA_HOME=${EICTOPDIR}/JANA/${JANA_VERSION}
0069 git clone https://github.com/JeffersonLab/JANA2 -b ${JANA_VERSION} ${JANA_HOME}
0070 cd ${JANA_HOME}
0071 cmake -S . -B build -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=${JANA_HOME} -DUSE_ROOT=1 # -DUSE_ZEROMQ=1 -DUSE_PYTHON=1
0072 cmake --build build --target install -- -j8
0073 source ${JANA_HOME}/bin/jana-this.sh # Set environment to use this
0074 ~~~
0075
0076 ### fmt
0077 ~~~
0078 export FMT_VERSION=8.1.1
0079 mkdir -p ${EICTOPDIR}/detectors/fmt
0080 cd ${EICTOPDIR}/detectors/fmt
0081 export fmt_ROOT=${EICTOPDIR}/detectors/fmt/${FMT_VERSION}/install
0082 export LD_LIBRARY_PATH=${EICTOPDIR}/detectors/fmt/${FMT_VERSION}/install/lib64:${EICTOPDIR}/detectors/fmt/${FMT_VERSION}/install/lib:${LD_LIBRARY_PATH}
0083 git clone https://github.com/fmtlib/fmt -b ${FMT_VERSION} ${FMT_VERSION}
0084 cmake -S ${FMT_VERSION} -B build -DCMAKE_INSTALL_PREFIX=${fmt_ROOT} -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON
0085 cmake --build build --target install -- -j8
0086 ~~~
0087
0088 ### spdlog
0089 ~~~
0090 export SPDLOG_VERSION=v1.9.2
0091 export SPDLOG_HOME=${EICTOPDIR}/spdlog/${SPDLOG_VERSION}
0092 export spdlog_ROOT=${SPDLOG_HOME}/install
0093 git clone https://github.com/gabime/spdlog -b ${SPDLOG_VERSION} ${SPDLOG_HOME}
0094 cd ${SPDLOG_HOME}
0095 cmake -S . -B build -DCMAKE_POLICY_DEFAULT_CMP0074=NEW -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=${spdlog_ROOT} -DSPDLOG_BUILD_SHARED=ON -DSPDLOG_FMT_EXTERNAL_HO=ON
0096 cmake --build build --target install -- -j8
0097 ~~~
0098
0099 ### PODIO
0100 ~~~
0101 export PODIO_VERSION=v00-15
0102 export PODIO_HOME=${EICTOPDIR}/PODIO/${PODIO_VERSION}
0103 export PODIO=${PODIO_HOME}/install
0104 export podio_ROOT=${PODIO}
0105 git clone https://github.com/AIDASoft/podio -b ${PODIO_VERSION} ${PODIO_HOME}
0106 cd ${PODIO_HOME}
0107 cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${PODIO} -DCMAKE_CXX_STANDARD=17 -DUSE_EXTERNAL_CATCH2=OFF
0108 cmake --build build --target install -- -j8
0109 source ${PODIO_HOME}/env.sh
0110 ~~~
0111
0112 ### EDM4hep
0113 ~~~
0114 export EDM4HEP_VERSION=v00-06
0115 export EDM4HEP_HOME=${EICTOPDIR}/EDM4hep/${EDM4HEP_VERSION}
0116 export EDM4HEP=${EDM4HEP_HOME}/install
0117 export EDM4HEP_ROOT=${EDM4HEP}
0118 git clone https://github.com/key4hep/EDM4hep -b ${EDM4HEP_VERSION} ${EDM4HEP_HOME}
0119 cd ${EDM4HEP_HOME}
0120 cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${EDM4HEP} -DCMAKE_CXX_STANDARD=17 -DUSE_EXTERNAL_CATCH2=OFF
0121 cmake --build build --target install -- -j8
0122 ~~~
0123
0124 ### edm4eic
0125 ~~~
0126 export EDM4EIC_VERSION=v1.0.1
0127 export EDM4EIC_HOME=${EICTOPDIR}/edm4eic/${EDM4EIC_VERSION}
0128 export EDM4EIC_ROOT=${EDM4EIC_HOME}/install
0129 git clone https://github.com/eic/edm4eic -b ${EDM4EIC_VERSION} ${EDM4EIC_HOME}
0130 cd ${EDM4EIC_HOME}
0131 cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${EDM4EIC_ROOT} -DCMAKE_CXX_STANDARD=17
0132 cmake --build build --target install -- -j8
0133 ~~~
0134
0135 ### lcio
0136 ~~~
0137 export LCIO_VERSION=v02-17-01
0138 export LCIO_HOME=${EICTOPDIR}/LCIO/${LCIO_VERSION}
0139 export LCIO_ROOT=${LCIO_HOME}/install
0140 git clone https://github.com/iLCSoft/LCIO -b ${LCIO_VERSION} ${LCIO_HOME}
0141 cmake -S ${LCIO_HOME} -B ${LCIO_HOME}/build -DCMAKE_INSTALL_PREFIX=${LCIO_ROOT} -DCMAKE_CXX_STANDARD=17
0142 cmake --build ${LCIO_HOME}/build --target install -- -j8
0143 ~~~
0144
0145 ### DD4hep
0146 These instructions build DD4hep without Geant4 support. The reconstruction
0147 framework does not otherwise require Geant4 so we avoid including support
0148 for it for now.
0149 ~~~
0150 export DD4HEP_VERSION=v01-23
0151 export DD4HEP_HOME=${EICTOPDIR}/DD4hep/${DD4HEP_VERSION}
0152 git clone https://github.com/AIDASoft/DD4hep -b ${DD4HEP_VERSION} ${DD4HEP_HOME}
0153 cd ${DD4HEP_HOME}
0154 cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${DD4HEP_HOME}/install -DCMAKE_CXX_STANDARD=17 -DBUILD_DOCS=OFF -DBoost_NO_BOOST_CMAKE=ON -DROOT_DIR=$ROOTSYS -DDD4HEP_USE_LCIO=ON -DDD4HEP_USE_EDM4HEP=ON
0155 cmake --build build --target install -- -j8
0156 source ${DD4HEP_HOME}/install/bin/thisdd4hep.sh
0157 ~~~
0158
0159 ### ACTS
0160 ~~~
0161 export EIGEN_VERSION=3.4.0
0162 export EIGEN_HOME=${EICTOPDIR}/EIGEN/${EIGEN_VERSION}
0163 git clone https://gitlab.com/libeigen/eigen.git -b ${EIGEN_VERSION} ${EIGEN_HOME}
0164 cd ${EIGEN_HOME}
0165 cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${EIGEN_HOME} -DCMAKE_CXX_STANDARD=17
0166 cmake --build build --target install -- -j8
0167 export Eigen3_ROOT=${EIGEN_HOME}
0168
0169 export ACTS_VERSION=v19.9.0
0170 export ACTS_HOME=${EICTOPDIR}/ACTS/${ACTS_VERSION}
0171 git clone https://github.com/acts-project/acts -b ${ACTS_VERSION} ${ACTS_HOME}
0172 cd ${ACTS_HOME}
0173 cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${ACTS_HOME}/install -DCMAKE_CXX_STANDARD=17 -DACTS_BUILD_PLUGIN_DD4HEP=on -DACTS_BUILD_PLUGIN_TGEO=on -DACTS_BUILD_PLUGIN_JSON=ON -DACTS_BUILD_PLUGIN_DIGITIZATION=ON
0174 cmake --build build --target install -- -j8
0175 source ${ACTS_HOME}/install/bin/this_acts.sh
0176 ~~~
0177
0178 ### IRT
0179 ~~~
0180 export IRT_HOME=${EICTOPDIR}/irt
0181 export IRT_ROOT=${IRT_HOME}/install
0182 git clone https://github.com/eic/irt ${IRT_HOME}
0183 cmake -S ${IRT_HOME} -B ${IRT_HOME}/build -DCMAKE_INSTALL_PREFIX=${IRT_ROOT}
0184 cmake --build ${IRT_HOME}/build -j8
0185 cmake --install ${IRT_HOME}/build
0186 ~~~
0187
0188 ### Detector Geometry
0189 The detector geometry itself is contained in separate repositories.
0190 The _EPIC_ reference detector design is in a repository
0191 located [here](https://github.com/eic/epic). This requires at least _ACTS_
0192 and the _{fmt}_ package the latter of which is built in the instructions here.
0193
0194 Note: These instructions turn off the requirement of the DDG4 component in the
0195 _epic_ geometry since it requires GEANT4 which is not needed here.
0196
0197 ~~~
0198 mkdir -p ${EICTOPDIR}/detectors
0199 cd ${EICTOPDIR}/detectors
0200
0201 export DETECTOR_PATH=${EICTOPDIR}/detectors/epic
0202 git clone https://github.com/eic/epic.git ${DETECTOR_PATH}
0203 cmake -S ${DETECTOR_PATH} -B ${DETECTOR_PATH}/build -DCMAKE_INSTALL_PREFIX=${DETECTOR_PATH} -DCMAKE_CXX_STANDARD=17 -DUSE_DDG4=OFF
0204 cmake --build ${DETECTOR_PATH}/build --target install -- -j8
0205 ~~~
0206
0207 ### EICrecon
0208 The EICrecon repository is where the reconstruction code will be kept.
0209 There is a top-level CMakeLists.txt file here that can sort-of build
0210 everything. Well, OK. The BarrelEMCal plugin requires a header from
0211 the jana_edm4hep and tries to get it from its JANA install location.
0212 Thus, it is only available after jana_edm4hep has been installed. So
0213 when you build _EICrecon_, you should do each part individually
0214 as shown below. The system needs to be updated to be less dependent on
0215 the install locations of the plugins, but that will wait until an
0216 official build system is established.
0217 ~~~
0218 git clone https://github.com/eic/EICrecon ${EICTOPDIR}/EICrecon
0219
0220 cd ${EICTOPDIR}/EICrecon
0221 cmake -S . -B build -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=Debug
0222 cmake --build build --target install -- -j8
0223 ~~~
0224
0225 ### Testing
0226 Check that each of the plugins at least load correctly without crashing
0227 by running them without arguments:
0228
0229 ~~~
0230 jana -PPLUGINS=podio,dd4hep
0231 ~~~