FEniCS: Difference between revisions

Jump to navigation Jump to search
2,110 bytes added ,  5 years ago
Update script and installation instructions
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=fenics_install.sh
   |name=fenics-install.sh
   |lang="sh"
   |lang="sh"
   |contents=
   |contents=
module load 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
#!/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


mkdir fenics && cd fenics
main () {
git clone https://bitbucket.org/fenics-project/fiat.git
    warning_install
git clone https://bitbucket.org/fenics-project/instant.git
    make_fenics_directory
git clone https://bitbucket.org/fenics-project/dijitso.git
    download_py_packages $FENICS_VERSION
git clone https://bitbucket.org/fenics-project/ufl.git
    make_py_packages
git clone https://bitbucket.org/fenics-project/ffc.git
    make_pybind11
wget https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-2017.2.0.tar.gz
    make_dolfin
tar xvfz dolfin-2017.2.0.tar.gz
    print_instructions
mv dolfin-2017.2.0 dolfin
}
chmod u+w ~/fenics/*/.git/objects/pack/*


pyvenv ~/fenics
warning_install () {
source ~/fenics/bin/activate
    echo "---------------------------------------------------------------"
cd fiat    && pip3 install . && cd -
    echo "WARNING: THE FENICS/DOLFIN INSTALL WILL WIPE OUT THIS DIRECTORY"
cd instant && pip3 install . && cd -
    echo "    $FENICS_INSTALL "
cd dijitso && pip3 install . && cd -
    echo
cd ufl     && pip3 install . && cd -
    echo "IF YOU DON'T WANT THIS TO HAPPEN, PRESS CTRL-C TO ABORT"
cd ffc     && pip3 install . && cd -
    echo "PRESS ANY KEY TO CONTINUE"
pip3 install ply
     echo "---------------------------------------------------------------"
cd dolfin
     read -n 1
mkdir build && cd build
}


cmake .. -DDOLFIN_SKIP_BUILD_TESTS=true -DEIGEN3_INCLUDE_DIR=$EBROOTEIGEN/include  -DCMAKE_INSTALL_PREFIX=$HOME/software/dolfin -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
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 "---------------------------------------------------------------"
}


nice make -j 8 install && cd -
make_fenics_directory () {
sed -i s'^export LD_LIBRARY_PATH=/lib^#export LD_LIBRARY_PATH=/lib^' ~/software/dolfin/share/dolfin/dolfin.conf
    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/*


<translate>
    mkdir -p $FENICS_INSTALL/pybind11/build
<!--T:7-->
    mkdir -p $FENICS_INSTALL/dolfin/build
To run the installed program, perform the following operations to set up your environment:
    mkdir -p $FENICS_INSTALL/mshr/build
</translate>
}
 
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


{{File
  |name=fenics_run.sh
  |lang="sh"
  |contents=
module load hdf5-mpi/1.8.18 boost eigen python/3.5 scipy-stack/2017b petsc/3.7.5 fftw-mpi/3.3.6
source ~/software/dolfin/share/dolfin/dolfin.conf
source ~/fenics/bin/activate
}}
}}


cc_staff
22

edits

Navigation menu