Building Offline with cmake: Difference between revisions

From Mu2eWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:
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>
Line 29: Line 30:
mkdir my_mrb_working_area
mkdir my_mrb_working_area
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

Revision as of 19:55, 22 January 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

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

Offline is also compatible with MRB-based development:

source /cvmfs/mu2e.opensciencegrid.org/setupmu2e-art.sh
setup mrb
mkdir my_mrb_working_area
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

When to Update CMakeLists.txt

In general, CMakeLists.txt in affected packages should be updated when:

  1. Files are added, removed, or renamed
  2. Library dependencies for a package change (e.g. a #include referring to another package is added or removed)
  3. Data files are added to a package and should be installed when Offline is built