-
Notifications
You must be signed in to change notification settings - Fork 58
How to build Proteus using Spack
These are the steps required to build Proteus using the Spack build tool. Spack has many similarities to HashDist.
Spack works only on Linux and MacOS platforms. Windows is not supported.
Before installing Spack, make sure your system supports Environment Modules package. It can be easily installed.
Ensure your system has the minimum Spack prerequisites. Follow the instructions in the Spack documentation, specifically the installation page.
Use Spack's shell support:
# For bash/zsh users
$ export SPACK_ROOT=/path/to/spack
$ . $SPACK_ROOT/share/spack/setup-env.sh
# For tcsh or csh users (note you must set SPACK_ROOT)
$ setenv SPACK_ROOT /path/to/spack
$ source $SPACK_ROOT/share/spack/setup-env.csh
Confirm that which spack finds the Spack Python script executable.
Note that the filesystem that contains your Spack repo must be flock enabled, otherwise Spack will throw file-lock errors and be usable on your system. After Spack installation, test if the command spack find throws a flock error. Before any package installations, a successful spack find will return the message: ==> 0 installed packages.
After executing certain Spack commands, Spack will eventually create and populate a $HOME/.spack directory in which Spack behavior can be modified by editing existing files there or adding new ones.
Each Spack installation holds one software repo. Multiple Spack installations are required if, for whatever reasons, you wish to have multiple separate software stacks. Yet, a single Spack installation can accommodate many compiler and software option variants. See the Variants subsection in the Spack basic usage page.
Follow the compiler configuration section to find and add system compilers for use in the Spack build process.
If you are not happy with the available system compilers, you can easily build your own. I would suggest building new compilers with a separate Spack installation or repository, e.g. named spack-system or spack-compilers. By doing this, you can then access these disk-space-hog compilers for other purposes besides building Proteus.
Old system compilers usually have old system binutils, which Spack does not like. So, it may be prudent to Spack install recent versions of binutils and curl into your spack-system repo. For example, if the command spack -d fetch libelf hangs or fails, then your system curl is too old for Spack usage. Another example is: if spack install libelf is giving link errors, then your binutils is probably too old and needs to be updated.
Here is an example of building a custom compiler. My HPC development node had several compiler options, but I found that only gcc-4.4.7 was able to install Spack packages successfully. For instance, spack install libelf %[email protected] worked when other system compilers failed for various reasons. However, Proteus needs a later version of gcc. With the gcc-4.4.7 install success, I now had an option to install a base spack-system of my preference, namely, a gcc-7.3.0 environment. Below are the commands I used to install gcc-7.3.0 into my spack-system repo along with compatible up-to-date system utilities.
# install spack
git clone https://github.com/spack/spack.git spack-system
cd spack-system
export SPACK_ROOT=/<path...>/spack-system
source $SPACK_ROOT/share/spack/setup-env.sh
which spack
# install compilers
spack compiler find
spack compilers
# Experiment with different system compilers to install libelf.
spack install libelf %[email protected] # this worked
# if you are happy with a system compiler, skip the remaining steps
# install a custom compiler
spack install [email protected] %[email protected]
spack load [email protected]
spack compiler find
# install system utilities
# my system /usr/local/ld was not linking properly, so update binutils
spack install binutils %[email protected]
spack load binutils # this is the Spack version of the 'module load' command
# my system curl was not fetching some archives properly, so update curl
spack install curl %[email protected]
spack load curl
spack find # lists all packages successfully installed in this repo
Appending %[email protected] (or your preferred compiler) to each spack install command is a pain. Spack allows one to set a default compiler. To do this, create the file $HOME/.spack/packages.yaml with the following contents:
packages:
all:
compiler: [[email protected]]
At this point, you should be ready to start installing Proteus via Spack.
The host node should have secure shell access (ssh, scp, etc). Spack and Proteus will need to be installed using tarballs and Spack Mirrors.
Here is an example of repeating steps 1 and 2 on a machine without internet access.
Details coming soon.
Details coming soon.
Details coming soon.