cc_staff
22
edits
m (added to Software Category) |
(Update script and installation instructions) |
||
Line 12: | Line 12: | ||
= Installation in a virtual environment = <!--T:2--> | = Installation in a virtual environment = <!--T:2--> | ||
These are instructions for installing FEniCS version 2.0. | These are instructions for installing FEniCS version 2017.2.0. | ||
You can run the script below by copying it to the cluster you are using and running '''bash fenics-install.sh'''. | |||
Note that the installation will warn you that the installation will create (or replace) an installation directory, and | |||
will give usage instructions when it has successfully completed the installation. The script can be modified to change | |||
the installation directory if needed. | |||
</translate> | </translate> | ||
{{File | {{File | ||
|name= | |name=fenics-install.sh | ||
|lang="sh" | |lang="sh" | ||
|contents= | |contents= | ||
#!/bin/bash | |||
set -e | |||
FENICS_INSTALL=${HOME}/fenics | |||
FENICS_VERSION=2017.2.0 | |||
PYBIND11_VERSION=2.2.3 | |||
MODULES="hdf5-mpi/1.8.18\ | |||
boost\ | |||
eigen\ | |||
python/3.5\ | |||
scipy-stack/2017b\ | |||
petsc/3.7.5\ | |||
fftw-mpi/3.3.6\ | |||
ipp/9.0.4\ | |||
gcc/5.4.0" | |||
module load $MODULES | |||
main () { | |||
warning_install | |||
make_fenics_directory | |||
download_py_packages $FENICS_VERSION | |||
make_py_packages | |||
make_pybind11 | |||
make_dolfin | |||
print_instructions | |||
} | |||
warning_install () { | |||
echo "---------------------------------------------------------------" | |||
echo "WARNING: THE FENICS/DOLFIN INSTALL WILL WIPE OUT THIS DIRECTORY" | |||
echo " $FENICS_INSTALL " | |||
echo | |||
echo "IF YOU DON'T WANT THIS TO HAPPEN, PRESS CTRL-C TO ABORT" | |||
echo "PRESS ANY KEY TO CONTINUE" | |||
echo "---------------------------------------------------------------" | |||
read -n 1 | |||
} | |||
print_instructions () { | |||
echo "---------------------------------------------------------------" | |||
echo "TO USE FENICS/DOLFIN, YOU NEED TO DO:" | |||
echo | |||
echo "module load $MODULES" | |||
echo "source $FENICS_INSTALL/bin/activate" | |||
echo "source $FENICS_INSTALL/share/dolfin/dolfin.conf" | |||
echo "---------------------------------------------------------------" | |||
} | |||
make_fenics_directory () { | |||
rm -rf $FENICS_INSTALL | |||
mkdir -p $FENICS_INSTALL && cd $FENICS_INSTALL | |||
} | |||
download_py_packages () { | |||
version=$1 | |||
cd $FENICS_INSTALL | |||
git clone --branch=$version https://bitbucket.org/fenics-project/fiat.git | |||
git clone --branch=$version https://bitbucket.org/fenics-project/instant.git | |||
git clone --branch=$version https://bitbucket.org/fenics-project/dijitso.git | |||
git clone --branch=$version https://bitbucket.org/fenics-project/ufl.git | |||
git clone --branch=$version https://bitbucket.org/fenics-project/ffc.git | |||
git clone --branch=$version https://bitbucket.org/fenics-project/dolfin.git | |||
git clone --branch=$version https://bitbucket.org/fenics-project/mshr.git | |||
git clone --branch=v$PYBIND11_VERSION \ | |||
https://github.com/pybind/pybind11.git | |||
chmod u+w ~/fenics/*/.git/objects/pack/* | |||
mkdir -p $FENICS_INSTALL/pybind11/build | |||
mkdir -p $FENICS_INSTALL/dolfin/build | |||
mkdir -p $FENICS_INSTALL/mshr/build | |||
} | |||
make_pybind11 () { | |||
cd $FENICS_INSTALL/pybind11/build | |||
source $FENICS_INSTALL/bin/activate | |||
cmake -DPYBIND11_TEST=off \ | |||
-DCMAKE_INSTALL_PREFIX=$HOME/fenics \ | |||
-DPYBIND11_CPP_STANDARD=-std=c++11 .. | |||
nice make -j8 install | |||
} | |||
make_py_packages () { | |||
cd $FENICS_INSTALL | |||
virtualenv --no-download $FENICS_INSTALL | |||
source $FENICS_INSTALL/bin/activate | |||
pip3 install ply | |||
pip3 install numpy | |||
cd $FENICS_INSTALL/fiat && pip3 install . | |||
cd $FENICS_INSTALL/instant && pip3 install . | |||
cd $FENICS_INSTALL/dijitso && pip3 install . | |||
cd $FENICS_INSTALL/ufl && pip3 install . | |||
cd $FENICS_INSTALL/ffc && pip3 install . | |||
} | |||
make_dolfin () { | |||
cd $FENICS_INSTALL/dolfin/build | |||
source $FENICS_INSTALL/bin/activate | |||
cmake .. -DDOLFIN_SKIP_BUILD_TESTS=true \ | |||
-DEIGEN3_INCLUDE_DIR=$EBROOTEIGEN/include \ | |||
-DCMAKE_INSTALL_PREFIX=$HOME/fenics \ | |||
-DCMAKE_SKIP_RPATH=ON \ | |||
-DRT_LIBRARY=$EBROOTNIXPKGS/lib64/librt.so \ | |||
-DHDF5_C_LIBRARY_dl=$EBROOTNIXPKGS/lib64/libdl.so \ | |||
-DHDF5_C_LIBRARY_m=$EBROOTNIXPKGS/lib64/libm.so \ | |||
-DHDF5_C_LIBRARY_pthread=$EBROOTNIXPKGS/lib64/libpthread.so \ | |||
-DHDF5_C_LIBRARY_z=$EBROOTNIXPKGS/lib/libz.so \ | |||
-DLIB_ifcore_pic=$EBROOTIFORT/lib/intel64/libifcore.so \ | |||
-DLIB_ipgo=$EBROOTIPP/lib/intel64/libipgo.a \ | |||
-DLIB_decimal=$EBROOTIPP/lib/intel64/libdecimal.a \ | |||
-DLIB_irc_s=$EBROOTIPP/lib/intel64/libirc_s.a | |||
nice make -j 8 install | |||
cd $FENICS_INSTALL/dolfin/python && pip3 install . | |||
} | |||
main | |||
}} | }} | ||