Building JANA2 on ifarm9

From epsciwiki
Jump to navigation Jump to search

Warning: This JANA2 build will not produce the same results as JANA1 due to a bug in JANA1 version 0.8.2, which will be resolved in the upcoming 0.9.2 version. To ensure JANA2 generates results consistent with the current JANA1, clone from `rasool_jana2_mimicking_jana1` branch instead of `rasool_jana2` tag of the `master` branch in the step 2 of building JANA2, "Clone the JANA2 repository". Use the following git clone command: git clone --branch rasool_jana2_mimicking_jana1 https://github.com/JeffersonLab/JANA2.git .

This page provides instructions on how to build JANA2 on ifarm9. You can find the JANA2 repository here.

Steps to Build JANA2

1. Create and Navigate to JANA2 Directory

 mkdir JANA2
 cd JANA2

2. Clone the JANA2 Repository

Clone the JANA2 repository from the rasool_jana2 tag on the master branch of JeffersonLab/JANA2:

git clone -b rasool_jana2 https://github.com/JeffersonLab/JANA2.git  .

3. Create the setenv.csh File

Create a file named setenv.csh and paste the following code into it:

#!/bin/tcsh

setenv CC `which gcc`
setenv CXX `which g++`

setenv PROJECT_ROOT /work/epsci/rasool/gluex_jana2_2023 # Replace this path with the path of the directory containing the JANA2 directory
setenv BUILD_SCRIPTS /group/halld/Software/build_scripts

setenv JANA_HOME $PROJECT_ROOT/JANA2
setenv JANA_PLUGIN_PATH $PROJECT_ROOT/JANA2/plugins

source $BUILD_SCRIPTS/gluex_env_boot_jlab.csh
gxenv $PROJECT_ROOT/JANA2/version.xml

Note: Ensure that the `PROJECT_ROOT` variable is set to the path of the directory containing the JANA2 directory, not the path directly to the JANA2 directory itself.

4. Create the version.xml File

Create a file named `version.xml` and paste the following content into it:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://halldweb.jlab.org/halld_versions/version7.xsl"?>
<gversions file="version_5.12.0.xml" date="2023-10-13">
<description>Update to amptools, gluex_root_analysis, halld_recont, halld_sim, hdgeant4, hd_utilities</description>
<package name="amptools" version="0.15.1"/>
<package name="ccdb" version="1.06.11"/>
<package name="cernlib" version="2005" word_length="64-bit"/>
<package name="diracxx" version="2.0.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.7.0"/>
<package name="gluex_root_analysis" version="1.25.0"/>
<package name="halld_recon" version="4.42.0"/>
<package name="halld_sim" version="4.46.0"/>
<package name="hdds" version="4.15.0"/>
<package name="hdgeant4" version="2.36.0"/>
<package name="hd_utilities" version="1.46"/>
<package name="hepmc" version="2.06.10"/>
<!-- Replace the path in home attribute here with the full path to your JANA2 repository -->
<package name="jana" version="2.1.2" home="/w/epsci-sciwork18/rasool/gluex_jana2_2023/testing_building_ins/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" year="2021"/>
<package name="xerces-c" version="3.2.3"/>
</gversions>

Note: Replace the path in the `home` attribute of the `jana` package with the full path to your JANA2 repository.


5. Build and Install JANA2

Run following commands to build and install JANA2:

source setenv.csh
mkdir build
cd build
cmake3 ${JANA_HOME} -DUSE_XERCES=1
make -j8 install


6. Verify the Installation

To confirm that JANA2 is correctly built and installed, run the following command in your terminal:

jana

If JANA2 is installed correctly, the command will output the following information, confirming its installation and providing instructions on using the command-line interface to execute JANA plugins:

Usage:
    jana [options] source1 source2 ...

Description:
    Command-line interface for executing JANA plugins. This command is used
    to ingest events and process them. Command-line flags manage configuration
    parameters, while additional arguments specify input files to be loaded and
    processed by the corresponding EventSource plugin.

Options:
   -h, --help                   Display this help message
   -v, --version                Display version information
   -c, --configs                Display configuration parameters
   -l, --loadconfigs <file>     Load configuration parameters from a file
   -d, --dumpconfigs <file>     Dump configuration parameters to a file
   -b, --benchmark              Run in benchmark mode
   -Pkey=value                  Specify a configuration parameter

Example:
    jana -Pplugins=plugin1,plugin2,plugin3 -Pnthreads=8 inputfile1.txt

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