Browse Source

Fixed bugs and updated sh installation files

master
reidmen 4 months ago
parent
commit
2d8f95eb1c
  1. 2
      LICENSE
  2. 41
      README.md
  3. 18
      intel/build_all.sh
  4. 2
      intel/build_cmake.sh
  5. 16
      intel/build_dolfin.sh
  6. 18
      intel/build_fenics_pymodules.sh
  7. 28
      intel/build_petsc.sh
  8. 22
      intel/build_pybind11.sh
  9. 14
      intel/build_python_modules.sh
  10. 19
      intel/build_slepc.sh
  11. 12
      intel/setup_fenics_env.sh

2
LICENSE

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 David Nolte
Copyright (c) 2022 Reidmen Arostica
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

41
README.md

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# fenics-peregrine-build #
# FEniCS-Peregrine HPC #
### Scripts for building FEniCS on the Peregrine cluster at RUG ###
_forked from [fenics-gaia-cluster](https://bitbucket.org/unilucompmech/fenics-gaia-cluster)_
@ -9,10 +9,14 @@ This collection of scripts will automatically build current releases of @@ -9,10 +9,14 @@ This collection of scripts will automatically build current releases of
### python 3 ###
Python 3 with [virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs) is required.
This build uses `python 3.6.4` from the Lmod modules. All FEniCS related python modules will be installed within an virtual environment.
In particular, if you want to install different builds of FEniCS (different versions, packages (e.g., OpenMPI vs. MPICH, Intel MKL vs. OpenBLAS), or for different processor micro-architectures, see below), this will be helpful.
Here, [pew](https://github.com/berdario/pew) is used to manage the virtualenvs. To install `pew` follow these steps:
This build uses `python 3.6.4` from the Lmod modules.
All FEniCS related python modules will be installed within an virtual environment.
In particular, if you want to install different builds of FEniCS (different versions,
packages (e.g., OpenMPI vs. MPICH, Intel MKL vs. OpenBLAS), or for different processor
micro-architectures, see below), this will be helpful.
Here, [pew](https://github.com/berdario/pew) is used to manage the virtualenvs.
To install `pew` follow these steps:
```shell
$ module load Python/3.6.4-intel-2018a
$ pip3 install pew --user
@ -24,18 +28,22 @@ First clone this repository, for example to the location `$HOME/dev`. @@ -24,18 +28,22 @@ First clone this repository, for example to the location `$HOME/dev`.
```shell
$ mkdir -p $HOME/dev && cd $HOME/dev
$ git clone git@bitbucket.org:dajuno/fenics-peregrine-build.git
$ git clone https://git.web.rug.nl/P301191/FEniCS-Peregrine.git
```
### SETUP ###
The folder `intel` contains the build scripts using the intel toolchain (compilers, impi, intel MKL). The folder `foss` contains build scripts using the foss toolchain (gcc, openblas, openmpi). Select the folder according to which toolchain you want to use.
The main file is `build_all.sh`. Modify it to set the FEniCS version to be used. The `$TAG` variable (can be changed) specifies the directories FEniCS and its dependencies are installed to and the name of the virtual environment.
The folder `intel` contains the build scripts using the intel toolchain (compilers, impi, intel MKL).
The folder `foss` contains build scripts using the foss toolchain (gcc, openblas, openmpi).
Select the folder according to which toolchain you want to use.
The main file is `build_all.sh`. Modify it to set the FEniCS version to be used. The `$TAG` variable
(can be changed) specifies the directories FEniCS and its dependencies are installed to and the name of the virtual environment.
It is recommended to set `continue_on_key=true` for the first build in order to check that each dependency was installed correctly!
The script calls a number of `build_xxx.sh` scripts which download and install the corresponding applications. Edit these files to change the version, compile flags, etc.
The calls can be commented if it was already built, e.g., if a number of programs was built correctly until an error occurred in, say, `build_dolfin.sh`, because of a network timeout.
Note that if you want to rebuild everything the `$PREFIX` and the `$BUILD_DIR` dirs should be deleted, also the python virtual environment with `pew rm $TAG`.
Note that if you want to rebuild everything the `$PREFIX` and the `$BUILD_DIR` dirs should be deleted,
also the python virtual environment with `pew rm $TAG`.
Make sure the environments are correctly set in `env_build.sh` and `setup_env_fenics.env`. Also revise the individual build files.
@ -46,21 +54,28 @@ In order to build FEniCS run @@ -46,21 +54,28 @@ In order to build FEniCS run
```shell
$ ./build_all.sh |& tee -a build.log
```
on the compute node inside the `fenics-peregrine-build` directory.
on the compute node inside the `FEniCS-Peregrine/intel` directory.
**Remark** There is an outdated folder with foss compilers. Currently is it not supported and expected to be deprecated in the future.
Wait for the build to finish. The output of
the build will be stored in `build.log` as well as printed on the screen.
## Running FEniCS ##
To activate a FEniCS build you need to source the environment file created by the build script and activate the virtualenv. The corresponding lines are printed after building is completed.
To activate a FEniCS build you need to source the environment file created by the build script and activate the virtualenv.
The corresponding lines are printed after building is completed.
```shell
$ source <prefix>/bin/env_fenics_run.sh
$ pew workon fenics-<tag>
```
Now you can run python/ipython. `python -c "import dolfin"` should work. Try running `python poisson.py` and `mpirun -n 4 python poisson.py`.
Now you can run python/ipython. `python -c "import dolfin"` should work.
Try running `python poisson.py` and `mpirun -n 4 python poisson.py`.
**Remark** If installed successfully, the fenics environment created will be named *fenics-2019.1.0.post0-intel2018a*.
## Submit jobs to Peregrine (RUG) ##
To submit jobs to Peregrine, you need to provide a minimal configuration using sbatch, activate FEniCS environment and export the MPI library, e.g.
To submit jobs to Peregrine, you need to provide a minimal configuration using sbatch,
activate FEniCS environment and export the MPI library, e.g.
```bash
#!/bin/bash
#SBATCH --job-name=name_of_job

18
intel/build_all.sh

@ -32,15 +32,15 @@ export continue_on_key=true @@ -32,15 +32,15 @@ export continue_on_key=true
echo "Installing FEniCS to ${PREFIX}"
./build_cmake.sh
./setup_virtualenv.sh # if not, make sure virtualenv fenics-${tag} exists!!
#./build_petsc.sh
# ./build_slepc.sh
./setup_virtualenv.sh
./build_petsc.sh
./build_slepc.sh
# # ./build_eigen.sh # replace this by system modules?
#./build_python_modules.sh
#./build_fenics_pymodules.sh # ffc fiat ufl uflacs instant
#./build_pybind11.sh
#./build_dolfin.sh
#./build_mshr.sh
#./setup_fenics_env.sh
./build_python_modules.sh
./build_fenics_pymodules.sh # ffc fiat ufl uflacs instant
./build_pybind11.sh
./build_dolfin.sh
#./build_mshr.sh # taken out, need to be updated
./setup_fenics_env.sh
# run with $ ./build_all.sh |& tee -a build.log

2
intel/build_cmake.sh

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
#!/bin/bash
#source env_build.sh
source env_build.sh
## COMMENT THIS SECTION WHEN ./build_all.sh works without errors ##
#set -e

16
intel/build_dolfin.sh

@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
#!/bin/bash
## COMMENT THIS SECTION IF ./build_all.sh works ##
set -e
# set -e
#source env_build.sh
export FENICS_VERSION="2019.1.0.post0"
export TAG="${FENICS_VERSION}-intel2018a"
# export FENICS_VERSION="2019.1.0.post0"
# export TAG="${FENICS_VERSION}-intel2018a"
export BUILD_THREADS=1
export PREFIX=${HOME}/dev/fenics-${TAG}
export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
# export BUILD_THREADS=1
# export PREFIX=${HOME}/dev/fenics-${TAG}
# export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
export PYTHON_VERSION="3.6"
# export PYTHON_VERSION="3.6"
## --------------------------------------------- ##
@ -25,7 +25,7 @@ export BLA_VENDOR="Intel10_64lp" @@ -25,7 +25,7 @@ export BLA_VENDOR="Intel10_64lp"
export PYBIND11_DIR=$PREFIX
cd $BUILD_DIR && \
##git clone https://bitbucket.org/fenics-project/dolfin.git && \
git clone https://bitbucket.org/fenics-project/dolfin.git && \
cd dolfin && \
git checkout ${FENICS_VERSION} && \
mkdir -p build && \

18
intel/build_fenics_pymodules.sh

@ -1,25 +1,25 @@ @@ -1,25 +1,25 @@
#!/bin/bash
#source env_build.sh
source env_build.sh
### COMMENT THIS SECTION WHENEVER ./build all |& tee -a build.log works ###
# it requires the directory ${PREFIX}
# exit on error
set -e
# set -e
# FEniCS version
export FENICS_VERSION="2019.1.0.post0"
export PKG_VERSION="2019.1.0"
# export FENICS_VERSION="2019.1.0.post0"
# export PKG_VERSION="2019.1.0"
# TAG that specificies the name of the build directories and the virtualenv
export TAG="${FENICS_VERSION}-intel2018a"
# export TAG="${FENICS_VERSION}-intel2018a"
export PREFIX=${HOME}/dev/fenics-${TAG}
export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
# export PREFIX=${HOME}/dev/fenics-${TAG}
# export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
export PYTHON_VERSION="3.6"
# export PYTHON_VERSION="3.6"
### ---------------------------------------------------------------------- ###
# mkdir -p $BUILD_DIR/tar
mkdir -p $BUILD_DIR/tar
if [[ $FENICS_VERSION == 2019.1.0.post0 ]]; then
PYPI_FENICS_VERSION=">=2019.1.0"

28
intel/build_petsc.sh

@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
#!/bin/bash
#source env_build.sh
source env_build.sh
## COMMENT THIS SECTION WHEN ./build_all.sh works without errors ##
# TODO: build PETSc with --download-hypre to get hypre preconditioners
export FENICS_VERSION="2019.1.0.post0"
export TAG="${FENICS_VERSION}-intel2018a"
# export FENICS_VERSION="2019.1.0.post0"
# export TAG="${FENICS_VERSION}-intel2018a"
export BUILD_THREADS=1
export PREFIX=${HOME}/dev/fenics-${TAG}
export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
# export BUILD_THREADS=1
# export PREFIX=${HOME}/dev/fenics-${TAG}
# export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
mkdir - p ${PREFIX}
# mkdir - p ${PREFIX}
# #--------------------------------------------------------------##
@ -24,6 +24,7 @@ echo "Downloading and building PETSc ${VERSION}" @@ -24,6 +24,7 @@ echo "Downloading and building PETSc ${VERSION}"
mkdir -p $BUILD_DIR/tar
# TODO currently onption --download-hypre not available, petsc needs to be updated!
cd ${BUILD_DIR} && \
wget --quiet --read-timeout=10 -nc -P tar/ http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VERSION}.tar.gz && \
tar -xzf tar/petsc-lite-${VERSION}.tar.gz && \
@ -39,14 +40,13 @@ cd ${BUILD_DIR} && \ @@ -39,14 +40,13 @@ cd ${BUILD_DIR} && \
--with-shared-libraries \
--with-debugging=0 \
--with-blaslapack-dir=${MKLROOT} \
--download-hypre \
--download-mumps \
--download-scalapack \
--download-parmetis \
--download-metis \
--download-ptscotch \
--download-blacs \
--download-suitesparse \
--download-scalapack \
--download-parmetis \
--download-metis \
--download-ptscotch \
--download-blacs \
--download-suitesparse \
--prefix=${PREFIX} && \
make MAKE_NP=${BUILD_THREADS} && make install

22
intel/build_pybind11.sh

@ -1,22 +1,22 @@ @@ -1,22 +1,22 @@
#!/bin/bash
#source env_build.sh
source env_build.sh
## COMMENT THIS SECTION WHEN ./build_all.sh works without errors ##
export FENICS_VERSION="2019.1.0.post0"
export TAG="${FENICS_VERSION}-intel2018a"
# export FENICS_VERSION="2019.1.0.post0"
# export TAG="${FENICS_VERSION}-intel2018a"
export BUILD_THREADS=4
export PREFIX=${HOME}/dev/fenics-${TAG}
export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
# export BUILD_THREADS=4
# export PREFIX=${HOME}/dev/fenics-${TAG}
# export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
export PYTHON_VERSION="3.6"
# export PYTHON_VERSION="3.6"
#mkdir -p ${PREFIX}
## ------------------------------------------------------------- ##
#mkdir -p $BUILD_DIR/tar
mkdir -p $BUILD_DIR/tar
PYBIND11_VERSION="2.2.4"
@ -24,9 +24,9 @@ echo "Downloading and building pybind11 $PYBIND11_VERSION" @@ -24,9 +24,9 @@ echo "Downloading and building pybind11 $PYBIND11_VERSION"
cd ${BUILD_DIR} && \
#wget --read-timeout=10 -nc \
# https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz -O \
# tar/pybind11.tar.gz && \
wget --read-timeout=10 -nc \
https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz -O \
tar/pybind11.tar.gz && \
mkdir -p ${BUILD_DIR}/pybind11 && \
tar -xf tar/pybind11.tar.gz -C ${BUILD_DIR}/pybind11 --strip-components=1 && \
cd pybind11 && \

14
intel/build_python_modules.sh

@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
#!/bin/bash
#source env_build.sh
source env_build.sh
## COMMENT THIS SECTION WHEN build_all.sh works without errors ##
set -e
export FENICS_VERSION="2019.1.0.post0"
export TAG="${FENICS_VERSION}-intel2018a"
export PREFIX=${HOME}/dev/fenics-${TAG}
export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
# set -e
# export FENICS_VERSION="2019.1.0.post0"
# export TAG="${FENICS_VERSION}-intel2018a"
# export PREFIX=${HOME}/dev/fenics-${TAG}
# export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
export PYTHON_VERSION="3.6"
# export PYTHON_VERSION="3.6"
## ----------------------------------------------------------- ##

19
intel/build_slepc.sh

@ -1,27 +1,26 @@ @@ -1,27 +1,26 @@
#!/bin/bash
#source env_build.sh
source env_build.sh
## COMMENT THIS SECTION WHEN ./build_all.sh works without errors ##
set -e
export FENICS_VERSION="2019.1.0.post0"
export TAG="${FENICS_VERSION}-intel2018a"
# set -e
# export FENICS_VERSION="2019.1.0.post0"
# export TAG="${FENICS_VERSION}-intel2018a"
export BUILD_THREADS=1
export PREFIX=${HOME}/dev/fenics-${TAG}
export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
# export BUILD_THREADS=1
# export PREFIX=${HOME}/dev/fenics-${TAG}
# export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
export PYTHON_VERSION="3.6"
# export PYTHON_VERSION="3.6"
## ------------------------------------------------------------- ##
SLEPC_VERSION="3.11.2"
# http://slepc.upv.es/download/distrib/slepc-3.11.2.tar.gz
echo "Downloading and building SLEPc ${SLEPC_VERSION}"
#mkdir -p $BUILD_DIR/tar
mkdir -p $BUILD_DIR/tar
cd ${BUILD_DIR} && \
wget --quiet --read-timeout=10 -nc http://slepc.upv.es/download/distrib/slepc-${SLEPC_VERSION}.tar.gz -O tar/slepc-${SLEPC_VERSION}.tar.gz && \

12
intel/setup_fenics_env.sh

@ -3,15 +3,15 @@ source env_build.sh @@ -3,15 +3,15 @@ source env_build.sh
## COMMENT THIS SECTION WHEN ./build_all.sh WORKS WITHOUT ERRORS ##
export FENICS_VERSION="2019.1.0.post0"
export TAG="${FENICS_VERSION}-intel2018a"
# export FENICS_VERSION="2019.1.0.post0"
# export TAG="${FENICS_VERSION}-intel2018a"
export BUILD_THREADS=1
# export BUILD_THREADS=1
export PREFIX=${HOME}/dev/fenics-${TAG}
export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
# export PREFIX=${HOME}/dev/fenics-${TAG}
# export BUILD_DIR=${HOME}/dev/build/fenics-${TAG}
export PYTHON_VERSION="3.6"
# export PYTHON_VERSION="3.6"
## ------------------------------------------------------------- ##

Loading…
Cancel
Save