eXlibriseXtended finite element Librairies (Version June 2016)

 

External librairies

ANN library:

Some librairies need ANN library to run. If you do nothing particular, it will be installed automatically in a directory eXternalLib. You just have to turn to ON the option USE_ANN by adding:

option(USE_ANN "use library ANN" ON)

in the CMakeLists.txt that you have created, or by turning to ON the following option.

option(USE_XCRACK "Use Xcrack" OFF)
ndiff:

If you have not done it yet, download the eXternalLib repository. Go back to the eXlibris directory and type:

svn checkout https://svn.ec-nantes.fr/eXlibris/eXternalLib eXternalLib

Go to the directory eXlibris/eXternal/ndiff-2.00 and type

./configure
make

that's all.

the executable ndiff (or a symbolic link) can also be place in /usr/local/bin, but it is not mandatory.

Solver SuperLu:

Now you have to install SuperLu solver. Change directory.

cd eXternalLib/SuperLu_3.0

type:

find /usr/lib/libblas -maxdepth 1 -name "libblas.*"

it will give you a list of files like:

/usr/lib/libblas/libblas.so.3.0
/usr/lib/libblas/libblas.so.3

edit make.inc and verify that the BLASLIB is defined by by one name of the list (here /usr/lib/libblas/libblas.so.3.0) or replace the variable.

PLAT = _linux
TMGLIB = libtmglib.a
SUPERLULIB = libsuperlu_3.0.a
BLASLIB = /usr/lib/libblas/libblas.so.3.0
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib
CC = gcc -fPIC
CFLAGS = -O3
FORTRAN = gfortran
FFLAGS = -O3 -fPIC
LOADER = gcc -fPIC
LOADOPTS =
MATLAB = /usr/sww/matlab

in then type:

make

then return to the eXlibris directory and change the contains of the CMakeLists.txt by:

cmake_minimum_required(VERSION 2.6)
project(MyProjet)
enable_testing()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Util/cmakeUtil/ )
include(common_functions)

set(CMAKE_BUILD_TYPE Release)
#set(CMAKE_BUILD_TYPE Debug)
#set(BLAS_VENDOR OPENBLAS)

option(ENABLE_SUPERLU "use SuperLu" ON)
option(ENABLE_TAUCS "use Taucs interface" OFF)

option(USE_ANN "use library ANN" ON)
option(USE_OCTREE "Use Octree" OFF)
option(USE_XCRACK "Use Xcrack" ON)
option(USE_GEOM "Use Geom" OFF)
option(USE_CGAL "use library CGAL" OFF)
option(USE_XCUT "Use Xcut" OFF)
option(USE_XTLS "Use xTLS" OFF)

add_subdirectory(Xfiles)
add_subdirectory(Xinterfaces)
add_subdirectory(Xtest)

save it and return to the build directory:

cd build
rm -fr*
cmake ..
make

if no error occured type:

make install

the following libraries will be installed:

libXfem.so
libXcrack.so
libXext.so
libAnalyticalSolutions.so
libPhysics.so
libSolverBase.so
libSuperLu.so
libLapack.so
libNonLinearSolver.so

 

If the following message appears:

/home/external/eXlibris/Xinterfaces/SolverInterfaces/SuperLu/SuperLu/xLinearSystemSolverSuperLU.cc:18:22: fatal error: dsp_defs.h: Aucun fichier ou dossier de ce type
#include "dsp_defs.h"

Type:

cd ../eXternalLib/SuperLU_3.0/SRC/
ln -s slu_cdefs.h csp_defs.h
ln -s slu_ddefs.h dsp_defs.h
ln -s slu_sdefs.h ssp_defs.h
ln -s slu_zdefs.h zsp_defs.h
cd -

and retry:

make

If something else wrong has occured, especially a message about SuperLu which ask to recompile with option -fPIC, you will have to install your own BLAS ans LAPACK library. We propose some typical libraries in eXternalLib, but you can use other distribution.

For BLAS, we suggest OpenBLAS but you can also use ACML GOTOBLAS ATLAS BLAS. Install it in the eXternalLib directory (see README fils for installation) and select the BLAS vendor by adding the corresponding definition in the CMakeLists.txt (the MP version is for Multi Processor version):

set(BLAS_VENDOR OPENBLAS)
set(BLAS_VENDOR ACML)
set(BLAS_VENDOR ACML_MP)
set(BLAS_VENDOR GOTOBLAS)
set(BLAS_VENDOR GOTOBLAS_MP)
set(BLAS_VENDOR ATLAS)
set(BLAS_VENDOR BLAS)

If the BLAS you choose is not found by cmake, you can add a environment variable to enforce the search:

export BLASLIB="<absolute_path_of_your_blas_library>"
export LAPACKLIB="<absolute_path_of_your_blas_library>"

Here we give some instruction for a basic installation of OpenBLAS and Lapack in eXternalLib directory.

OpenBlas :

To ensure performance, we propose to compile a BLAS (Basic Linear Algebra Subprograms) library. For instance openBLAS. Go to the eXternalLib//OpenBLAS-v0.2.11.0 directory. Edit the Makefile.rule. For linux distribution, this file must contains the following lines:

VERSION = 0.2.11
CC = gcc
FC = gfortran
USE_THREAD = 0
NO_CBLAS = 1
NO_LAPACK = 1
NO_WARMUP = 1
COMMON_PROF = -pg

then type:

make

The compiling must stop with the following printing:

OpenBLAS build complete. (BLAS) OS ... Linux
Architecture ... x86_64
BINARY ... 64bit
C compiler ... GCC (command line : gcc)
Fortran compiler ... GFORTRAN (command line : gfortran)
Library Name ... libopenblas_core2-r0.2.11.a (Single threaded)

To install the library, you can type make PREFIX=/path/to/your/installation install.

If you want to move the library in a other directory, do it and define the following environment variable:

export BLASLIB="<absolute_path_of_your_OpenBLAS_library>"

Now, define the following variable at the beginnig of the CMakeLists.txt files of eXlibris (don't do it if you have defined BLASLIB):

set(BLAS_VENDOR OPENBLAS)

You can try to compile eXlibris again :

cd build
rm -fr *
cmake ..
make
Lapack:

You can also install your own version of Lapack to ensure good performance. Got to the lapack-4.4.2 directory and edit the . For linux distribution, this file must contains the following lines:

SHELL = /bin/sh
FORTRAN = gfortran
OPTS = -O2 -fpic
DRVOPTS = $(OPTS)
NOOPT = -O0 -fpic
LOADER = gfortran
LOADOPTS =
TIMER = INT_ETIME
CC = gcc
CFLAGS = -O3 -fpic
ARCH = ar
ARCHFLAGS= cr
RANLIB = ranlib
XBLASLIB =
BLASLIB = /home/JohnDoe/eXlibris/eXternalLib/OpenBLAS-v0.2.11.0/libopenblas.so
LAPACKLIB = liblapack.a
TMGLIB = libtmglib.a
LAPACKELIB = liblapacke.a

You can note that we will use the previously installed OpenBLAS (see above). You have to give the absolute path of libopenblas.so (here /home/JohnDoe/eXlibris/eXternalLib/OpenBLAS-v0.2.11.0/libopenblas.so). Then type:

make

You can also move le liblapack.a library, but don't forget to define the following environment variable:

export LAPACKLIB="<absolute_path_of_your_blas_library>"

Compilation is under cmake utility. You will need to create a text file called CMakeLists.txt.