Last active
July 6, 2018 21:12
-
-
Save hartzell/d7d067e59695575c47e1c86b898b37fc to your computer and use it in GitHub Desktop.
A script to configure a spack tree and build some things.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# ask the spack executable the location of root of its tree | |
export SPACK_ROOT=$(spack location -r) | |
# having an app tree set up messes up the build. Clear the field. | |
if [[ $(type -t module) == "function" ]]; then | |
module purge | |
fi | |
cat << "EOYAML" > ${SPACK_ROOT}/etc/spack/config.yaml | |
# ------------------------------------------------------------------------- | |
# This is the project specific spack configuration file. | |
# ------------------------------------------------------------------------- | |
config: | |
# Temporary locations Spack can try to use for builds. | |
# | |
# A value of $spack/var/spack/stage indicates that Spack should run | |
# builds directly inside its install directory without staging them in | |
# temporary space. | |
# | |
# The build stage can be purged with `spack purge --stage`. | |
build_stage: | |
- $spack/var/spack/stage | |
EOYAML | |
cat << "EOYAML" > ${SPACK_ROOT}/etc/spack/packages.yaml | |
packages: | |
all: | |
compiler: [[email protected], [email protected], [email protected]] | |
emacs: | |
variants: +tls | |
EOYAML | |
cat << "EOYAML" > ${SPACK_ROOT}/etc/spack/modules.yaml | |
modules: | |
enable:: | |
- lmod | |
- tcl | |
tcl: | |
# hash_length: 0 | |
blacklist: | |
- '%[email protected]' | |
- '%[email protected]' | |
- '%[email protected]' | |
all: | |
suffixes: | |
'+jit': jit | |
'^[email protected]': 'py2.7' | |
'^[email protected]': 'py3.6' | |
naming_scheme: '${PACKAGE}/${VERSION}' | |
^python: | |
autoload: 'direct' | |
lmod: | |
core_compilers: | |
- '[email protected]' | |
- '[email protected]' | |
- '[email protected]' | |
# hash_length: 0 | |
whitelist: | |
- gcc | |
blacklist: | |
- '%[email protected]' | |
- '%[email protected]' | |
- '%[email protected]' | |
verbose_autoload: false | |
all: | |
template: 'modules/my-modulefile.lua' | |
autoload: 'direct' | |
suffixes: | |
'+jit': jit | |
'^[email protected]': 'py2.7' | |
'^[email protected]': 'py3.6' | |
filter: | |
environment_blacklist: ['CPATH', 'LIBRARY_PATH', 'LD_LIBRARY_PATH'] | |
# WE DO NOT SET PACKAGE ROOT, it upsets GCC | |
^python: | |
filter: | |
environment_whitelist: ['LD_LIBRARY_PATH'] | |
EOYAML | |
cat << "EOLUA" > ${SPACK_ROOT}/share/spack/templates/modules/my-modulefile.lua | |
{% extends "modules/modulefile.lua" %} | |
{% block autoloads %} | |
{% for module in autoload %} | |
-- depends_on() supports automagically unloading dependencies | |
depends_on("{{ module }}") | |
{% endfor %} | |
{% endblock %} | |
EOLUA | |
[email protected] | |
if ! spack location -i ${my_compiler} > /dev/null 2>&1; then | |
# Compiler | |
## HEADS UP: This is a bit fragile. Make sure that you don't have | |
## a ~/.spack/.../compilers.yaml file that defines a 5.4.0, | |
## otherwise you're likely to build "my_compiler" with that one | |
## and lmod won't generate a set of Core modules. Alt, we could | |
## grab the version from the system compiler and specify it here | |
## explicitly. More work than it's worth for now. | |
spack install ${my_compiler} | |
# This might not do what you want if there's already | |
# a 5.4.0 on the system.... | |
# Now all of the things will be built with %[email protected] | |
spack compiler add --scope site $(spack location -i ${my_compiler}) | |
fi | |
spack install aspell6-en; spack activate aspell6-en | |
spack install direnv | |
spack install emacs | |
spack install git | |
spack install htop | |
spack install httpie | |
spack install jq | |
spack install lmod | |
spack install perl | |
spack install the-silver-searcher | |
spack install tree | |
spack install tmux | |
spack install vim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment