Skip to content

SPIDER: installation

Note

The standard way of installing this version of SPIDER is within the PROTEUS Framework, as described in the PROTEUS installation guide.

Quick installation

Here we provide a short installation guide to get you up and running with SPIDER.

Quadruple precision

To install SPIDER manually with quadruple precision, follow this guide.

The recommended workflow is:

  1. Set up a Conda environment
  2. Clone SPIDER
  3. Run the installer from inside the SPIDER checkout
  4. The installer will automatically install PETSc first if it is missing
  5. Then it will build SPIDER against that PETSc installation

Are you in PROTEUS?

When SPIDER is located at PROTEUS/SPIDER, PETSc is installed automatically into PROTEUS/petsc. When SPIDER is cloned standalone, PETSc is installed automatically into SPIDER/petsc.

0. Prerequisites

You need:

  • a working C compiler;
  • make;
  • git;
  • MPI compiler wrappers available via mpicc, or permission for PETSc to download MPICH automatically.
  • About 20 minutes of your time.

A basic test to check you have a working compiler is:

echo '#include<stdio.h>' > t.c && echo 'int main(){printf("It seems to work!\n");}' >> t.c && gcc t.c && ./a.out && rm -f t.c a.out

To ensure you have everything installed, run:

sudo apt install build-essential git libopenmpi-dev
sudo dnf install gcc git openmpi openmpi-devel lapack lapack-devel lapack-static f2c f2c-libs
brew install gcc open-mpi
xcode-select --install

HPC clusters

On HPC clusters you usually do not have sudo access. In that case:

  1. Load any compiler / MPI modules provided by your cluster, for example:
module avail
module load gcc
module load openmpi

1. Create a Conda environment [optional]

Python version

PETSc requires Python <= 3.12. If you do not make use of Conda, make sure your active environment uses a compatible version.

If you use Conda, it is recommended to build and run SPIDER inside a dedicated environment. This keeps the Python dependencies for SPIDER and its pytest-based test suite separate from your base environment.

Create and activate a Python 3.12 environment:

conda create -n spider python=3.12
conda activate spider

2. Clone SPIDER

cd /somewhere/to/install
git clone https://github.com/FormingWorlds/SPIDER.git
cd SPIDER

3. Run the installer

./tools/get_spider.sh

If the installation succeeds, the SPIDER executable will be available at:

./spider

The PETSc environment used for the build will be reported by the installer, for example:

PETSC_DIR=/somewhere/to/install/petsc
PETSC_ARCH=arch-xxx-yyy

PETSc environment

./tools/get_spider.sh sets PETSC_DIR and PETSC_ARCH automatically for installation. You only need to export them yourself if you want to rebuild or test SPIDER manually in a new shell session, like this:

export PETSC_DIR=/somewhere/to/install/petsc
export PETSC_ARCH=arch-xxx-yyy

Troubleshooting

PETSc configure: "Downloaded sundials2 could not be used"

PETSc configure on macOS stops with:

Downloaded sundials2 could not be used. Please check install in .../arch-darwin-c-opt

and configure.log reports _CVDense and _CVSpgmr as undefined symbols.

A SUNDIALS 7 from Homebrew is in the linker search path ahead of the SUNDIALS 2.5 that PETSc downloads, and SUNDIALS 7 has no CVDense. get_petsc.sh passes no Homebrew library path, so on Apple Silicon, where Homebrew lives in /opt/homebrew, PETSc builds with a Homebrew SUNDIALS installed. On an Intel Mac, Homebrew installs into /usr/local/lib, which the linker searches by default, so a Homebrew SUNDIALS can still hide the downloaded one there. brew list --versions sundials shows whether Homebrew's SUNDIALS is installed.