Compile your code against EESSI¶
eb-local dev loads EESSI, the modules you name, and a build environment whose compiler wrappers record where each library lives.
The program then runs with no modules loaded and without LD_LIBRARY_PATH.
These steps build a C program that uses FFTW and OpenMP for one node type, check it, and run it from a job script.
Run paths, and one build per CPU target says why each step is there.
Before you start¶
eb-local on
PATH, as Install eb-local describes, and EESSI 2026.06 under/cvmfs/software.eessi.io.devneeds no site file.The node type that will run the program, and a Slurm partition with that node type.
The modules your code links against, as
module availnames them once EESSI is loaded.
Build the program¶
Start an allocation on the node type that will run the program:
salloc -p cpu -n 4 -t 00:30:00EESSI chooses the binaries for the CPU it finds when it loads, so a program built here belongs to this node type.
Load EESSI, the modules your code links against, and the build environment:
eval "$(eb-local dev FFTW/3.3.10-GCC-15.2.0)"Name every module you link against on this line, not after it:
devchooses the build environment from the compilers those modules bring in. Add--strict(or setEB_LOCAL_ENV_STRICT=1) to verify that the EESSI init file exists before loading modules. The EESSI and EESSI-extend modules print lines of their own as they load.Compile into the directory that
devnames inEB_LOCAL_DEV_PREFIX:mkdir -p "$EB_LOCAL_DEV_PREFIX/bin" gcc -O2 -fopenmp prog.c -lfftw3 -o "$EB_LOCAL_DEV_PREFIX/bin/prog"
EB_LOCAL_DEV_PREFIXis<install prefix>/dev/<EESSI version>/<CPU target>, with the GPU target appended when EESSI found one, such as/home/alice/eessi/dev/2026.06/x86_64/intel/sapphirerapids. CMake takes-DCMAKE_INSTALL_PREFIX="$EB_LOCAL_DEV_PREFIX", and aconfigurescript--prefix="$EB_LOCAL_DEV_PREFIX".Check that the program finds its libraries without
LD_LIBRARY_PATH:eb-local check "$EB_LOCAL_DEV_PREFIX/bin/prog"/home/alice/eessi/dev/2026.06/x86_64/intel/sapphirerapids/bin/prog: x86_64 loader /cvmfs/software.eessi.io/versions/2026.06/compat/linux/x86_64/lib64/ld-linux-x86-64.so.2 RPATH /cvmfs/software.eessi.io/host_injections/2026.06/software/linux/x86_64/intel/sapphirerapids/rpath_overrides/OpenMPI/system-GCC/lib:... needs libfftw3.so.3 => /cvmfs/software.eessi.io/versions/2026.06/software/linux/x86_64/intel/sapphirerapids/software/FFTW.MPI/3.3.10-gompi-2026.1/lib/../lib64/libfftw3.so.3 [RPATH] needs libgomp.so.1 => /cvmfs/software.eessi.io/versions/2026.06/software/linux/x86_64/intel/sapphirerapids/software/GCCcore/15.2.0/lib64/../lib64/libgomp.so.1 [RPATH] needs libc.so.6 => /cvmfs/software.eessi.io/versions/2026.06/compat/linux/x86_64/lib/../lib64/libc.so.6 [RPATH] eb-local check: no problems
The
RPATHline, one directory for each library directory the link could use, is cut short here.To audit every ELF file in the dev tree, rather than the one program:
eb-local check --dev --quiet--quietprints a file only when it has a problem. A file that is not ELF is skipped. Add--recursiveto audit resolved transitive shared libraries as well.Repeat steps 1 to 4 on each other node type that will run the program. Each build goes into the directory for its own CPU target.
Run it from a job script¶
A job script loads EESSI first, so that EESSI_SOFTWARE_SUBDIR names the CPU target of the node it lands on, and runs the build for that target:
#!/bin/bash
#SBATCH -p cpu -n 1 -t 00:10:00
eval "$(eb-local env)"
"$HOME/eessi/dev/$EESSI_VERSION/$EESSI_SOFTWARE_SUBDIR/bin/prog"
The path is for the default install prefix, $HOME/eessi; eb-local config shows the prefix in force.
The program runs without the FFTW module, and without LD_LIBRARY_PATH.
Other kinds of code¶
tests/site/dev-tasks.sh in eb-local’s repository does each of these with EESSI 2026.06, and runs each program with no modules loaded:
Code |
The line before building |
|---|---|
C with FFTW and OpenMP |
|
Fortran with OpenMP |
|
MPI (C or Fortran) |
|
CMake against GSL |
|
A Python virtual environment, with packages that compile C |
|
A setuptools extension against GSL |
|
A meson-python extension against GSL |
|
A scikit-build-core extension against GSL |
|
R packages, into a library of your own |
|
Each of the three extension tasks builds a module that calls GSL, then reads the module with readelf.
The task passes when the module has a DT_RPATH entry naming the GSL directory and readelf shows no DT_RUNPATH entry.
The task then imports the module with env -i, with no modules loaded.
Build language packages¶
Use the dev path from the compiled-program example for the commands below.
Name every module that provides a library on the dev line. Before a native
build, confirm that command -v gcc or command -v g++ is under
rpath_wrappers.
Python¶
eval "$(eb-local dev Python/3.14.2-GCCcore-15.2.0 GSL/2.8-GCC-15.2.0)"
export PYTHONNOUSERSITE=1
prefix="$HOME/eessi-python/$EESSI_SOFTWARE_SUBDIR"
python3 -m venv "$prefix"
source "$prefix/bin/activate"
python3 -m pip install --no-user pip
python3 -m pip install --no-build-isolation PACKAGE
For uv, use the interpreter already on PATH and refuse a download:
export UV_PYTHON_PREFERENCE=only-system
export UV_PYTHON_DOWNLOADS=never
uv venv --python "$(command -v python3)" \
"$HOME/eessi-uv/$EESSI_SOFTWARE_SUBDIR"
R¶
eval "$(eb-local dev R/4.6.1-gfbf-2026.1 GSL/2.8-GCC-15.2.0)"
export R_LIBS_USER="$HOME/eessi-R/$EESSI_SOFTWARE_SUBDIR"
mkdir -p "$R_LIBS_USER" "$HOME/.R"
cat > "$HOME/.R/Makevars" << 'EOF'
CC = gcc
CXX = g++
FC = gfortran
EOF
R CMD INSTALL PACKAGE
The bare compiler names in Makevars ensure that R does not bypass the
build environment with a compiler path recorded in its own configuration.
Rust¶
eval "$(eb-local dev Rust/1.94.1-GCCcore-15.2.0 GSL/2.8-GCC-15.2.0)"
host=$(rustc -vV | sed -n 's/^host: //p')
linker_var=CARGO_TARGET_$(printf '%s' "$host" | tr 'a-z-' 'A-Z_')_LINKER
export "${linker_var}=$(command -v gcc)"
cargo build --release
Julia¶
Julia 1.12.2 is on the 2025.06 stack. Keep its depot per target while leaving the built-in depot visible:
eval "$(eb-local dev Julia/1.12.2 GSL/2.8-GCC-14.3.0)"
export JULIA_DEPOT_PATH="$HOME/eessi-julia/$EESSI_SOFTWARE_SUBDIR:"
julia -e 'println(DEPOT_PATH[1])'
Node.js¶
eval "$(eb-local dev nodejs/24.16.0-GCCcore-15.2.0 GSL/2.8-GCC-15.2.0)"
test -f "$EBROOTNODEJS/include/node/node_version.h"
export npm_package_config_node_gyp_nodedir="$EBROOTNODEJS"
npx node-gyp configure build --nodedir="$npm_package_config_node_gyp_nodedir"
--nodedir makes node-gyp use the headers belonging to the loaded Node.js.
If the header check fails, pass a matching header tree instead of allowing a
download.
For every native extension, package shared object, or executable, check the link result:
readelf -d FILE | grep -E 'RPATH|RUNPATH'
The output contains RPATH entries for the linked library directories.
Other compilers¶
The modules on the dev line choose the build environment:
Modules from |
Build environment |
|---|---|
GCC, the default |
|
CUDA |
|
|
|
|
|
NVHPC |
none |
EESSI 2026.06 ships buildenv/default-foss-2026.1 and has no default-lfoss or default-intel build environment yet.
When Lmod has no such module, dev looks for one at the compiler’s own toolchain level: buildenv/default-llvm-compilers-VERSION, buildenv/default-intel-compilers-VERSION or buildenv/default-NVHPC-VERSION, with the version of the compiler module that is loaded.
A site that builds buildenv-default-NVHPC-26.9.eb therefore gives its NVHPC users EasyBuild’s own wrappers with no setting anywhere.
When Lmod has neither, dev writes RPATH wrappers for the compilers and linkers on PATH into ~/.cache/eb-local, puts them first, and says so.
It does the same for each clang, clang++, flang, flang-new or ld.lld on PATH that no wrapper covers, whichever build environment loads:
eb-local: the build environment does not wrap clang clang++;
RPATH wrappers for it come first (/home/alice/.cache/eb-local/rpath-742e62ed18c960d2), so what it links has run paths.
A site that installs build environments of its own names them in dev.buildenv_for, and dev.buildenv or --buildenv MODULE loads one module whatever the compilers; The configuration files has both.
Check that it worked¶
Run the program as a job script runs it, with no modules and an empty environment:
env -i HOME="$HOME" PATH=/usr/bin:/bin "$EB_LOCAL_DEV_PREFIX/bin/prog"
28
eb-local check on the program exits 0 and ends in eb-local check: no problems.
If it fails¶
Message |
Cause |
What to do |
|---|---|---|
|
The program was linked without the build environment, as after |
Load the modules with |
|
The script runs with |
Put |
|
The program was built for another CPU target. |
Build it on that node type too, and run the build for |
|
A compiler and a linker that no wrapper covers linked the program with |
Link again after |