Commit 402530aa authored by MIJIEUX Thomas's avatar MIJIEUX Thomas

Update build system and INSTALL.org

parent 99549565
# CMakeLists file for the library fabulous. To refer to the algorithm:
# CMakeLists file for the fabulous library. To refer to the algorithm:
# see IB-BGMRES-DR (Giraud Jing Agullo), contact :
# luc.giraud@inria.fr
......@@ -14,57 +14,25 @@ set(CMAKE_C_FLAGS "-std=c99 -Wall -Wextra")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/morse/find")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/")
find_package(CBLAS COMPONENTS BLASEXT REQUIRED)
find_package(LAPACKE COMPONENTS LAPACKEXT REQUIRED)
find_package(CBLAS REQUIRED COMPONENTS BLASEXT REQUIRED)
find_package(LAPACKE REQUIRED COMPONENTS LAPACKEXT REQUIRED)
find_package(Sanitizers)
include_directories(${CBLAS_INCLUDE_DIRS})
include_directories(${LAPACKE_INCLUDE_DIRS})
##### RPATH HANDLING ####
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
################
if(CBLAS_FOUND)
message(STATUS "CBLAS_FOUND = ${CBLAS_FOUND}")
message(STATUS "CBLAS_LIBRARIES = ${CBLAS_LIBRARIES}")
if(CBLAS_INCLUDE_DIRS)
include_directories(${CBLAS_INCLUDE_DIRS})
endif()
link_directories(${CBLAS_LIBRARY_DIRS})
if(BLAS_LINKER_FLAGS)
list(APPEND CMAKE_EXE_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
else()
message(FATAL_ERROR "CBLAS library has not been found")
endif(CBLAS_FOUND)
if(LAPACKE_FOUND)
message(STATUS "LAPACKE_FOUND = ${LAPACKE_FOUND}")
message(STATUS "LAPACKE_LIBRARIES = ${LAPACKE_LIBRARIES}")
link_directories(${LAPACKE_LIBRARY_DIRS})
if(LAPACKE_INCLUDE_DIRS)
include_directories(${LAPACKE_INCLUDE_DIRS})
endif()
if(LAPACK_LINKER_FLAGS)
list(APPEND CMAKE_EXE_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
endif()
add_definitions(-DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_CPP)
else()
message(FATAL_ERROR "LAPACKE library has not been found")
endif(LAPACKE_FOUND)
# Remove semicolons (;) coming from lapack's 'findBlas'
list(REMOVE_DUPLICATES CMAKE_EXE_LINKER_FLAGS)
string(REPLACE ";" " " CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
# Fix a problem on Mac OS X when building shared libraries
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
......
......@@ -10,14 +10,16 @@
Load spack to into your terminal environment:
#+begin_src sh :tangle load_spack.sh
WORKDIR=${HOME}
export SPACK_ROOT=${WORKDIR}/spack # <- this is important; some scripts may rely on this variable
PWD=$(pwd)
WORKDIR=${WORKDIR:-${PWD}}
export SPACK_ROOT=${SPACK_ROOT:-${WORKDIR}}
source ${SPACK_ROOT}/share/spack/setup-env.sh
export MODULEPATH=$SPACK_ROOT/share/spack/modules/linux-x86_64:$MODULEPATH
spack compiler find
#+end_src
*** Install Fabulous
On plafrim, you need to load the needed modules:
On plafrim, you need to load the required modules:
#+begin_src sh :tangle plafrim_module.sh
module purge
module load compiler/gcc/6.1.0
......@@ -39,7 +41,9 @@
#+begin_src sh :tangle install_with_chameleon.sh
#!/bin/bash
WORKDIR=${HOME}
PWD=$(pwd)
WORKDIR=${WORKDIR:-${PWD}}
cd ${WORKDIR}
source plafrim_module.sh
source load_spack.sh
git clone https://gitlab.inria.fr/tmijieux/chameleon.git --branch complex_type_header
......@@ -56,11 +60,11 @@
Check the specification with:
#+begin_src sh :tangle install_with_chameleon.sh
SPEC="fabulous%gcc@6.1.0 ^chameleon@src ^mkl@exist ^cmake@exist"
SPEC="fabulous+chameleon%gcc@6.1.0 ^chameleon@src ^mkl@exist ^cmake@exist"
spack spec ${SPEC}
#+end_src
If you use the tangled script this prompt you so you can check the spec
If you use the tangled script, this prompt you so you can check the spec
safely before installing:
#+begin_src sh :tangle install_with_chameleon.sh
echo CMAKE_DIR=${CMAKE_DIR}
......@@ -71,30 +75,31 @@
exit 1
fi
#+end_src
On plafrim, spack may have troubles fetching the required dependencies
on the internet. If you encounter this issue, you can create a spack
mirror on your machine and sent it to plafrim:
#+begin_src sh
#local machine:
spack mirror create -d chameleon_mirror -D -o chameleon
spack mirror create -d chameleon_mirror -D -o fabulous
# mirror store dependencies as compressed archives already
# so it is not very useful to add anymore compression at this stage:
tar cf chameleon_mirror.tar chameleon_mirror/
sftp chameleon_mirror.tar plafrim:~
tar cf fabulous_mirror.tar fabulous_mirror/
sftp fabulous_mirror.tar plafrim:~
#on plafrim (for instance, in your $HOME directory):
tar xf chameleon_mirror.tar
spack mirror add local_chameleon_mirror file://${HOME}/chameleon_mirror
tar xf fabulous_mirror.tar
spack mirror add local_mirror file://${HOME}/fabulous_mirror
#+end_src
If everything looks good, you can proceed the installation with:
#+begin_src sh :tangle install_with_chameleon.sh
spack install -v ${SPEC}
#+end_src
spack install -v ${SPEC}
#+end_src
To perform all this with an automated script you can do
#+begin_src emacs-lisp
(org-babel-tangle)
#+end_src
(org-babel-tangle)
#+end_src
or with the emacs command:
#+begin_src emacs
M-x org-babel-tangle
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment