Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Prayush Kumar / intro-num-rel

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Setup spec

Setup spec

Last edited by Prayush Kumar Apr 29, 2022
Page history

Setup SpEC on Debian based OS

Table of Contents

  1. Hardware requirements
  2. Building Dependencies
    1. Get Spack
    2. Build your compiler
    3. Install Spack Environment
  3. Building SpEC
    1. Load dependencies
    2. Fetch source code
    3. Configure and Compile Libraries

Hardware requirements

  • 30G of disk space
    • 6-8G for dependencies, 22-24G for SpEC libs!!
    • If you have multiple disk partitions on your machine, you can also use one to install dependencies, and another to build SpEC
  • ??G of RAM

Building dependencies of SpEC with Spack

Get Spack

We will use a package manager called SPACK. The first step is to fetch SPACK from github with:

git clone -c feature.manyFiles=true https://github.com/spack/spack.git
source spack/share/spack/setup-env.sh 

Build your compiler

Now build the compiler we want to use first:

spack install gcc@9.4.0
spack load gcc@9.4.0
spack compiler find

At this point the newly installed version of GCC should appear in your list of compilers:

spack compilers

Install Spack Environment

Next, save [this package configuration file] as spec.yaml:

# Distributed under the MIT License.
# See LICENSE.txt for details.

# SpEC development environment that can be installed with the Spack package
# manager, both on clusters and personal machines.
#
# To install this environment, first clone
# [Spack](https://github.com/spack/spack) and refer to the
# [docs](https://spack.readthedocs.io/) for an introduction to Spack. Then:
#
#   $ spack env create YOUR_ENV_NAME support/DevEnvironments/spack.yaml
#   $ spack env activate YOUR_ENV_NAME -p
#
# Now you can adjust the environment for your system. You may want to `spack
# remove` and `spack add` some packages, e.g., to customize the Charm++
# installation or to omit packages provided by your system or installed via
# another package manager. To generate the list of packages that will be
# installed, run:
#
#   $ spack concretize -f [--reuse]
#
# You may want to run `spack external find` and concretize with `--reuse` to
# avoid reinstalling a bunch of system-provided packages. When you are happy
# with the concretized environment, run:
#
#   $ spack install
#
# All dependencies will be installed in the Spack build tree and linked into th
e
# environment. Now you can run CMake, build SpEC, etc. To pass options like
# `CHARM_ROOT` to CMake, if necessary, you can find the location of installed
# packages with `spack location --install-dir`.
#
# Since the `spack` command is quite slow, you can also generate a module file
# that is much faster to source:
#
#   $ spack env loads -r
#
# Now you can activate the environment by sourcing the generated module file.
#
# See the [Spack docs on environments](https://spack.readthedocs.io/en/latest/e
nvironments.html)
# for more information.

spack:
  definitions:
  - compilers: [gcc@9.4.0]
    specs:
  - $compilers
  - cmake
  - doxygen
  - fftw
  - git
  - gsl
  - 'hdf5@:1.10'
  - openblas
  - openmpi
  - 'python@3.7:'
  - perl
  - petsc
  - py-h5py
  - py-matplotlib
  - py-nbconvert
  - py-numpy
  - py-pybind11
  - py-scipy
  concretization: together
  view: true

Using this file we will create a SPACK environment, as:

spack env create spec_gcc spec.yaml
spack env activate spec_gcc -p

Make sure that the newly installed version of GCC is still visible inside this environment, by running:

spack compilers

Now we will concretize the list & configuration of packages to be installed:

spack concretize -Uf

And finally install all the dependencies with

spack install -U

After following these steps with a fresh installation of spack, I find the following packages to have been installed:

$ spack find
==> In environment spec_gcc
==> Root specs
cmake    fftw       git  hdf5@:1.10  openmpi  petsc    py-nbconvert  py-pybind11
doxygen  gcc@9.4.0  gsl  openblas    perl     py-h5py  py-numpy      python@3.7:

==> 107 installed packages
-- linux-centos7-zen2 / gcc@9.4.0 -------------------------------
autoconf@2.69         libidn2@2.3.0        py-cffi@1.15.0                py-py@1.11.0
automake@1.16.5       libmd@1.0.4          py-cython@0.29.24             py-pybind11@2.9.1
berkeley-db@18.1.40   libpciaccess@0.16    py-defusedxml@0.7.1           py-pycparser@2.20
bison@3.8.2           libsigsegv@2.13      py-entrypoints@0.4            py-pygments@2.10.0
bzip2@1.0.8           libsodium@1.0.18     py-flit-core@3.6.0            py-pyparsing@3.0.6
cmake@3.22.3          libtool@2.4.6        py-gevent@1.5.0               py-pyrsistent@0.18.0
curl@7.81.0           libunistring@0.9.10  py-greenlet@1.1.2             py-python-dateutil@2.8.2
diffutils@3.8         libxml2@2.9.12       py-h5py@3.6.0                 py-pyzmq@22.3.0
doxygen@1.9.3         libzmq@4.3.4         py-ipython-genutils@0.2.0     py-setuptools@59.4.0
expat@2.4.6           m4@1.4.19            py-jinja2@3.0.3               py-setuptools-scm@6.3.2
fftw@3.3.10           metis@5.1.0          py-jsonschema@4.4.0           py-six@1.16.0
findutils@4.8.0       mpc@1.1.0            py-jupyter-client@7.1.2       py-testpath@0.6.0
flex@2.6.3            mpfr@3.1.6           py-jupyter-core@4.9.2         py-tomli@1.2.2
gcc@9.4.0             ncurses@6.2          py-jupyterlab-pygments@0.1.2  py-tornado@6.1
gdbm@1.19             ninja@1.10.2         py-markupsafe@2.0.1           py-traitlets@5.1.1
gettext@0.21          numactl@2.0.14       py-mistune@0.8.4              py-webencodings@0.5.1
git@2.35.1            openblas@0.3.20      py-mpi4py@3.1.2               py-wheel@0.37.0
gmp@6.2.1             openmpi@4.1.2        py-nbclient@0.5.5             python@3.9.10
gsl@2.7               openssh@8.9p1        py-nbconvert@6.4.2            readline@8.1
hdf5@1.10.5           openssl@1.1.1n       py-nbformat@5.1.3             sqlite@3.37.2
hwloc@2.7.0           parmetis@4.0.3       py-nest-asyncio@1.5.4         superlu-dist@7.2.0
hypre@2.24.0          pcre2@10.39          py-numpy@1.22.3               tar@1.34
libbsd@0.11.5         perl@5.34.0          py-packaging@21.3             util-linux-uuid@2.37.4
libedit@3.1-20210216  petsc@3.16.5         py-pandocfilters@1.5.0        util-macros@1.19.3
libevent@2.1.12       pkgconf@1.8.0        py-pip@21.3.1                 xz@5.2.5
libffi@3.4.2          py-attrs@21.4.0      py-pkgconfig@1.5.5            zlib@1.2.11
libiconv@1.16         py-bleach@4.1.0      py-poetry-core@1.0.7

Building SpEC from source

Load dependencies

We start with loading into the current environment all the dependencies we installed above. We will assume you have already spack in current environment.

load_spec_deps() {
spack env activate spec_gcc -p

spack load gcc@9.4.0
spack load cmake
spack load openmpi
spack load git
spack load gsl
spack load hdf5
spack load openblas
spack load fftw
spack load perl
spack load petsc
spack load python
spack load py-h5py
spack load py-nbconvert
spack load py-numpy
spack load py-matplotlib
spack load py-scipy
}


load_spec_deps

Fetch source code

git clone git@github.com:sxs-collaboration/spec.git

cd spec

Configure and Compile Libraries

./configure
make parallel
  Clone repository
  • Home
  • Setup spec
  • Setup spectre
  • Spectre demo
More Pages
×

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.