Commit 466c3608 authored by Daniel Wortmann's avatar Daniel Wortmann

Modified configure scheme:

in maschine.sh no modules are loaded and no env variables are set,
this breaks in case cmake is called later from make. Instead machine specific
config files are copied.
parent e5940a5b
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)
#Some stuff might be defined in config file
if (EXISTS "${CMAKE_BINARY_DIR}/config.cmake")
include("${CMAKE_BINARY_DIR}/config.cmake")
endif()
project(FLEUR LANGUAGES C Fortran)
#some variables might be set in the environment
set(FLEUR_LIBRARIES ${FLEUR_LIBRARIES} $ENV{FLEUR_LIBRARIES})
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} $ENV{CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FLEUR_Fortran_FLAGS} $ENV{CMAKE_Fortran_FLAGS}")
if (DEFINED ENV{FLEUR_NO_SERIAL})
set(FLEUR_USE_SERIAL false)
......
#Set the compiler names
set(CMAKE_Fortran_COMPILER mpiifort)
set(CMAKE_C_COMPILER mpiicc)
#Add include pathes
set(FLEUR_Fortran_FLAGS "")
#Add linker stuff
set(FLEUR_LIBRARIES "-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64")
\ No newline at end of file
#Set the compiler names
set(CMAKE_Fortran_COMPILER mpiifort)
set(CMAKE_C_COMPILER mpiicc)
#Add include pathes
set(FLEUR_Fortran_FLAGS "")
#Add linker stuff
set(FLEUR_LIBRARIES "-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64")
\ No newline at end of file
#Set the compiler names
set(CMAKE_Fortran_COMPILER mpixlf2008_r)
set(CMAKE_C_COMPILER mpixlc)
#Add include pathes
set(FLEUR_Fortran_FLAGS "-I$ENV{ELPA_INCLUDE} -I$ENV{HDF5_DIR}/include")
#Add linker stuff
set(FLEUR_LIBRARIES "-L$ENV{SCALAPACK_ROOT}/lib;-lelpa;-lscalapack;-L/bgsys/local/lapack/3.3.0_g/lib;-llapack;-L/bgsys/local/lib;-qessl;-lesslsmpbg;-L$ENV{XML2LIB};-lxml2;-L$ENV{HDF5_DIR}/lib;-lhdf5_fortran;-lhdf5;-L/bgsys/local/zlib/lib/;-lz;-L/bgsys/local/szip/lib/;-lsz")
\ No newline at end of file
#Set the compiler names
set(CMAKE_Fortran_COMPILER mpif90)
set(CMAKE_C_COMPILER mpicc)
#Add include pathes
set(FLEUR_Fortran_FLAGS "-I$ENV{ELPA_MODULES} -I$ENV{EBROOTHDF5}/include -mkl")
#Add linker stuff
set(FLEUR_LIBRARIES "-L$ENV{ELPA_LIB};-lelpa_openmp;-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64;-L$ENV{EBROOTHDF5}/lib;-lhdf5;-lhdf5_fortran")
\ No newline at end of file
#Set the compiler names
set(CMAKE_Fortran_COMPILER mpif90)
#set(CMAKE_C_COMPILER mpiicc)
#Add include pathes
set(FLEUR_Fortran_FLAGS "")
#Add linker stuff
set(FLEUR_LIBRARIES "-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64")
\ No newline at end of file
......@@ -29,10 +29,7 @@ function configure_machine(){
echo "module load Python/2.7.12 CMake HDF5 ELPA/2016.05.003-hybrid"
exit
fi
export CC=mpicc
export FC=mpif90
export CMAKE_Fortran_FLAGS="$CMAKE_Fortran_FLAGS -I$ELPA_MODULES -I$EBROOTHDF5/include -mkl"
export FLEUR_LIBRARIES="$FLEUR_LIBRARIES;-L$ELPA_LIB;-lelpa_openmp;-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64;-L$EBROOTHDF5/lib;-lhdf5;-lhdf5_fortran"
cp $DIR/cmake/JURECA.cmake config.cmake
elif module list 2>&1 |grep -q PGI
then
echo "PGI toolchain used"
......@@ -40,7 +37,7 @@ function configure_machine(){
exit
else
echo "You have to load the correct modules for compiling"
echo " a) intel-para, Python/2.7.12"
echo " a) intel-para"
echo " or"
echo " b) PGI"
exit
......@@ -49,20 +46,23 @@ function configure_machine(){
elif [ "$machine" = "JUQUEEN" ]
then
echo "JUQUEEN configuration used"
module load hdf5/1.8.15_BGQ
module load scalapack/2.0.2_elpa_simd
export CC=mpixlc
export FC=mpixlf2008_r
export CMAKE_Fortran_FLAGS="$CMAKE_Fortran_FLAGS -I${HDF5_DIR}/include -I${ELPA_INCLUDE}"
export FLEUR_LIBRARIES="$FLEUR_LIBRARIES;-L$SCALAPACK_ROOT/lib;-lelpa;-lscalapack;-L/bgsys/local/lapack/3.3.0_g/lib;-llapack;-L/bgsys/local/lib;-qessl;-lesslsmpbg;-L$XML2LIB;-lxml2;-L${HDF5_DIR}/lib;-lhdf5_fortran;-lhdf5;-L/bgsys/local/zlib/lib/;-lz;-L/bgsys/local/szip/lib/;-lsz"
if module list 2>&1| grep -q hdf5 &&
module list 2>&1| grep -q scalapack
then
echo "All required modules load loaded"
else
echo "You have to load the required modules"
echo "module load hdf5/1.8.15_BGQ scalapack/2.0.2_elpa_simd"
exit
fi
cp $DIR/cmake/JUQUEEN.cmake config.cmake
#IFF linux cluster
elif [ "$machine" = "IFF" ]
then
echo "IFF cluster configuration used"
export CC=mpiicc
export FC=mpiifort
export FLEUR_LIBRARIES="$FLEUR_LIBRARIES;-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64"
cp $DIR/cmake/IFF.cmake config.cmake
#RWTH cluster
elif [ "$machine" = "CLAIX" ]
then
......@@ -72,10 +72,8 @@ function configure_machine(){
echo "Please use intelmpi, e.g. do a module switch openmpi intelmpi"
exit
fi
module load LIBRARIES
module load hdf5
export FC=mpiifort
export FLEUR_LIBRARIES="$FLEUR_LIBRARIES;-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64"
cp $DIR/cmake/CLAIX.cmake config.cmake
module load LIBRARIES
elif [ "$machine" = "MARCONI" ]
then
if ! module list 2>&1| grep -q " intel\/" || ! module list 2>&1| grep -q " intelmpi" ||! module list 2>&1| grep -q cmake
......@@ -83,8 +81,7 @@ function configure_machine(){
echo "Load the modules needed to compile: intel,intelmpi,cmake"
exit
fi
export FC=mpif90
export FLEUR_LIBRARIES="$FLEUR_LIBRARIES;-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64"
cp $DIR/cmake/MARCONI.cmake config.cmake
elif [ "$machine" = "AUTO" ]
then
echo "No machine specific settings used"
......
......@@ -28,6 +28,7 @@ then
echo "
By specifying 'debug' in addition to your machine configuration you will build a debugging version"
fi
#Check if we are using the git version and ask if we want to update
if test -d $DIR/.git
then
......@@ -43,9 +44,6 @@ then
fi
#Now check the machine and set some defaults
machine=$1
configure_machine
#include a configfile if present
if test -r config.sh
......@@ -61,6 +59,11 @@ then
fi
mkdir build
cd build
#Now check the machine and set some defaults
machine=$1
configure_machine
#run cmake
if test "debug" == "$2"
then
......
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