The compatibility layer of the EESSI project uses Gentoo Prefix to provide a known base on top of the host. This is the foundation we use to build our software stack on. An alternative would be the NixOS.
The bootstrap process will need a clean environment with C and C++ compilers (the system version of gcc and g++ will do) as well as the make command. It also is very sensitive to
the environment, so setup a user with unset CFFLAGS, CFLAGS, LDFLAGS, PKG_CONFIG_PATH and the always harmful LD_LIBRARY_PATH variables.
EESSI provides a Singularity container for this.
The provided Singularity definition file can be used to build a container with a clean environment:
sudo singularity build bootstrap-prefix.sif singularity-bootstrap-prefix.def
Gentoo Prefix provides a bootstrap script to build the prefix, see Gentoo Prefix Bootstrap. We forked this version and made some modifications. See issue #8 for more details.
You can run our version of the bootstrap script (see bootstrap-prefix.sh) inside the Singularity container by executing:
singularity run bootstrap-prefix.sif
or simply:
./bootstrap-prefix.sif
If you want to run your own version of the bootstrap script, use:
singularity exec bootstrap-prefix.sif ./bootstrap-prefix.sh
After starting the bootstrap have a long coffee...
Additional packages are added in the EESSI overlay, which is based on ComputeCanada. To add the overlay:
Start the prefix
startprefix
Ensure the configuration directory exists, with ${EPREFIX} the path to your prefix installation.
export EPREFIX=path/to/your/prefix
mkdir ${EPREFIX}/etc/portage/repos.conf
Configure the overlay.
emerge eselect-repository
eselect repository add eessi git https://github.com/EESSI/gentoo-overlay.git
Sync the overlay
emerge --sync
The steps described above can be automatically executed by running the Ansible playbook install.yml inside the folder playbooks.
See the README in that folder for more details.
Updating packages can be as easy as
emerge --sync
emerge
If you run into problems, usually a newer ebuild is not suited to build in a prefix environment. Try to mask latest versions:
Create a mask file if not existing and mask newer versions from thin provisioning tools greater or equal to 0.7.6:
echo ">=sys-block/thin-provisioning-tools-0.7.6" >> ${EPREFIX}/etc/portage/package.mask
Updating Portage requires the kernel source which corresponds to your running kernel on the host. Emerge will detect it in /usr/src/linux.
Check your running kernel version with:
cat /proc/version
Linux version 4.20.0-1.el7.elrepo.x86_64 (mockbuild@Build64R7)
On a Centos 7 host kernel sources are installed in /usr/src/kernels. Link /usr/src/linux to the appropiate kernel source after installation. Example for an elrepo kernel:
rpm -ivh kernel-ml-devel-4.20.0-1.el7.elrepo.x86_64.rpm
cd /usr/src ; ln -s kernels/4.20.0-1.el7.elrepo.x86_64 linux
When ready update Portage from the Prefix environment:
startprefix
emerge --oneshot sys-apps/portage