This project contains bash scripts to setup a Spack-based software stack and find a suitable system compiler.
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.
$ ./install-spack.sh <stack_root>
where <stack_root>
is root directory of the desired software stack. For example:
$ ./install-spack.sh ../stack-2019.03
-
In our limited experience, many system compilers fail for various reasons to install complex software stacks.
-
On Linux systems, the approach that has been most consistent for us has been to build
gcc-7.3.0
andbinutils
using a suitable system compiler. Then, we use the installedSpack gcc-7.3.0
to build the remaining software stack. -
One can use a
system gcc-7.3.0
to build theSpack gcc-7.3.0
. In fact, we had to do this very thing in the past in order to reliably build some ornery software stacks on our systems. -
On MacOS systems, one can build
gcc-7.3.0
using aclang
compiler, butgcc
on a Mac does not play well withcmake
and other packages. So, on MacOS, we recommend to stick with onlyclang
compilers. -
Below is a typical work flow that selects
gcc-7.3.0
as its final system compiler.
$ cd <stack_root>
$ source 1-setup-spack.sh
$ echo $SPACK_ROOT # the output should be same as your current directory
$ ./scripts/compiler.sh add
$ ./scripts/compiler.sh avail
$ ./scripts/compiler.sh try [email protected]
$ module load gcc/4.9.3
$ ./scripts/compiler.sh add [email protected]
$ ./scripts/compiler.sh try [email protected]
$ module load gcc/7.3.0
$ ./scripts/compiler.sh add [email protected].
$ ./scripts/compiler.sh try [email protected].
$ ./scripts/compiler.sh use [email protected].
Be advised: A system compiler may succeed in installing the small package (libelf) related to try-compiler.sh, but may fail for various other reasons during the build of the more complex stack packages. If this happens, setup another system compiler, and try again.
version: 2019.02.19