Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scalapack, mumps, petsc #251

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion candi.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ 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:mumps"
#PACKAGES="${PACKAGES} once:sundials"
#PACKAGES="${PACKAGES} once:superlu_dist"
PACKAGES="${PACKAGES} once:hdf5"
Expand Down
93 changes: 49 additions & 44 deletions deal.II-toolchain/packages/mumps.package
Original file line number Diff line number Diff line change
@@ -1,75 +1,81 @@
################################################################################
## MUMPS ##
# MUMPS
################################################################################

# TODO:
# PETSc 3.13.1: Warning: Using version 5.4.0 of package mumps PETSc is tested with 5.2
# PETSc 3.15.2: Warning: Using version 5.4.0 of package mumps PETSc is tested with 5.3

VERSION=5.4.0.5
CHECKSUM=0cd3bd9ad9860f7c0092cd561931a36e

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 "${CC}" ]; then
# CONFOPTS="${CONFOPTS} \
# -D CMAKE_C_COMPILER=${CC}"
#fi

if [ ! -z "${CXX}" ]; then
CONFOPTS="${CONFOPTS} \
-D CMAKE_CXX_COMPILER=${CXX}"
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
#if [ ! -z "${FC}" ]; then
# CONFOPTS="${CONFOPTS} \
# -D CMAKE_Fortran_COMPILER=${FC}"
#fi

CONFOPTS="${CONFOPTS} -D CMAKE_C_FLAGS:STRING='-fPIC -g -O3' "

CONFOPTS="${CONFOPTS} \
-D CMAKE_C_FLAGS:STRING='-fPIC -g -O3' \
-D CMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"
CONFOPTS="${CONFOPTS} -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}"
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
if [ -n "${BLAS_DIR}" ]; then
CONFOPTS="${CONFOPTS} -D pc_blas_LIBRARY_DIRS=${BLAS_DIR}/lib"
fi

if [ -n "${LAPACK_DIR}" ]; then
CONFOPTS="${CONFOPTS} -D pc_lapack_LIBRARY_DIRS=${LAPACK_DIR}/lib"
fi

if [ -n "${SCALAPACK_DIR}" ]; then
CONFOPTS="${CONFOPTS} -D pc_scalapack_LIBRARY_DIRS=${SCALAPACK_DIR}/lib"
fi

# TODO: mumps installs scalapack and blacs now!
# auto build missing packages
CONFOPTS="${CONFOPTS} -D autobuild=true"
fi

# Set metis directories
if [ ! -z "${METIS_DIR}" ]; then
# Metis
if [ -n "${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 "
-D METIS_LIBRARY=${METIS_DIR}/lib/libmetis.${LDSUFFIX} \
-D METIS_INCLUDE_DIR=${METIS_DIR}/include"
fi

# Parmetis
if [ -n "${PARMETIS_DIR}" ]; then
CONFOPTS="${CONFOPTS} \
-D PARMETIS_LIBRARY=${PARMETIS_DIR}/lib/libparmetis.${LDSUFFIX}"
fi

package_specific_register () {
export MUMPS_DIR=${INSTALL_PATH}
Expand All @@ -79,7 +85,6 @@ package_specific_conf () {
# Generate configuration file
CONFIG_FILE=${CONFIGURATION_PATH}/${EXTRACTSTO}
rm -f $CONFIG_FILE
echo "
export MUMPS_DIR=${INSTALL_PATH}
" >> $CONFIG_FILE

echo "export MUMPS_DIR=${INSTALL_PATH}" >> $CONFIG_FILE
}
65 changes: 43 additions & 22 deletions deal.II-toolchain/packages/petsc.package
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
VERSION=3.13.1
CHECKSUM=b8b99c4a16fbc7d6694a70af044dbaac
VERSION=3.15.2
CHECKSUM=3f657db3a8d25835fb8a7c292f42aa17

#VERSION=3.13.1
#CHECKSUM=b8b99c4a16fbc7d6694a70af044dbaac

#VERSION=3.11.3
#CHECKSUM=e04cbb1aaccde4a33c8843e75a1fba15
Expand Down Expand Up @@ -73,29 +76,38 @@ else
fi
fi

# Add ParMETIS, if present
if [ ! -z "${PARMETIS_DIR}" ]; then
# ParMETIS
if [ -n "${PARMETIS_DIR}" ]; then
cecho ${INFO} "PETSc: configuration with ParMETIS"
CONFOPTS="\
${CONFOPTS} \
cecho ${INFO} "PETSc: setting --with-parmetis-dir=${PARMETIS_DIR}"
cecho ${INFO} "PETSc: setting --with-metis-dir=${PARMETIS_DIR}"
CONFOPTS="${CONFOPTS} \
--with-parmetis-dir=${PARMETIS_DIR} \
--with-metis-dir=${PARMETIS_DIR}"
--with-metis-dir=${PARMETIS_DIR}"
fi

if [ ! -z "${SCALAPACK_DIR}" ]; then
# ScaLAPACK
if [ -n "${SCALAPACK_DIR}" ]; then
cecho ${INFO} "PETSc: configuration with SCALAPACK"
CONFOPTS="\
${CONFOPTS} \
--with-scalapack-dir=${SCALAPACK_DIR}"
else
CONFOPTS="${CONFOPTS} --download-scalapack=1"
cecho ${INFO} "PETSc: setting --with-scalapack-dir=${SCALAPACK_DIR}"
CONFOPTS="${CONFOPTS} --with-scalapack-dir=${SCALAPACK_DIR}"
fi

if [ ! -z "${MUMPS_DIR}" ]; then
# MUMPS
if [ -n "${MUMPS_DIR}" ]; then
cecho ${INFO} "PETSc: configuration with MUMPS"
CONFOPTS="${CONFOPTS} \
--with-mumps-dir=${MUMPS_DIR}"
cecho ${INFO} "PETSc: setting --with-mumps-dir=${MUMPS_DIR}"
CONFOPTS="${CONFOPTS} --with-mumps-dir=${MUMPS_DIR}"
else
# PETSc: --download-mumps needs scalapack
if [ -z "${SCALAPACK_DIR}" ]; then
cecho ${INFO} "PETSc: setting --download-scalapack=1"
CANDI_PETSC_INSTALLS_SCALAPACK=ON
CONFOPTS="${CONFOPTS} --download-scalapack=1"
fi

cecho ${INFO} "PETSc: setting --download-mumps=1"
CANDI_PETSC_INSTALLS_MUMPS=ON
CONFOPTS="${CONFOPTS} --download-mumps=1"
fi

Expand All @@ -117,19 +129,28 @@ package_specific_setup () {

package_specific_register () {
export PETSC_DIR=${INSTALL_PATH}
if [ ! -z "${SCALAPACK_DIR}" ]; then

if [ ${CANDI_PETSC_INSTALLS_SCALAPACK} = "ON" ]; then
export SCALAPACK_DIR=${INSTALL_PATH}
fi

if [ ${CANDI_PETSC_INSTALLS_MUMPS} = "ON" ]; then
export MUMPS_DIR=${INSTALL_PATH}
fi
}

package_specific_conf () {
# Generate configuration file
CONFIG_FILE=${CONFIGURATION_PATH}/${EXTRACTSTO}
rm -f $CONFIG_FILE
echo "
export PETSC_DIR=${INSTALL_PATH}
" >> $CONFIG_FILE
if [ ! -z "${SCALAPACK_DIR}" ]; then
echo "export SCALAPACK_DIR=${INSTALL_PATH}" >> $CONFIG_FILE

echo "export PETSC_DIR=${INSTALL_PATH}" >> $CONFIG_FILE

if [ ${CANDI_PETSC_INSTALLS_SCALAPACK} = "ON" ]; then
echo "export SCALAPACK_DIR=${INSTALL_PATH}" >> $CONFIG_FILE
fi

if [ ${CANDI_PETSC_INSTALLS_MUMPS} = "ON" ]; then
echo "export MUMPS_DIR=${INSTALL_PATH}" >> $CONFIG_FILE
fi
}
101 changes: 50 additions & 51 deletions deal.II-toolchain/packages/scalapack.package
Original file line number Diff line number Diff line change
@@ -1,93 +1,92 @@
################################################################################
## ScaLAPACK ##
# ScaLAPACK
################################################################################

# TODO:
# BLACS is provided by ScaLAPACK

VERSION=2.1.0
CHECKSUM=e9ae970238030fa1e8ee022a9d3e6fbb

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 "${CC}" ]; then
# CONFOPTS="${CONFOPTS} \
# -D CMAKE_C_COMPILER=${CC}"
#fi

if [ ! -z "${CXX}" ]; then
CONFOPTS="${CONFOPTS} \
-D CMAKE_CXX_COMPILER=${CXX}"
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
#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
FORTRAN_MAJOR_VERSION=$(echo __GNUC__ | ${FC} -E -xc - | tail -n 1)
if [ ${FORTRAN_MAJOR_VERSION} > 9 ]; then
CONFOPTS="${CONFOPTS} \
-D CMAKE_Fortran_FLAGS='-fPIC -g -O3 -fallow-argument-mismatch' "
else
CONFOPTS="${CONFOPTS} \
-D CMAKE_Fortran_FLAGS='-fPIC -g -O3' "
fi
fi


# Set C flags
CONFOPTS="${CONFOPTS} \
-D CMAKE_C_FLAGS:STRING='-fPIC -g -O3 ' \
-D CMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"
CONFOPTS="${CONFOPTS} -D CMAKE_C_FLAGS:STRING='-fPIC -g -O3 ' "

CONFOPTS="${CONFOPTS} -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 [ -n "${BLAS_DIR}" ]; then
cecho ${INFO} "ScaLAPACK: configuration with BLAS_DIR=${BLAS_DIR}"
CONFOPTS="${CONFOPTS} -D BLAS_LIBRARY_DIRS:STRING=${BLAS_DIR}"
fi

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
if [ -n "${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

# BLACS is provided by ScaLAPACK

# TODO: check if */lib is useful and consider specific_conf
#
# 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
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

echo "export SCALAPACK_DIR=${INSTALL_PATH}" >> $CONFIG_FILE
}