Building Offline with cmake: Difference between revisions
No edit summary |
No edit summary |
||
(8 intermediate revisions by one other user not shown) | |||
Line 6: | Line 6: | ||
===Using UPS=== | ===Using UPS=== | ||
The UPS-based build of Offline is supported in SL7 environments, in two distinct flavors: | The UPS-based build of Offline is supported in SL7 environments, in two distinct flavors: | ||
====Package-based build==== | ====Package-based build==== | ||
<font color=red>Deprecated: these instructions worked in January/February 2024 and only on SL7 machines. They may not work with never versions of Offline and the will not work on AL9 machines. There is still access to SL7 via containers, | |||
see [[Legacy Access to SL7]]. As of August 2024, only the [[#Using Spack]] instructions are supported. | |||
</font> | |||
The Offline CMake uses the ''cetmodules'' package for several CMake convenience functions, and can be built using the standard ''cetmodules'' invocation: | The Offline CMake uses the ''cetmodules'' package for several CMake convenience functions, and can be built using the standard ''cetmodules'' invocation: | ||
Line 16: | Line 20: | ||
git clone https://github.com/Mu2e/Offline.git | git clone https://github.com/Mu2e/Offline.git | ||
mkdir build_Offline && cd build_Offline | mkdir build_Offline && cd build_Offline | ||
source ../Offline/ups/setup_for_development -p e28:s126 # -d or -p are supported, see Offline/ups/product_deps for supported qualifier combinations | source ../Offline/ups/setup_for_development -p e28:s126:trig # -d or -p are supported, see Offline/ups/product_deps for supported qualifier combinations | ||
export CETPKG_J=$((`cat /proc/cpuinfo|grep processor|tail -1|awk '{print $3}'` + 1)) # Set build parallelism to number of CPUs on host | |||
buildtool # -p to create a UPS-redistributable package, -i to install in a UPS area (-I to specify which) | buildtool # -p to create a UPS-redistributable package, -i to install in a UPS area (-I to specify which) | ||
</pre> | </pre> | ||
====MRB-based build==== | ====MRB-based build==== | ||
<font color=red>Deprecated: these instructions worked in January/February 2024 and only on SL7 machines. They may not work with never versions of Offline and the will not work on AL9 machines. There is still access to SL7 via containers, | |||
see [[Legacy Access to SL7]]. As of August 2024, only the [[#Using Spack]] instructions are supported. | |||
</font> | |||
Offline is also compatible with MRB-based development: | Offline is also compatible with MRB-based development: | ||
Line 28: | Line 37: | ||
setup mrb | setup mrb | ||
mkdir my_mrb_working_area | mkdir my_mrb_working_area | ||
export CETPKG_J=$((`cat /proc/cpuinfo|grep processor|tail -1|awk '{print $3}'` + 1)) # Set build parallelism to number of CPUs on host | |||
export MRB_PROJECT=Mu2e | export MRB_PROJECT=Mu2e | ||
mrb newDev -v v1_00_00 -q e28:s126:prof # Version here is mostly meaningless, but required to silence certain CMake warnings | mrb newDev -v v1_00_00 -q e28:s126:trig:prof # Version here is mostly meaningless, but required to silence certain CMake warnings | ||
cd srcs | cd srcs | ||
mrb gitCheckout https://github.com/Mu2e/Offline.git | mrb gitCheckout https://github.com/Mu2e/Offline.git | ||
Line 39: | Line 49: | ||
===Using Spack=== | ===Using Spack=== | ||
An "Offline" Spack recipe has been created and added to https://github.com/Mu2e/mu2e-spack. To build and install Offline in a Spack area, use the following commands: | |||
<pre> | |||
git clone https://github.com/FNALssi/spack.git -b fnal-develop | |||
echo 'export SPACK_DISABLE_LOCAL_CONFIG=true | |||
source spack/share/spack/setup-env.sh' >setup-env.sh | |||
source setup-env.sh | |||
git clone https://github.com/fnalssi/fermi-spack-tools.git | |||
./fermi-spack-tools/bin/make_packages_yaml spack # Examine output, several system packages are required to be installed for the spack concretize/install steps to work properly | |||
mkdir repos && cd repos | |||
git clone https://github.com/FNALssi/fnal_art.git && spack repo add fnal_art | |||
git clone https://github.com/art-daq/artdaq-spack.git && spack repo add artdaq-spack | |||
git clone https://github.com/Mu2e/mu2e-spack.git && spack repo add mu2e-spack | |||
cd .. | |||
spack compiler find | |||
spack env create offline | |||
spack env activate offline | |||
spack add art-suite@s126 | |||
spack add Offline | |||
spack develop Offline@main | |||
spack concretize | |||
spack install | |||
</pre> | |||
To use this area in future sessions: | |||
<pre> | |||
source setup-env.sh | |||
spack env activate offline | |||
mu2e -c ... # Offline is now setup in your PATH | |||
</pre> | |||
==When to Update CMakeLists.txt== | ==When to Update CMakeLists.txt== |
Latest revision as of 21:01, 8 August 2024
Introduction
Use of CMake to build Offline in the DAQ environment.
Building Offline with CMake
Using UPS
The UPS-based build of Offline is supported in SL7 environments, in two distinct flavors:
Package-based build
Deprecated: these instructions worked in January/February 2024 and only on SL7 machines. They may not work with never versions of Offline and the will not work on AL9 machines. There is still access to SL7 via containers, see Legacy Access to SL7. As of August 2024, only the #Using Spack instructions are supported.
The Offline CMake uses the cetmodules package for several CMake convenience functions, and can be built using the standard cetmodules invocation:
source /cvmfs/mu2e.opensciencegrid.org/setupmu2e-art.sh git clone https://github.com/Mu2e/Offline.git mkdir build_Offline && cd build_Offline source ../Offline/ups/setup_for_development -p e28:s126:trig # -d or -p are supported, see Offline/ups/product_deps for supported qualifier combinations export CETPKG_J=$((`cat /proc/cpuinfo|grep processor|tail -1|awk '{print $3}'` + 1)) # Set build parallelism to number of CPUs on host buildtool # -p to create a UPS-redistributable package, -i to install in a UPS area (-I to specify which)
MRB-based build
Deprecated: these instructions worked in January/February 2024 and only on SL7 machines. They may not work with never versions of Offline and the will not work on AL9 machines. There is still access to SL7 via containers, see Legacy Access to SL7. As of August 2024, only the #Using Spack instructions are supported.
Offline is also compatible with MRB-based development:
source /cvmfs/mu2e.opensciencegrid.org/setupmu2e-art.sh setup mrb mkdir my_mrb_working_area export CETPKG_J=$((`cat /proc/cpuinfo|grep processor|tail -1|awk '{print $3}'` + 1)) # Set build parallelism to number of CPUs on host export MRB_PROJECT=Mu2e mrb newDev -v v1_00_00 -q e28:s126:trig:prof # Version here is mostly meaningless, but required to silence certain CMake warnings cd srcs mrb gitCheckout https://github.com/Mu2e/Offline.git mrb uc mrb z mrbsetenv mrb b
Using Spack
An "Offline" Spack recipe has been created and added to https://github.com/Mu2e/mu2e-spack. To build and install Offline in a Spack area, use the following commands:
git clone https://github.com/FNALssi/spack.git -b fnal-develop echo 'export SPACK_DISABLE_LOCAL_CONFIG=true source spack/share/spack/setup-env.sh' >setup-env.sh source setup-env.sh git clone https://github.com/fnalssi/fermi-spack-tools.git ./fermi-spack-tools/bin/make_packages_yaml spack # Examine output, several system packages are required to be installed for the spack concretize/install steps to work properly mkdir repos && cd repos git clone https://github.com/FNALssi/fnal_art.git && spack repo add fnal_art git clone https://github.com/art-daq/artdaq-spack.git && spack repo add artdaq-spack git clone https://github.com/Mu2e/mu2e-spack.git && spack repo add mu2e-spack cd .. spack compiler find spack env create offline spack env activate offline spack add art-suite@s126 spack add Offline spack develop Offline@main spack concretize spack install
To use this area in future sessions:
source setup-env.sh spack env activate offline mu2e -c ... # Offline is now setup in your PATH
When to Update CMakeLists.txt
In general, CMakeLists.txt in affected packages should be updated when:
- Files are added, removed, or renamed
- Library dependencies for a package change (e.g. a #include referring to another package is added or removed)
- Data files are added to a package and should be installed when Offline is built