Commit 9f75b246 authored by Daniel Wortmann's avatar Daniel Wortmann

Updated config scripts...

parent 2c5ca3c8
#This file contains the defaults for compiling FLEUR on known machines #This file contains the defaults for compiling FLEUR on known machines
#please add further definitions here and also add code below! cd $DIR/cmake/machines/
read -r -d '' known_machines << EOM for f in *.sh
IFF -- cluster @ PGI of FZJ do
JURECA -- @JSC config=`basename $f .sh`
CLAIX -- RWTH cluster desc=`head -1 $f|cut -d# -f 2`
EOM if [ ! "$desc" == "NOSHOW" ]
then
known_machines="$known_machines
$config
-- $desc "
fi
done
cd -
function configure_machine(){ function configure_machine(){
if [ "$machine" = "AUTO" ] if [ "$machine" = "AUTO" ]
......
#Configuration for CLAIX@RWTH; do a 'module load intelmpi' before
if ! module list 2>&1| grep -q intelmpi if ! module list 2>&1| grep -q intelmpi
then then
echo "Please use intelmpi, e.g. do a module switch openmpi intelmpi" echo "Please use intelmpi, e.g. do a module switch openmpi intelmpi"
...@@ -14,12 +16,5 @@ ...@@ -14,12 +16,5 @@
FLEUR_LIBDIR="$FLEUR_LIBDIR $ELPA_LIB" FLEUR_LIBDIR="$FLEUR_LIBDIR $ELPA_LIB"
FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $ELPA_MODULES" FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $ELPA_MODULES"
fi fi
#hdf5
if [ $HDF5_ROOT ]
then
FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_ROOT/lib"
FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_ROOT/include"
fi
FLEUR_LIBRARIES="-lelpa_openmp;-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64"
#NOSHOW
export FC=mpif90 export FC=mpif90
FLEUR_INCLUDEDIR="/opt/include" FLEUR_INCLUDEDIR="/opt/include"
FLEUR_LIBRARIES="-L/opt/lib;-lxcf03;-lxc;-lhdf5_fortran;-lhdf5;-ldl;-L/usr/lib;-L/usr/lib/x86_64-linux-gnu;-lxml2;-lscalapack-openmpi;-lblacsF77init-openmpi;-lblacs-openmpi;-llapack;-lblas" FLEUR_LIBRARIES="-L/opt/lib;-lxcf03;-lxc;-lhdf5_fortran;-lhdf5;-ldl;-L/usr/lib;-L/usr/lib/x86_64-linux-gnu;-lxml2;-lscalapack-openmpi;-lblacsF77init-openmpi;-lblacs-openmpi;-llapack;-lblas"
# Set compilers to ifort,icc,icpc
export FC=${FC:=ifort}
export CC=${CC:=icc}
export CXX=${CXX:=icpc}
#Set the compilers to mpiifort, mpiicc, mpiicpc
export FC=${FC:=mpiifort} export FC=${FC:=mpiifort}
export CC=${CC:=mpiicc} export CC=${CC:=mpiicc}
export CXX=${CXX:=mpiicpc} export CXX=${CXX:=mpiicpc}
FLEUR_LIBRARIES="-lxml2;-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64;-mt_mpi;${FLEUR_LIBRARIES}"
#Configuration for JURECA@FZJ; Use intel-toolchain, e.g. do a 'module load intel-para'
#determine XML2 module
xml2=`module --show_hidden spider libxml2 2>&1 |grep libxml2/|grep -v module |tail -1`
#determine ELPA module
elpa=`module spider ELPA 2>&1 |grep hybrid`
if module list 2>&1 |grep -q -i intel if module list 2>&1 |grep -q -i intel
then then
echo "Intel toolchain used" echo "Intel toolchain used"
...@@ -9,14 +16,6 @@ then ...@@ -9,14 +16,6 @@ then
then then
error=1 error=1
fi fi
if ! echo "$module_list" |grep ELPA | grep hybrid
then
error=1
fi
if ! echo "$module_list" |grep HDF5
then
error=1
fi
if ! echo "$module_list" |grep xml2 if ! echo "$module_list" |grep xml2
then then
error=1 error=1
...@@ -42,22 +41,8 @@ then ...@@ -42,22 +41,8 @@ then
CLI_ELPA_OPENMP=1 CLI_ELPA_OPENMP=1
FLEUR_LIBDIR="$FLEUR_LIBDIR $ELPA_LIB" FLEUR_LIBDIR="$FLEUR_LIBDIR $ELPA_LIB"
FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $ELPA_MODULES_OPENMP" FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $ELPA_MODULES_OPENMP"
#hdf5
FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_DIR/lib"
FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_DIR/include"
FLEUR_LIBRARIES="-lelpa_openmp;-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64"
elif module list 2>&1 |grep -q PGI
then
echo "PGI toolchain used"
FC=mpif90
CC=mpicc
FLEUR_INCLUDEDIR="$XML2_ROOT/include"
FLEUR_LIBRARIES="-lstdc++;-L$MKLROOT/lib/intel64;-lmkl_scalapack_lp64;-lmkl_intel_lp64;-lmkl_pgi_thread;-lmkl_core;-lmkl_blacs_intelmpi_lp64"
else else
echo "You need to load the modules for the compiler" echo "You need to load the modules for the compiler"
echo "e.g. module load intel-para" echo "e.g. module load intel-para CMake HDF5 $xml2 $elpa "
exit exit
fi fi
#Configuration for JURECA@FZJ; use PGI toolchain
#determine XML2 module
xml2=`module --show_hidden spider libxml2 2>&1 |grep libxml2/|grep -v module |tail -1`
#determine ELPA module
elpa=`module spider ELPA 2>&1 |grep hybrid`
if module list 2>&1 |grep -q PGI
then
echo "PGI toolchain used"
FC=mpif90
CC=mpicc
FLEUR_INCLUDEDIR="$XML2_ROOT/include"
FLEUR_LIBRARIES="-lstdc++;-L$MKLROOT/lib/intel64;-lmkl_scalapack_lp64;-lmkl_intel_lp64;-lmkl_pgi_thread;-lmkl_core;-lmkl_blacs_intelmpi_lp64"
else
echo "You need to load the modules for the compiler"
echo "e.g. module load intel-para CMake HDF5 $xml2 $elpa "
exit
fi
...@@ -102,8 +102,7 @@ Special options: ...@@ -102,8 +102,7 @@ Special options:
To help the script finding a proper configuration you should provide the name of To help the script finding a proper configuration you should provide the name of
a specific machine to compile on. a specific machine to compile on.
Currently known machine configurations are: Currently known machine configurations are: "
"
echo " $known_machines" echo " $known_machines"
echo " echo "
If you do not specify the machine the AUTO option will be used in which some If you do not specify the machine the AUTO option will be used in which some
......
...@@ -2,6 +2,14 @@ ...@@ -2,6 +2,14 @@
echo "set(compile_user $USER)" >config.cmake echo "set(compile_user $USER)" >config.cmake
#Some freqeuntly used Environment variables
if [ -z ${HDF5_ROOT+x} ] ; then FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_ROOT/lib" ; FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_ROOT/include" ; fi
if [ -z ${HDF5_DIR+x} ] ; then FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_DIR/lib" ; FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_DIR/include" ; fi
if [ -z ${HDF5_LIB+x} ] ; then FLEUR_LIBDIR="$FLEUR_LIBDIR $HDF5_LIB" ; fi
if [ -z ${HDF5_INCLUDE+x} ] ; then FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_INCLUDE" ; fi
if [ -z ${HDF5_MODULES+x} ] ; then FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $HDF5_MODULES" ; fi
#Set options for linker #Set options for linker
#1. if environment variable FLEUR_LIBRARIES is present use it #1. if environment variable FLEUR_LIBRARIES is present use it
...@@ -22,7 +30,8 @@ then ...@@ -22,7 +30,8 @@ then
fi fi
fi fi
#check the FLEUR_LIBDIR variable #check the FLEUR_LIBDIR variable
for lib in $FLEUR_LIBDIR $CLI_LIBDIR
for lib in $FLEUR_LIBDIR $CLI_LIBDIR
do do
if [ "cmake_lib" ] if [ "cmake_lib" ]
then then
......
...@@ -3,7 +3,18 @@ try_compile(FLEUR_USE_SCALAPACK ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/te ...@@ -3,7 +3,18 @@ try_compile(FLEUR_USE_SCALAPACK ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/te
LINK_LIBRARIES ${FLEUR_LIBRARIES} LINK_LIBRARIES ${FLEUR_LIBRARIES}
) )
#Try typical mkl string
if (NOT FLEUR_USE_SCALAPACK)
set(TEST_LIBRARIES "${FLEUR_LIBRARIES};-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64")
try_compile(FLEUR_USE_SCALAPACK ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_SCALAPACK.f90
LINK_LIBRARIES ${TEST_LIBRARIES}
)
if (FLEUR_USE_SCALAPACK)
set(FLEUR_LIBRARIES ${TEST_LIBRARIES})
endif()
endif()
message("SCALAPACK Library found:${FLEUR_USE_SCALAPACK}") message("SCALAPACK Library found:${FLEUR_USE_SCALAPACK}")
if (FLEUR_USE_SCALAPACK) if (FLEUR_USE_SCALAPACK)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_SCALAPACK") set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_SCALAPACK")
endif() endif()
\ No newline at end of file
...@@ -17,6 +17,20 @@ try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/te ...@@ -17,6 +17,20 @@ try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/te
endif() endif()
endif() endif()
#Try to simply add -lxml2
if (NOT FLEUR_USE_XML)
set(TEST_LIBRARIES ${FLEUR_LIBRARIES} -lxml2)
try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_XML.f90
LINK_LIBRARIES ${TEST_LIBRARIES}
)
if (FLEUR_USE_XML)
set(FLEUR_LIBRARIES -lxml2 ${FLEUR_LIBRARIES})
set(FLEUR_MPI_LIBRARIES -lxml2 ${FLEUR_MPI_LIBRARIES})
endif()
endif()
message("XML Library found for linking:${FLEUR_USE_XML}") message("XML Library found for linking:${FLEUR_USE_XML}")
if (FLEUR_USE_XML) if (FLEUR_USE_XML)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#These contain functions to be used later on... #These contain functions to be used later on...
. $DIR/cmake/machines.sh . $DIR/cmake/machines.sh
. $DIR/external/install_external.sh . $DIR/external/install_external.sh
#variables to store arguments #variables to store arguments
......
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