Installing the Mechanic environment might be a straightforward task, especially on an
outdated cluster, without administrative access. Mechanic depends on recent versions of
computing software, thus, you may find installation notes below to be helpful. We assume
here, the installation will be performed locally, in a user directory. Since for many scientific
applications Fortran support is required, we enable here full Fortran2003+ support (the
iso_c_binding
must be provided by the compiler).
mkdir ~/mechanic-env
mkdir ~/mechanic-env/src
cd ~/mechanic-env/src
export PATH=~/mechanic-env/bin:$PATH
export LD_LIBRARY_PATH=~/mechanic-env/lib:$LD_LIBRARY_PATH
Mechanic should compile on any recent compiler (usually GCC4.6+ family will be used, which is critical for proper Fortran support), however, some steps are neccessary for successfull compilation.
It is critical to build the environment with the same compiler family
export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran
export CC=icc
export CXX=icpc
export FC=ifort
export F77=ifort
Download CMake from http://www.cmake.org/cmake/resources/software.html
cd cmake
./bootstrap --prefix=~/mechanic-env
gmake
make install
Download the HDF5 library from http://www.hdfgroup.org/ftp/HDF5/current/src/
cd hdf5
./configure --enable-fortran --prefix=~/mechanic-env
make
make install
Download the OpenMPI library from http://www.open-mpi.org/software/ompi/v1.8/
cd openmpi
./configure --prefix=~/mechanic-env
make
make install
Download the Mechanic from http://github.com/mslonina/Mechanic
cd mechanic
mkdir build && cd build
CC=mpicc FC=mpif90 cmake .. -DCMAKE_INSTALL_PREFIX:PATH=~/mechanic-env
If cmake fails with CMAKE_ROOT not found, try:
CC=mpicc FC=mpif90 ~/mechanic-env/bin/cmake .. -DCMAKE_INSTALL_PREFIX:PATH=~/mechanic-env