]> https://gitweb.dealii.org/ - candi.git/commitdiff
adds ScaLAPACK and MUMPS to be integrated in Trilinos and PetSc (#246)
authorSebastian <35812030+Sebastian-47@users.noreply.github.com>
Thu, 29 Jul 2021 17:53:43 +0000 (19:53 +0200)
committerGitHub <noreply@github.com>
Thu, 29 Jul 2021 17:53:43 +0000 (19:53 +0200)
* Add ScaLAPACK package

* Add MUMPS package

* Removing the check if ParMETIS is available before installing MUMPS and ScaLAPACK.

* Set the packages depending on whether MKL is available

* fix typo

candi.cfg
deal.II-toolchain/packages/mumps.package [new file with mode: 0644]
deal.II-toolchain/packages/petsc.package
deal.II-toolchain/packages/scalapack.package [new file with mode: 0644]
deal.II-toolchain/packages/trilinos.package

index 3a5dd336db508d90e9e70ec337e5707cc3763b7a..647b57d5344486277b27a5b4ba6114ad3c52a79e 100644 (file)
--- a/candi.cfg
+++ b/candi.cfg
@@ -61,6 +61,7 @@ PACKAGES="load:dealii-prepare"
 #PACKAGES="${PACKAGES} once:boost"
 #PACKAGES="${PACKAGES} once:numdiff"
 #PACKAGES="${PACKAGES} once:openblas"
+#PACKAGES="${PACKAGES} once:scalapack"
 
 # These packages are not dependencies but are tools used for deal.II development:
 #PACKAGES="${PACKAGES} once:astyle"
@@ -73,6 +74,7 @@ PACKAGES="load:dealii-prepare"
 #PACKAGES="${PACKAGES} once:ginkgo"
 #PACKAGES="${PACKAGES} once:gmsh"
 #PACKAGES="${PACKAGES} once:gsl"
+#PACKAGES="${PACKAGES} once:mumps"
 PACKAGES="${PACKAGES} once:opencascade"
 PACKAGES="${PACKAGES} once:parmetis"
 #PACKAGES="${PACKAGES} once:sundials"
diff --git a/deal.II-toolchain/packages/mumps.package b/deal.II-toolchain/packages/mumps.package
new file mode 100644 (file)
index 0000000..dd73efc
--- /dev/null
@@ -0,0 +1,85 @@
+################################################################################
+## MUMPS                                                                      ##
+################################################################################
+
+VERSION=5.4.0.5
+EXTRACTSTO=mumps-${VERSION}
+
+NAME=v${VERSION}
+PACKING=.tar.gz
+
+SOURCE=https://github.com/scivision/mumps/archive/
+CHECKSUM=0cd3bd9ad9860f7c0092cd561931a36e
+
+BUILDCHAIN=cmake
+
+BUILDDIR=${BUILD_PATH}/mumps-${VERSION}
+INSTALL_PATH=${INSTALL_PATH}/mumps-${VERSION}
+
+# 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_C_FLAGS:STRING='-fPIC -g -O3' \
+      -D CMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"
+
+if [ ${MKL} = ON ]; then
+    # When MKL is provided, MUMPS will search for the required packages by itself.
+    # Therefore we only need to set MKLROOT.
+    CONFOPTS="${CONFOPTS} \
+      -D MKLROOT=${MKL_DIR}"
+else
+  if [ ! -z "${BLAS_DIR}" ]; then
+      CONFOPTS="${CONFOPTS} \
+        -D pc_blas_LIBRARY_DIRS=${BLAS_DIR}/lib "
+  fi
+
+  if [ ! -z "${LAPACK_DIR}" ]; then
+      CONFOPTS="${CONFOPTS} \
+        -D pc_lapack_LIBRARY_DIRS=${LAPACK_DIR}/lib"
+  fi
+
+  if [ ! -z "${SCALAPACK_DIR}" ]; then
+      CONFOPTS="${CONFOPTS} \
+        -D pc_scalapack_LIBRARY_DIRS=${SCALAPACK_DIR}/lib"
+  else
+      # auto build missing packages
+      CONFOPTS="${CONFOPTS} -D autobuild=true"
+  fi
+fi
+
+# Set metis directories
+if [ ! -z "${METIS_DIR}" ]; then
+    CONFOPTS="${CONFOPTS} \
+        -D metis=true \
+        -D METIS_LIBRARY=${METIS_DIR}/lib/libmetis.so \
+        -D METIS_INCLUDE_DIR=${METIS_DIR}/include \
+        -D PARMETIS_LIBRARY=${PARMETIS_DIR}/lib/libparmetis.so "
+fi
+
+
+package_specific_register () {
+    export MUMPS_DIR=${INSTALL_PATH}
+}
+
+package_specific_conf () {
+    # Generate configuration file
+    CONFIG_FILE=${CONFIGURATION_PATH}/${EXTRACTSTO}
+    rm -f $CONFIG_FILE
+    echo "
+export MUMPS_DIR=${INSTALL_PATH}
+" >> $CONFIG_FILE
+}
index d9dc2d47b22e7268be38977dd5211d1d0f334516..f409cce625fa425bb9ef41e37f9cd2d256544e56 100644 (file)
@@ -80,10 +80,23 @@ if [ ! -z "${PARMETIS_DIR}" ]; then
         ${CONFOPTS} \
         --with-parmetis-dir=${PARMETIS_DIR} \
        --with-metis-dir=${PARMETIS_DIR}"
+fi
+
+if [ ! -z "${SCALAPACK_DIR}" ]; then
+    cecho ${INFO} "PETSc: configuration with SCALAPACK"
+    CONFOPTS="\
+        ${CONFOPTS} \
+        --with-scalapack-dir=${SCALAPACK_DIR}"
+else
+    CONFOPTS="${CONFOPTS} --download-scalapack=1"
+fi
 
-    for external_pkg in scalapack mumps; do
-        CONFOPTS="${CONFOPTS} --download-${external_pkg}=1"
-    done
+if [ ! -z "${MUMPS_DIR}" ]; then
+    cecho ${INFO} "PETSc: configuration with MUMPS"
+    CONFOPTS="${CONFOPTS} \
+        --with-mumps-dir=${MUMPS_DIR}"
+else
+    CONFOPTS="${CONFOPTS} --download-mumps=1"
 fi
 
 #########################################################################
@@ -104,7 +117,7 @@ package_specific_setup () {
 
 package_specific_register () {
     export PETSC_DIR=${INSTALL_PATH}
-    if [ ! -z "${PARMETIS_DIR}" ]; then
+    if [ ! -z "${SCALAPACK_DIR}" ]; then
         export SCALAPACK_DIR=${INSTALL_PATH}
     fi
 }
@@ -116,7 +129,7 @@ package_specific_conf () {
     echo "
 export PETSC_DIR=${INSTALL_PATH}
 " >> $CONFIG_FILE
-    if [ ! -z "${PARMETIS_DIR}" ]; then
+    if [ ! -z "${SCALAPACK_DIR}" ]; then
        echo "export SCALAPACK_DIR=${INSTALL_PATH}" >> $CONFIG_FILE
     fi
 }
diff --git a/deal.II-toolchain/packages/scalapack.package b/deal.II-toolchain/packages/scalapack.package
new file mode 100644 (file)
index 0000000..6d6c251
--- /dev/null
@@ -0,0 +1,93 @@
+################################################################################
+## ScaLAPACK                                                                  ##
+################################################################################
+
+VERSION=2.1.0
+EXTRACTSTO=scalapack-${VERSION}
+
+NAME=v${VERSION}
+PACKING=.tar.gz
+
+SOURCE=https://github.com/Reference-ScaLAPACK/scalapack/archive/
+CHECKSUM=e9ae970238030fa1e8ee022a9d3e6fbb
+
+BUILDCHAIN=cmake
+
+BUILDDIR=${BUILD_PATH}/scalapack-${VERSION}
+INSTALL_PATH=${INSTALL_PATH}/scalapack-${VERSION}
+
+
+
+# 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
+
+# Set Fortran flags
+if [ -n ${FC} ]; then
+  FORTRAN_MAJOR_VERSION=$(echo __GNUC__ | ${FC} -E -xc - | tail -n 1)
+  if [ ${FORTRAN_MAJOR_VERSION} > 9 ]; then
+    CONFOPTS="${CONFOPTS} \
+      -D CMAKE_Fortran_FLAGS='-g -O3 -fallow-argument-mismatch' "
+  else
+    CONFOPTS="${CONFOPTS} \
+      -D CMAKE_Fortran_FLAGS='-g -O3' "
+  fi
+fi
+
+
+# Set C flags
+CONFOPTS="${CONFOPTS} \
+  -D CMAKE_C_FLAGS:STRING='-fPIC -g -O3 ' \
+  -D CMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"
+
+# Set intel MKL options
+if [ "${MKL}" = "ON" ]; then
+    cecho ${INFO} "MUMPS: configuration with MKL"
+
+    CONFOPTS="\
+        ${CONFOPTS} \
+        -D MKLROOT=${MKL_DIR}"
+else 
+  # Set blas and lapack directories (if MKL is not used)
+  if [ ! -z "${BLAS_DIR}" ]; then
+      cecho ${INFO} "SCALAPACK: configuration with BLAS_DIR=${BLAS_DIR}"
+      CONFOPTS="${CONFOPTS} \
+        -D BLAS_LIBRARY_DIRS:STRING=${BLAS_DIR}"
+  fi
+  
+  if [ ! -z "${LAPACK_DIR}" ]; then
+      cecho ${INFO} "SCALAPACK: configuration with LAPACK_DIR=${LAPACK_DIR}"
+      CONFOPTS="${CONFOPTS} \
+        -D LAPACK_LIBRARY_DIRS:STRING=${LAPACK_DIR}"
+  fi
+fi
+
+# BLACS is provided by ScaLAPACK
+package_specific_register () {
+    export SCALAPACK_DIR=${INSTALL_PATH}
+    # only export the BLACS dir when MKL is not provided, so we do not override the MKL BLACS_DIR
+    if [ ${MKL} = OFF ]; then
+      export BLACS_DIR=${INSTALL_PATH}/lib
+    fi
+}
+
+package_specific_conf () {
+    # Generate configuration file
+    CONFIG_FILE=${CONFIGURATION_PATH}/${EXTRACTSTO}
+    rm -f $CONFIG_FILE
+    echo "
+export SCALAPACK_DIR=${INSTALL_PATH}
+" >> $CONFIG_FILE
+}
index 765446e86dffc5e0cfe1b3c0d42193195436b03e..9ba3c4a893899b3b13f8c0b5039c896893162e23 100644 (file)
@@ -90,6 +90,22 @@ if [ ! -z "${LAPACK_DIR}" ]; then
       -D LAPACK_LIBRARY_DIRS:STRING=${LAPACK_DIR}"
 fi
 
+if [ ! -z "${SCALAPACK_DIR}" ]; then
+    cecho ${INFO} "trilinos: configuration with SCALAPACK_DIR=${SCALAPACK_DIR}"
+    CONFOPTS="\
+        ${CONFOPTS} \
+        -D TPL_ENABLE_SCALAPACK:BOOL=ON \
+        -D SCALAPACK_LIBRARY_DIRS=${SCALAPACK_DIR}/lib"
+fi
+
+if [ ! -z "${MUMPS_DIR}" ]; then
+    cecho ${INFO} "trilinos: configuration with MUMPS_DIR=${MUMPS_DIR}"
+    CONFOPTS="${CONFOPTS} \
+      -D TPL_ENABLE_MUMPS=ON \
+      -D MUMPS_INCLUDE_DIRS:STRING=${MUMPS_DIR}/include \
+      -D MUMPS_LIBRARY_DIRS:STRING=${MUMPS_DIR}/lib"
+fi
+
 # Set intel MKL options
 if [ ${MKL} = ON ]; then
     cecho ${INFO} "trilinos: configuration with MKL"

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.