Binary packages
Open-lmake binary packages are available on launchpad.net for the following systems :
- ubuntu22.04 (jammy)
- ubuntu24.04 (noble)
To install these, execute:
sudo add-apt-repository ppa:cdouady/open-lmakesudo apt updatesudo apt install open-lmake
Compilation
Requirements
To compile open-lmake, you will need:
- c++20 (gcc version 11+ or clang version 14+)
- python3.6+ (including 3.13+ free threading) with developer support (i.e. access to the
libpython*.sofile) - if using python2, it must be python2.7
The following versions are known not to work with open-lmake:
- gcc version 10 and below
- python 3.5 and below
It has been tested with the dockers listed in the docker dir.
Procedure
- if not under a git repository, you must first generate the file Manifest before constructing any artifact
find . -mindepth 1 -type d -o -print | sed 's:^\./::' | sort -u > Manifest
- type
make- note that no -j is necessary, the number of parallel jobs is automatically set to the available cpus
- this builds all necessary files and some unit tests
- on systems requiring AppArmor tuning (see AppArmor below), some of these unit tests fail until it is done
- you must invoke
git clean -fdxif you modified the Makefile or otherwise if you want a reliable build (makeis not open-lmake) - you may have to invoke
git clean -fdx lmake_env*or evengit clean -fdxafter agit pulllmake_envis a dir which builds lmake under lmake, for test purpose, no guarantee that the resulting package is functional for nowlmake_env-cacheis a dir containing cached results from jobs inlmake_env- they are not cleaned on purpose before running as this creates variability for testing lmake, but may fail
- and generally speaking, make is not robust to past history, so a full 'git clean -fdx' may be necessary to get a reliable build
- you can type
make LMAKEto just build all necessary files - you can type
make lmake.tar.gz.SUMMARY(built by default) to make a tar ball of the compiled files that you can easily deploy - if
Eis present in$LMAKE_FLAGS(experimental), thenmakeissues asudoto generate the suid root ebpf daemon, which may ask for a password
- install
- untar
lmake.tar.gzwherever you want and have your$PATHpoint to thebindir.- the
binsub-dir contains the executables meant to be executed by the user - the
_binsub-dir contains the executables necessary for open-lmake to run, but not meant to be directly invoked by the user- it also contains some executables to help debugging open-lmake itself.
- the
libsub-dir contains binary and python files for use by the user - the
_libsub-dir contains the binary and python files necessary for open-lmake to run, but not meant for direct use by the user - the relative positions of these 4 directories must remain the same, i.e. they must stay in the same dir with the same names.
- the
- untar
- specialization
- you can specialize the build process to better suit your needs:
- this can be done by setting variables
- for example, you can run:
CXX=/my/g++ make $PYTHON2can be set to your preferred python2 (defaults topython2as found in your$PATH). You will be told if it is not supported.$PYTHONcan be set to your preferred python3 (defaults topython3as found in your$PATH). You will be told if it is not supported.$CXXcan be set to your preferred C++ compiler (defaults tog++as found in your$PATH). You will be told if it is not supported.$SLURM_ROOTcan be set to the root dir of the slurm installation (by default,slurm/slurm.hwill be searched in the standard include path). For example,slurm.hwill be found as$SLURM_ROOT/include/slurm/slurm.h$LMAKE_FLAGScan be defined as O[0123]g?d?t?S[AB]P?- O[0123] controls the
-O option(default: 1 if profiling else 3 ) - g controls the absence of
-g option(default: debug ) - d controls
-DNDEBUG(default: asserts are enabled ) - T controls
-DTRACE=1(default: traces are disabled ) - U controls
-DTRACE=2(for use when fast mmap based tracing is not supported by underlying filesystem) - Sa controls the
-fsanitize=address -fsanitize=undefinedoptions (exclusive with St ) - St controls the
-fsanitize=threadoption (exclusive with Sa ) - P controls the
-pgoption (profiling info is in gmon.out.. ) - C controls the
--coverageoption (profiling info is in gmon.out.. ) - E controls whether to install ebpf (experimental)
- O[0123] controls the
- the
-jflag of make is automatically set to the number of processors, you may want to override this, though
- for example, you can run:
- this is true the first time you run make. After that, these values are remembered in the file
sys_config.env. - you can freely modify this file
sys_config.env, though. It will be taken into account. - it is up to you to provide a suitable
$LD_LIBRARY_PATHvalue. it will be transferred as a default value for rules, to the extent it is necessary to provide the lmake semantic
Installation
Open-lmake does not require to be installed. You can run it directly from the build dir. This is the simplest way unless you seek a system-wide installation.
If running under Ubuntu and you have the necessary packages installed (that you can find by inspecting Makefile, the entry DEBIAN_DEPS),
you can make a Debian package:
- type
make DEBIAN_BINmake DEBIANalso builds the source packages uploaded to launchpad.net, which requires a gpg key to sign them
- the package is created in the top-level dir as
open-lmake_<version>-<release>_<arch>.deb- its exact name is shown near the end of the build output, on the line starting with
dpkg-deb: building package
- its exact name is shown near the end of the build output, on the line starting with
- you can install it with
sudo apt install ./open-lmake_<version>-<release>_<arch>.deb
Alternatively, you can untar lmake.tar.gz at any place.
Installing system-wide with Debian package will take care of placing both binaries and man pages in the standard directories. Alternatively, you can:
- put
/path/to/open-lmake/binin your$PATH
This will simplify the user experience but is not required.
EBPF (experimental)
The installation of the ebpf daemon is somewhat delicate as it is required to be suid-root in the top-level namespace. Also, it is rather sensitive to kernel variations.
The major consequences are:
- at compilation time, a password may be asked to make
_bin/lmake_ebpfdsuid-root - open-lmake must be installed on a local disk
- alternatively,
lmake_ebpfdmay be copied to a local disk and a symbolic link may replace the original file in<install_dir>/_bin/lmake_ebpfdto point to it
- alternatively,
- at run-time, jobs must be launched on physical hosts or vm's, but not in a contenerized environment such as a docker image
- at run-time, whenever the daemon is started, it runs an auto-test to ensure the hooks in the ebpf filter are correctly attached inside the kernel
In order to accept to make lmake_ebpfd suid-root, the user doing the installation may want to audit it.
To that purpose, the daemon has been written so as to be as simple as possible to audit.
The points to verify are:
- the daemon (
src/autodep/ebpf_daemon.cc) does nothing else than installing the ebpf filter (src/autodep/ebpf.bpf.c) and connect incoming jobs to it - the ebpf filter observes nothing on jobs that are not connected to it from the daemon
- it does intercept all syscalls, but the very first instruction is to exit when not from a tracked process
- the ebpf filter may send a
SIGSTOPsignal to controlled processes, you may want to verify that it cannot stop any non-tracked process - note that beyond sending signals, ebpf filters have basically no possbility to otherwise modify the system behavior
The ebpf daemon starts and ends automatically on demand. Because the start-up time is about a few seconds, it is only stoopped after a few minutes of inactivity. The purpose is to ensure that there is no performance alteration at all when the host is busy at tasks totally unrelated to open-lmake.
Alternatively, it is possible to start the daemon from systemctl. It must then be executed as lmake_ebpfd daemon.
AppArmor
AppArmor tuning is currently only known to be required on Ubuntu starting at 24.04.
If open-lmake is installed with the Debian package, there is nothing to do.
What follows is necessary when running open-lmake from the build dir or from an untarred lmake.tar.gz.
Namespaces
In order to implement namespace related features (the lmake_view, repo_view, tmp_view, views and chroot rule attributes), and if your system is configured with AppArmor,
+sufficient permissions must be granted (the Debian package installs and activates such a profile).
In that case, do the following :
- create a file
/etc/apparmor.d/open-lmakewith the following content :abi <abi/4.0> include <tunables/global> profile open-lmake /**/{_bin/job_exec,bin/lautodep} flags=(unconfined) { userns, } /**/matches open-lmake wherever it is placed, but also any executable with the same name placed anywhere. You may replace it with the actual dir (e.g./path/to/open-lmake/) to restrict this permission to your installation.- activate it with
sudo apparmor_parser -r /etc/apparmor.d/open-lmake
Confined commands
Some commands are confined by an AppArmor profile provided by the system (look for profile <name> <path> in the files of /etc/apparmor.d).
On Ubuntu 26.04, this is the case of hostname, locale, lsblk or systemd-detect-virt, among others.
These profiles allow loading libraries from /usr/lib, where the Debian package installs open-lmake, but generally not from other dirs.
Hence, if open-lmake is placed elsewhere, such commands cannot load the autodep library when executed in a job.
The accesses they make are not tracked and a message such as the following is written on stderr, which makes the job fail (unless stderr_ok is set) :
ERROR: ld.so: object '/path/to/open-lmake/_d$LIB/ld_preload.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
In that case, do the following for each such command (here, hostname) :
- add the line
/path/to/open-lmake/_dlib/** mr,to the file/etc/apparmor.d/local/hostname
Rationale
Because of its unique features (auto-dep, views, ...), open-lmake is necessarily tighly coupled to the underlying OS. In particular, it was not possible to write it solely on top of Posix.
There are no known road blocks to port it to other OSes (such as Darwin or Windows) although this requires an in depth knowledge of these systems.