Issues about installation of Elmer with MUMPS and Hypre

Discussion about building and installing Elmer
Post Reply
garlam
Posts: 2
Joined: 07 Jan 2016, 04:14
Antispam: Yes

Issues about installation of Elmer with MUMPS and Hypre

Post by garlam »

Hi,

Recently I have discovered Elmer and want to use it as my simulation tools. Now I want to install it on my computer (Linux Fedora 23) with parallelization. The steps of my installations are as below.
i. Install scalapack, blas, blacs, OCE and mpich using Fedora 'dnf'
ii. Install metis to /usr/local/metis
iii. Install MUMPS from source code to /usr/local/MUMPS (compiled with -fPIC and tested the installation)
iv. Install Hypre from source code to /usr/local/hypre-2.10.1 (compiled with -fPIC and tested the installation)
v. Install Elmer following the guidelines in the wiki http://www.elmerfem.org/elmerwiki/index ... sing_Cmake
The installation script is as follows

Code: Select all

#!/bin/bash

# Example build-script for Elmer on Fedora 23

CMAKE=cmake

# Installation directory (set these!)
TIMESTAMP=$(date +"%m-%d-%y")
ELMER_REV="Elmer_devel_${TIMESTAMP}"
ELMERSRC="/home/garret/elmer/elmerfem"
BUILDDIR="$ELMERSRC/build"
IDIR="/usr/local/$ELMER_REV"
TOOLCHAIN="$ELMERSRC/Elmer-linux-fedora23.cmake"

echo "Building Elmer from within " ${BUILDDIR}
echo "using following toolchain file " ${TOOLCHAIN}
echo "installation into " ${IDIR}
cd ${BUILDDIR}
pwd
ls -ltr

echo $CMAKE $ELMERSRC -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN

$CMAKE $ELMERSRC -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN \
    -DCMAKE_INSTALL_PREFIX=$IDIR \
    -DCMAKE_C_COMPILER=gcc \
    -DCMAKE_Fortran_COMPILER=mpif90 \
    -DWITH_MPI:BOOL=TRUE \
    -DWITH_Mumps:BOOL=TRUE \
    -DWITH_Hypre:BOOL=TRUE \
    -DWITH_MKL:BOOL=FALSE \
    -DWITH_TRILINOS:BOOL=FALSE \
    -DWITH_ELMERGUI:BOOL=TRUE \
    -DWITH_OCC:BOOL=TRUE \
    -DWITH_PARAVIEW:BOOL=FALSE \
    -DWITH_VTK:BOOL=TRUE \
    -DWITH_PYTHONQT:BOOL=FALSE \
    -DWITH_MATC:BOOL=TRUE                            

make -j4 && sudo make install

sudo rm /usr/local/Elmer-devel
sudo ln -s $IDIR /usr/local/Elmer-devel
'Elmer-linux-fedora23.cmake' used is as follows

Code: Select all

# CMake toolchain file for building on Fedora 23 64bit
#
# CSC - IT Center for Science Ltd.
# Version: 0.1

SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
SET(CMAKE_SYSTEM_VERSION 1)

# Specify the cross compilers (serial)
SET(CMAKE_C_COMPILER gcc)
SET(CMAKE_Fortran_COMPILER gfortran)
SET(CMAKE_CXX_COMPILER g++)

# Specify the cross compilers (parallel)
SET(MPI_C_COMPILER /usr/lib64/mpich/bin/mpicc)
SET(MPI_CXX_COMPILER /usr/lib64/mpich/bin/mpicxx)
SET(MPI_Fortran_COMPILER /usr/lib64/mpich/bin/mpif90)

# Compilation flags (i.e. with optimization)
SET(CMAKE_C_FLAGS "-O2" CACHE STRING "")
SET(CMAKE_CXX_FLAGS "-O2" CACHE STRING "")
SET(CMAKE_Fortran_FLAGS "-O2" CACHE STRING "")

# Path of MPI
SET(MPI_C_INCLUDE_PATH "/usr/include/mpich-x86_64")
SET(MPI_C_LIBRARIES "/usr/lib64/mpich/lib/libmpich.so")
SET(MPI_C_COMPILE_FLAGS "-O2")
SET(MPI_C_LINK_FLAGS "-O2")
SET(MPI_CXX_INCLUDE_PATH "/usr/include/mpich-x86_64")
SET(MPI_CXX_LIBRARIES "/usr/lib64/mpich/lib/libmpichcxx.so")
SET(MPI_Fortran_INCLUDE_PATH "/usr/include/mpich-x86_64")
SET(MPI_Fortran_LIBRARIES "/usr/lib64/mpich/lib/libmpichf90.so")
SET(MPI_Fortran_COMPILE_FLAGS "-O2")
SET(MPI_Fortran_LINK_FLAGS "-O2")

# Path of Blas and Lapack
SET(BLAS_DIR /usr/lib64)
SET(LAPACK_DIR /usr/lib64)

# Path of ScaLapack library
SET(SCALAPACK_LIBRARIES /usr/lib64/mpich/lib/libscalapack.a)

# Path of Mumps
SET(Mumps_INCLUDE_DIR /usr/local/MUMPS/include)
SET(Mumps_LIBRARIES /usr/local/MUMPS/lib/libdmumps.a)  
LIST(APPEND Mumps_LIBRARIES /usr/local/MUMPS/lib/libmumps_common.a)
LIST(APPEND Mumps_LIBRARIES /usr/local/MUMPS/lib/libpord.a)
LIST(APPEND Mumps_LIBRARIES /usr/lib64/mpich/lib/libscalapack.a)
LIST(APPEND Mumps_LIBRARIES /usr/local/metis/lib/libmetis.a)

# Path of Hypre
SET(Hypre_INCLUDE_DIR /usr/local/hypre/include)
SET(Hypre_LIBRARIES /usr/local/hypre/lib/libHYPRE.a)
I've uploaded the log of building ('build.log') for reference.

There are no errors found during installation. However, when I try to run my test case using MUMPS or Hypre with the command

Code: Select all

mpirun -np 4 ElmerSolve_mpi

it outputs the 'Not installed' errors
ELMER SOLVER (v 8.1) STARTED AT: 2016/01/07 17:09:39
ELMER SOLVER (v 8.1) STARTED AT: 2016/01/07 17:09:39
ELMER SOLVER (v 8.1) STARTED AT: 2016/01/07 17:09:39
ELMER SOLVER (v 8.1) STARTED AT: 2016/01/07 17:09:39
ParCommInit: Initialize #PEs: 4
MAIN:
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: ParCommInit: Initialize #PEs: 4
ParCommInit: Initialize #PEs: 4
ParCommInit: Initialize #PEs: 4
Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 8.1 (Rev: 549ce2a, Compiled: 2016-01-07)
MAIN: Running in parallel using 4 tasks.
MAIN: =============================================================
MAIN:
MAIN:
MAIN: -------------------------------------
MAIN: Reading Model: case.sif
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver_Init0]
LoadMesh: Base mesh name: ./.
ERROR:: CheckLinearSolverOptions: Hypre requested but not compiled with!

or
ELMER SOLVER (v 8.1) STARTED AT: 2016/01/07 17:11:48
ELMER SOLVER (v 8.1) STARTED AT: 2016/01/07 17:11:48
ELMER SOLVER (v 8.1) STARTED AT: 2016/01/07 17:11:48
ELMER SOLVER (v 8.1) STARTED AT: 2016/01/07 17:11:48
ParCommInit: Initialize #PEs: 4
ParCommInit: Initialize #PEs: 4
ParCommInit: Initialize #PEs: 4
ParCommInit: Initialize #PEs: 4
MAIN:
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 8.1 (Rev: 549ce2a, Compiled: 2016-01-07)
MAIN: Running in parallel using 4 tasks.
MAIN: =============================================================
MAIN:
MAIN:
MAIN: -------------------------------------
MAIN: Reading Model: case.sif
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver_Init0]
LoadMesh: Base mesh name: ./.
LoadMesh: Elapsed time (CPU,REAL): 0.0647 0.0707 (s)
ERROR:: CheckLinearSolverOptions: MUMPS solver has not been installed.
It seems that Elmer does not link the MUMPS and HYPRE during installation. How to solve this issue? I would appreciate help from the forum members. Thanks in advance!

Best,
garlam
Attachments
build.log
Log of Elmer installation
(180.38 KiB) Downloaded 358 times
garlam
Posts: 2
Joined: 07 Jan 2016, 04:14
Antispam: Yes

Re: Issues about installation of Elmer with MUMPS and Hypre

Post by garlam »

I've removed the whole system and start from clean again. I've succeeded the installation of Elmer with MUMPS and Hypre finally :D .

First, after the installation of Fedora and running the system update, I've compiled the MPICH from source code with option '--enable-shared' before the installations of LAPACK, BLACS etc. Then I installed Metis (option 'shared=1'), MUMPS (options '-fPIC') and Hypre (options '-fPIC'). At this time, the installation of Elmer automatically detects the MPICH installed, but I still need to specify the root of METIS, MUMPS and Hypre by setting METISROOT, MUMPSROOT and HYPREROOT, rather than specifying their libraries and include path through the variables in cmake such as Mumps_LIBRARIES like I did in the previous failed installations. I suspect that this is the problem why the Elmer cannot find MUMPS and Hypre after the previous installation.
Post Reply