-
Notifications
You must be signed in to change notification settings - Fork 58
How to build Proteus using Spack
Warning: This is a work in progress. This set of build scripts seem to work well on Linux systems. Testing on MacOS is in final stages of refinement.
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.
The 5 steps involve only a total of 10 commands, 6 of which are standard Unix commands.
The beauty of this approach is that only one Proteus stack is needed to support any number of independent Proteus builds (all on one computer system, of course). Also, if one has different variants of Proteus stacks, any Proteus installation can build against any Proteus stack at any time. Like the HashDist approach, there should be consistency in Proteus builds on any system.
Direct any questions to: greg dot burgreen at msstate dot edu
$ wget <url>/spack-setup.tar
where <url> = ftp://ftp.hpc.msstate.edu/outgoing/burgreen/spack-proteus/0.2/
$ tar xfv spack-setup.tar
- This will inflate to:
rw-r----- user/group 3020 2018-07-28 13:14 spack-setup-0-README.txt
rwxr-x--- user/group 810 2018-07-28 13:14 spack-setup-1-names-proteus.sh
rwxr-x--- user/group 1177 2018-07-28 13:15 spack-setup-2-transfer-archives.sh
rwxr-x--- user/group 2153 2018-07-28 13:15 spack-setup-3-install-spack.sh
- Optionally, modify
spack-setup-1-names-proteus.shto reflect which specific archives you want to transfer. - Optionally, modify
spack-setup-2-transfer-archives.shto reflect how to transfer them. Inside this script, there are options that can be easily edited tocporscpfiles too.
$ ./spack-setup-2-transfer-archives.sh wget
- This will transfer 7 archive files from the
<url>defined in Step 1:
-rw-r----- 1 user group 317440 Jul 20 14:43 packages-builtin-gcc-7.3.0.tar
-rw-r----- 1 user group 1095680 Jul 23 13:59 packages-builtin-proteus-stack.tar
-rw-r----- 1 user group 171550720 Jul 20 12:26 sources-thirdparty-gcc-7.3.0.tar
-rw-r----- 1 user group 153600 Jul 27 15:14 sources-thirdparty-libelf.tar
-rw-r----- 1 user group 364257280 Jul 23 16:13 sources-thirdparty-proteus-stack.tar
-rw-r----- 1 user group 6685201 Jul 17 20:24 spack-develop-2018.07.10.zip
-rw-r----- 1 user group 61440 Jul 27 23:45 spack-scripts.tar
$ ./spack-setup-3-install-spack.sh <stack_dir>
where <stack_dir> is the directory where the Proteus stack software will reside.
$ cd <stack_dir>
- Setup the compiler that is known to successfully install Spack packages. Instructions on how to do this are found in Appendix A.
- A typical work flow for
gcc-4.9.3will look like:
$ module load gcc/4.9.3
- It is important to confirm that the compiler you wanted is actually loaded.
$ gcc --version
For Linux systems:
- Install both a custom version of gcc-7.3.0 and the packages needed to build Proteus.
$ ./scripts/install-gcc-proteus-stack.sh [email protected]
For MacOS systems:
- Use the native clang compiler to install only the packages needed to build Proteus.
$ ./scripts/install-proteus-stack.sh [email protected]
$ cd <proteus_dir>
- where
<proteus_dir>is the root direction of Proteus software - This directory can be located anywhere.
- There can be multiple of these directories.
$ <stack_dir>/scripts/build-proteus.sh
- This will build Proteus and install the following files and directories into
<proteus_dir>:
rwxr-x--- 1 user group 100 Jul 28 11:55 0-README.txt
rwxr-x--- 1 user group 3590 Jul 28 11:55 1-setup-proteus.sh*
rw-r----- 1 user group 605 Jul 28 11:54 2-makefile
rwxr-x--- 1 user group 365 Jul 28 11:56 make.sh*
drwxr-x--- 2 user group 4096 Jul 28 11:56 bin/
drwxr-x--- 4 user group 4096 Jul 28 11:55 python/
To rebuild this version of Proteus:
$ source <proteus_dir>/1-setup-proteus.sh # needed only once per session
- Revise the source code.
$ ./make.sh
To rebuild this version of Proteus against a different Proteus stack:
$ source <proteus_dir>/1-setup-proteus.sh # needed only once per session
$ ./make.sh clean
$ <different_stack_dir>/scripts/build-proteus.sh
To execute this version of Proteus:
$ source <proteus_dir>/1-setup-proteus.sh # needed only once per session
$ cd <case_dir>
$ which parun # just for confirmation
$ parun ...
To share the Proteus stack or Proteus builds, simply change directory access privileges.
$ chmod 777 <stack_dir> <proteus_dir>
-
In our limited experience, many system compilers fail for various reasons to install the full Proteus stack.
-
On Linux systems. the approach that has been most consistent for us has been to build
gcc-7.3.0andbinutilsusing a suitable system compiler. Then, we use the installedSpack gcc-7.3.0to build the Proteus stack and any Proteus source installations. The current scripts follow this approach too. We will revise the scripts soon to allow a system compiler to build the full stack as well as allow the build process to use optimized system libraries (e.g., blas, mpi). -
One can use a
system gcc-7.3.0to build theSpack gcc-7.3.0. In fact, we had to do this very thing in order to build the full Proteus stack on one of our systems. -
On MacOS systems, one can build
gcc-7.3.0using aclangcompiler, but gcc on a Mac does not play well with cmake and other packages.
Be advised: a system compiler succeed on installing this small package, but may fail for various other reasons during the build of the list of more complex Proteus stack packages. If this happens, setup another system compiler, and try again.
- Below is a typical work flow.
$ cd <stack_dir>
$ ./scripts/add-compiler.sh
$ ./scripts/try-compiler.sh
$ ./scripts/try-compiler.sh [email protected]
$ module load gcc/4.9.3
$ ./scripts/add-compiler.sh
$ ./scripts/try-compiler.sh [email protected]
$ module load gcc/7.3.0
$ ./scripts/add-compiler.sh
$ ./scripts/try-compiler.sh [email protected]