Building hdgeant4 with JANA2 on ifarm9

From epsciwiki
Revision as of 17:18, 25 June 2024 by Rasool (talk | contribs) (Created page with "=== Prerequisites === Before proceeding with building hdgeant4, ensure you have already built JANA2, halld_recon, and halld_sim following the instructions provided in [https:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Prerequisites

Before proceeding with building hdgeant4, ensure you have already built JANA2, halld_recon, and halld_sim following the instructions provided in Building JANA2 on ifarm9, Building & Using halld_recon with JANA2 on ifarm9, and Building & Using halld_sim with JANA2 on ifarm9, respectively.

Steps to Build hdgeant4 with JANA2

1. Create and Navigate to hdgeant4 Directory

mkdir hdgeant4
cd hdgeant4

2. Add hdgeant4_prereqs_version.xml

Create a file named `hdgeant4_prereqs_version.xml` and paste the following content into it. Make sure to update the home paths for jana, halld_recon, halld_sim, and hdgeant4 to the paths of the respective directories you built on ifarm9. Also ensure that the hdgeant4 path set in the home attribute of the hdgeant4 package points to the innermost repository that contains the actual hdgeant4 code and the bin directory, not just the external hdgeant4 repository. The path should likely resemble $DIR_CONTAINING_HDGEANT4/hdgeant4/hdgeant4.

<gversion version="1.0">
  <package name="amptools" version="0.15.2"/>
  <package name="ccdb" version="1.06.11"/>
  <package name="cernlib" version="2005"/>
  <package name="diracxx" version="2.1.2"/>
  <package name="evio" version="4.4.6"/>
  <package name="evtgen" version="01.07.00"/>
  <package name="geant4" version="10.04.p02"/>
  <package name="gluex_MCwrapper" version="v2.8.1"/>
  <package name="gluex_root_analysis" home="/w/epsci-sciwork18/rasool/gluex_root_analysis"/>
  <!-- Replace the path in the home attribute here with the full path to your halld_recon with JANA2 repository -->
  <package name="halld_recon" home="/w/epsci-sciwork18/rasool/halld_recon_jana2_latest"/>
  <!-- Replace the path in the home attribute here with the full path to your halld_sim with JANA2 repository -->
  <package name="halld_sim" home="/w/epsci-sciwork18/rasool/halld_sim"/>
  <package name="hddm" version="4.31.0"/>
  <package name="hdds" version="4.15.0"/>
  <!-- Replace the path in the home attribute here with the full path to your hdgeant4 with JANA2 repository -->
  <package name="hdgeant4" home="/w/epsci-sciwork18/rasool/halld_packages_build/hdgeant4/hdgeant4"/>
  <package name="hd_utilities" version="1.48"/>
  <package name="hepmc" version="2.06.10"/>
  <!-- Replace the path in the home attribute here with the full path to your JANA2 repository -->
  <package name="jana" home="/w/epsci-sciwork18/rasool/gluex_jana2_2023/JANA2"/>
  <package name="lapack" version="3.9.0"/>
  <package name="photos" version="3.61"/>
  <package name="rcdb" version="0.07.01"/>
  <package name="root" version="6.24.04"/>
  <package name="sqlitecpp" version="3.1.1"/>
  <package name="sqlite" version="3.36.0"/>
  <package name="xerces-c" version="3.2.3"/>
</gversion>

3. Build and Install hdgeant4

In your terminal, execute the following commands to set up the environment for building hdgeant4:

setenv BUILD_SCRIPTS /group/halld/Software/build_scripts
echo source $BUILD_SCRIPTS/gluex_env_jlab.csh $PWD/hdgeant4_prereqs_version.xml > setup_gluex.csh
source $BUILD_SCRIPTS/gluex_env_clean.csh
source $BUILD_SCRIPTS/gluex_env_jlab.csh $PWD/hdgeant4_prereqs_version.xml 
setenv HDGEANT4_BRANCH rasool_jana2

Setting the environment variable HDGEANT4_BRANCH specifies the branch of the JeffersonLab/HDGEANT4 to be used for the build. After setting up the environment, run the following command to build and install hdgeant4:

make -f $BUILD_SCRIPTS/Makefile_hdgeant4 -j32

4. Verify the Installation

Once hdgeant4 is built and installed, navigate to $DIR_CONTAINING_HDGEANT4/hdgeant4/setup_gluex.csh. Copy its absolute path and source it to set up the environment. Example:

source /w/epsci-sciwork18/rasool/halld_packages_build/hdgeant4/setup_gluex.csh

After setting up the environment, run the following command to confirm that hdgeant4 is correctly built and installed:

hdgeant4

If hdgeant4 is installed correctly, the command will provide the following output, confirming its installation:

[INFO] JArrowProcessingController: NUMA Configuration
  Affinity strategy: none
  Locality strategy: global

Error in GlueXUserOptions::ReadControl_in: unable to open file control.in

For any issues or further assistance with building, installing, or using hdgeant4 with JANA2 on ifarm9, contact Raiqa Rasool (rasool@jlab.org).