LifeV on MacOS 1012 » History » Version 29

« Previous - Version 29/32 (diff) - Next » - Current version
Simone Deparis, 06/26/2017 09:41 AM


LifeV on MacOS 10.12 - Sierra

This is meant as a small how-to for installing LifeV on MacOSx 10.12.4. If you have 10.8 or 10.9 please visit LifeV on MacOSX 10.8 and LifeV on MacOSX 10.9.
First you have to make sure that C++ is natively installed. After installing xcode, run

 xcode-select --install


This is usually the case if you installed XCode. You can verify the installation with the following commands:
g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

gfortran

install gfortran with the MacOSX package dowloaded from
http://gcc.gnu.org/wiki/GFortranBinaries#MacOS
and verify that it is well installed:

gfortran --version
  GNU Fortran (GCC) 6.3.0
  Copyright (C) 2016 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Remark the package also installs other compilers:

ls /usr/local/gfortran/bin/
cpp*        gcc*        gcc-nm*     gcov*       gfortran*
g++*        gcc-ar*     gcc-ranlib* gcov-tool*

In my case, the PATH is set such that the system gcc is called.

openmpi

Download openmpi (version 2.1.1 in my case)

 tar -xzf openmpi-2.1.1.tar.bz2
 cd openmpi-2.1.1
 ./configure --prefix=/opt/openmpi
 make -j 4
 sudo make install
/opt/openmpi/bin/mpicc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

/opt/openmpi/bin/mpicc -show    
gcc -I/opt/openmpi/include -L/opt/openmpi/lib -lmpi

Other TPLs (Third party library)

Download boost
https://dl.bintray.com/boostorg/release/1.63.0/source/boost_1_63_0.tar.gz

Note 1.64.0 has a bug, cf https://svn.boost.org/trac/boost/ticket/12516

In the directory where you want to put the Boost compilation, execute

tar -xzf  boost_1_63_0.tar.gz

Set the LIB_BOOST_INSTALL variable to where you want to install boost, e.g.:

LIB_BOOST_INSTALL=$HOME/LIFEV/local/opt/boost-1.63/
cd boost_1_63_0

./bootstrap.sh --with-toolset=darwin

./b2 --prefix=${LIB_BOOST_INSTALL} toolset=darwin \
 --without-chrono --without-date_time --without-exception --without-filesystem \
 --without-iostreams --without-locale \
 --without-math --without-mpi --without-program_options --without-python --without-random \
 --without-regex --without-serialization --without-signals --without-system --without-test \
 --without-thread --without-timer --without-wave \
 --without-atomic --without-context --without-coroutine \
 --without-log   stage

./b2 --prefix=${LIB_BOOST_INSTALL} toolset=darwin \
 --without-chrono --without-date_time --without-exception --without-filesystem \
 --without-iostreams --without-locale \
 --without-math --without-mpi --without-program_options --without-python --without-random \
 --without-regex --without-serialization --without-signals --without-system --without-test \
 --without-thread --without-timer --without-wave  \
 --without-atomic --without-context --without-coroutine \
 --without-log  install

MUMPS

Download MUMPS at
http://mumps.enseeiht.fr/index.php?page=dwnld

You then have to wait a confirmation email with a link to the package...

UMFPACK and Parmetis

Download SuiteSparse at
http://faculty.cse.tamu.edu/davis/suitesparse.html

tar -xzf ~/Downloads/SuiteSparse-4.5.5.tar.gz

as well as Parmetis

wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz
tar -xzf parmetis-4.0.3.tar.gz

Then replace the Metis package in Parmetis by the one in SuiteSparse (other ways to do the same exists, but I prefer the go straight to the point...)

rm -r parmetis-4.0.3/metis/
cd ../SuiteSparse
ln -s $PWD/metis-5.1.0 parmetis-4.0.3/metis

However, on my mac, there is no need for 64 bit integers.
in metis-5.1.0/include/metis.h replace

#define IDXTYPEWIDTH 64

by
#define IDXTYPEWIDTH 32

SuiteSparse

cd SuiteSparse
make 
make install INSTALL=$HOME/LIFEV/local/opt/SuiteSparse

Parmetis 4.0.3

Read the license, the install.txt file, and run

cd parmetis-4.0.3/
make
make config shared=1 prefix=$HOME/LIFEV/local/opt/SuiteSparse cc=/opt/openmpi/bin/mpicc  cxx=/opt/openmpi/bin/mpicxx
make install

There is a problem with the installation of libparmetis.dylib. Indeed if you run

cd $HOME/LIFEV/local/opt/SuiteSparse/lib/
otool -D libparmetis.dylib 
  libparmetis.dylib:
  libparmetis.dylib

which mean that the library is not correctly installed and that your executables won’t work!
Thanks to http://thecourtsofchaos.com/2013/09/16/how-to-copy-and-relink-binaries-on-osx/ I have
a workaround:

install_name_tool -id $PWD/libparmetis.dylib libparmetis.dylib
otool -D libparmetis.dylib 
  libparmetis.dylib:
  /Users/simone/LIFEV/local/opt/SuiteSparse/lib/libparmetis.dylib

Note: Anything that depends on libparmetis.dylib needs to be relinked, libraries included...

HDF5

HDF5Download hdf5 at http://www.hdfgroup.org/ftp/HDF5/current/src/

Note: There is some incompatibility between hdf5-1.10.1 and Trilinos or LifeV.
Better use 1.8 :
HDF5Download hdf5 at http://www.hdfgroup.org/ftp/HDF5/current/src/
Unpack it:

  wget https://support.hdfgroup.org/ftp/HDF5/current18/src/hdf5-1.8.19.tar.bz2
  tar -xzf ~/Downloads/hdf5-1.8.19.tar.bz2 

Then configure, compile, and install:

cd hdf5-1.8.19
mkdir opt
cd opt
../configure --prefix=$HOME/LIFEV/local/opt/hdf5-1.8.19 --without-ssl --with-zlib --without-mpe \
 --without-pablo --with-szlib=/sw --without-gass --without-srb --without-pthread \
 --enable-parallel CC=/opt/openmpi/bin/mpicc
make -j3
make install

Trilinos

Download the latest version of trilinos from their website and install it. As example, you can find the file do-configure-trilinos-opt.sh below.

You may want to modify do-configure-trilinos-opt.sh: BASE_DIR must point to the directory where you have the source files and INSTALL_DIR where you put your libraries. Also check the other variables for the correct PATH.

Anyway, now with the attached file do-configure-trilinos-opt.sh I can configure and compile trilino

git clone https://github.com/trilinos/Trilinos.git
cd Trilinos
git checkout trilinos-release-12-8-1

emacs -nw do-configure-trilinos-opt.sh
chmod u+x do-configure-trilinos-opt.sh
./do-configure-trilinos-opt.sh
make -j4 install

LifeV

Download the latest version of lifev from git.
If you have an account on cmcsforge, you can also download trilinos from there:

 git clone git@cmcsforge.epfl.ch:lifev.git lifev

or use the public repository
git clone https://github.com/lifev/lifev.git

You may want to modify do-configure-lifev-opt.sh below: BASE_DIR must point to the directory where you have the source files and INSTALL_DIR where you put your libraries. Also check the other variables for the correct PATH.

 emacs do-configure-lifev-opt.sh
chmod u+x do-configure-lifev-opt.sh
./do-configure-lifev-opt.sh
make -j4 

do-configure-lifev-opt.sh Magnifier (1.91 KB) Simone Deparis, 06/26/2017 09:52 AM

do-configure-trilinos-opt.sh Magnifier (3.17 KB) Simone Deparis, 06/26/2017 09:52 AM