From fefc1c326c0cbdff5873562fb102f9731d1fc4a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20K=C3=B6cher?= Date: Thu, 29 Oct 2015 09:11:02 +0100 Subject: [PATCH] deal.II: trilinos: set up compilers safely, if $CC, $CXX and/or $FC are present --- deal.II/packages/trilinos.package | 91 ++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 31 deletions(-) diff --git a/deal.II/packages/trilinos.package b/deal.II/packages/trilinos.package index 93c519a..2e8ac0d 100644 --- a/deal.II/packages/trilinos.package +++ b/deal.II/packages/trilinos.package @@ -1,16 +1,16 @@ if [ ${TRILINOS_MAJOR_VERSION} = "AUTO" ] || [ ${TRILINOS_MAJOR_VERSION} = "12" ]; then - SOURCE=http://trilinos.csbsju.edu/download/files/ - VERSION=12.2.1 - CHECKSUM=760f14cbce482b4b9a41d1c18297b531 + SOURCE=http://trilinos.csbsju.edu/download/files/ + VERSION=12.2.1 + CHECKSUM=760f14cbce482b4b9a41d1c18297b531 elif [ ${TRILINOS_MAJOR_VERSION} = "11" ]; then - SOURCE=https://trilinos.org/oldsite/download/files/ - VERSION=11.14.3 - CHECKSUM=b6e5d6b71f6e554de220aeda51794ffb + SOURCE=https://trilinos.org/oldsite/download/files/ + VERSION=11.14.3 + CHECKSUM=b6e5d6b71f6e554de220aeda51794ffb else - cecho ${BAD} "Unknown Trilinos version ${TRILINOS_MAJOR_VERSION} forced, please use AUTO|12|11." - exit + cecho ${BAD} "Unknown Trilinos version ${TRILINOS_MAJOR_VERSION} forced, please use AUTO|12|11." + exit fi NAME=trilinos-${VERSION}-Source @@ -19,37 +19,71 @@ DOWNLOADER=curl BUILDCHAIN=cmake ######################################################################### +# If you have further options for trilinos, please set: +#TRILINOS_CONFOPTS="" +######################################################################### +# Please do not change the following options + +# Set blas and lapack directories if [ ! -z "${BLAS_DIR}" ]; then - TRILINOS_CONFOPTS="${TRILINOS_CONFOPTS} \ - -D BLAS_LIBRARY_DIRS:STRING=${BLAS_DIR} \ - " + CONFOPTS="\ + ${CONFOPTS} \ + -D BLAS_LIBRARY_DIRS:STRING=${BLAS_DIR}" fi if [ ! -z "${LAPACK_DIR}" ]; then - TRILINOS_CONFOPTS="${TRILINOS_CONFOPTS} \ - -D LAPACK_LIBRARY_DIRS:STRING=${LAPACK_DIR} \ - " + CONFOPTS=" + ${CONFOPTS} \ + -D LAPACK_LIBRARY_DIRS:STRING=${LAPACK_DIR}" fi +# Set intel MKL options if [ ${MKL} = "ON" ]; then - if [ -z "${BLAS_DIR}" ] && [ -z "${LAPACK_DIR}" ]; then - TRILINOS_CONFOPTS=" \ - ${TRILINOS_CONFOPTS} \ - -D BLAS_LIBRARY_DIRS:STRING=${MKL_DIR} \ - -D LAPACK_LIBRARY_DIRS:STRING=${MKL_DIR} \ - " - fi - TRILINOS_CONFOPTS=" \ - ${TRILINOS_CONFOPTS} \ - -D BLAS_LIBRARY_NAMES:STRING='mkl_core;mkl_sequential' \ - -D LAPACK_LIBRARY_NAMES:STRING=mkl_intel_lp64 \ - " + if [ -z "${BLAS_DIR}" ] && [ -z "${LAPACK_DIR}" ]; then + CONFOPTS=" \ + ${CONFOPTS} \ + -D BLAS_LIBRARY_DIRS:STRING=${MKL_DIR} \ + -D LAPACK_LIBRARY_DIRS:STRING=${MKL_DIR}" + fi + + CONFOPTS=" \ + ${CONFOPTS} \ + -D BLAS_LIBRARY_NAMES:STRING='mkl_core;mkl_sequential' \ + -D LAPACK_LIBRARY_NAMES:STRING=mkl_intel_lp64" fi +# Set compilers & compiler options +if [ ! -z "${CC}" ]; then + CONFOPTS="\ + ${CONFOPTS} \ + -D CMAKE_C_COMPILER=${CC}" +fi + +if [ ! -z "${CXX}" ]; then + CONFOPTS="\ + ${CONFOPTS} \ + -D CMAKE_CXX_COMPILER=${CXX}" +fi + +if [ ! -z "${FC}" ]; then + CONFOPTS="\ + ${CONFOPTS} \ + -D CMAKE_Fortran_COMPILER=${FC}" +fi + +CONFOPTS="${CONFOPTS} \ + -D CMAKE_CXX_FLAGS:STRING=-fPIC -g -O3 \ + -D CMAKE_C_FLAGS:STRING=-fPIC -g -O3 \ + -D CMAKE_FORTRAN_FLAGS:STRING=-g -O5 \ + -D Trilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran" + ######################################################################### +# General Trilinos configuration CONFOPTS="${TRILINOS_CONFOPTS} \ + ${CONFOPTS} \ + -D TPL_ENABLE_MPI:BOOL=ON \ -D Trilinos_ENABLE_OpenMP:BOOL=OFF \ -D TPL_ENABLE_TBB:BOOL=OFF \ -D Trilinos_ENABLE_Didasko:BOOL=ON \ @@ -65,13 +99,8 @@ CONFOPTS="${TRILINOS_CONFOPTS} \ -D SuperLUDist_INCLUDE_DIRS:PATH=${INSTALL_PATH}/include/superlu \ -D HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON \ -D CMAKE_BUILD_TYPE:STRING=RELEASE \ - -D CMAKE_CXX_FLAGS:STRING=-fPIC -g -O3 \ - -D CMAKE_C_FLAGS:STRING=-fPIC -g -O3 \ - -D CMAKE_FORTRAN_FLAGS:STRING=-g -O5 \ - -D Trilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran \ -D CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE \ -D Trilinos_VERBOSE_CONFIGURE:BOOL=FALSE \ - -D TPL_ENABLE_MPI:BOOL=ON \ -D BUILD_SHARED_LIBS:BOOL=ON" package_specific_register () { -- 2.39.5