From f756ae9eb35aa9074346eaf5a26b4fb0a5726f49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20K=C3=B6cher?= Date: Thu, 10 Jul 2014 15:52:04 +0200 Subject: [PATCH] deal.II: Added SuperLUDist support for Trilinos/Amesos --- deal.II/packages/parmetis.package | 21 +++++ deal.II/packages/superlu_dist.package | 82 +++++++++++++++++++ deal.II/packages/trilinos.package | 12 ++- deal.II/patches/Amesos_Superludist.cpp.patch | 7 ++ deal.II/platforms/supported/centos7.platform | 2 + deal.II/platforms/supported/fedora19.platform | 2 + deal.II/platforms/supported/fedora20.platform | 2 + .../platforms/supported/opensuse12.platform | 2 + .../platforms/supported/opensuse13.platform | 2 + deal.II/platforms/supported/rhel6.platform | 2 + deal.II/platforms/supported/rhel7.platform | 2 + deal.II/platforms/supported/ubuntu13.platform | 2 + deal.II/platforms/supported/ubuntu14.platform | 2 + 13 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 deal.II/packages/parmetis.package create mode 100644 deal.II/packages/superlu_dist.package create mode 100644 deal.II/patches/Amesos_Superludist.cpp.patch diff --git a/deal.II/packages/parmetis.package b/deal.II/packages/parmetis.package new file mode 100644 index 0000000..4612387 --- /dev/null +++ b/deal.II/packages/parmetis.package @@ -0,0 +1,21 @@ +NAME=parmetis-4.0.3 +SOURCE=http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/ +PACKING=.tar.gz +CHECKSUM=f69c479586bf6bb7aff6a9bc0c739628 +BUILDCHAIN=custom + +package_specific_build() { + cp -rf ${UNPACK_PATH}/${EXTRACTSTO}/* . + cd metis + make config prefix=${INSTALL_PATH} shared=1 + make -j ${PROCS} + make install + cd .. + make config prefix=${INSTALL_PATH} shared=1 + make -j ${PROCS} + make install +} + +package_specific_register () { + export PARMETIS_DIR=${INSTALL_PATH} +} diff --git a/deal.II/packages/superlu_dist.package b/deal.II/packages/superlu_dist.package new file mode 100644 index 0000000..24dc635 --- /dev/null +++ b/deal.II/packages/superlu_dist.package @@ -0,0 +1,82 @@ +VERSION=3.3 +NAME=superlu_dist_${VERSION} +EXTRACTSTO=SuperLU_DIST_${VERSION} +SOURCE=http://crd-legacy.lbl.gov/~xiaoye/SuperLU/ +PACKING=.tar.gz +CHECKSUM=f4805659157d93a962500902c219046b +#1d77f10a265f5751d4e4b59317d778f8 superlu_dist_3.0.tar.gz +#5b114d6f97d9e94d643f51bb3c6cf03f superlu_dist_3.1.tar.gz +#b67bab5bb1ee92d38ad6c345b3c2b18d superlu_dist_3.2.tar.gz +#f4805659157d93a962500902c219046b superlu_dist_3.3.tar.gz +BUILDCHAIN=custom + +package_specific_build() { + cp -rf ${UNPACK_PATH}/${EXTRACTSTO}/* . + mv make.inc make.inc.bak + #create make.inc +echo "# The machine (platform) identifier to append to the library names +# +PLAT = _x86_64 + +# +# The name of the libraries to be created/linked to +# +DSuperLUroot = ${INSTALL_PATH} +DSUPERLULIB = \$(DSuperLUroot)/lib/libsuperlu_dist_${VERSION}.a + +# +BLASDEF = -DUSE_VENDOR_BLAS +BLASLIB = -lblas + +## parmetis 4.x.x +METISLIB = -L${PARMETIS_DIR}/lib -lmetis +PARMETISLIB = -L${PARMETIS_DIR}/lib -lparmetis + +# Define the required Fortran libraries, if you use C compiler to link +#FLIBS = -lpgf90 -lpgf90_rpm1 + +# Define all the libraries +LIBS = \$(DSUPERLULIB) \$(BLASLIB) \$(PARMETISLIB) \$(METISLIB) \$(FLIBS) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +############################################################################ +# C compiler setup +# CFLAGS should be set to be the C flags that include optimization +CFLAGS = -fPIC -DDEBUGlevel=0 -DPRNTlevel=1 -DPROFlevel=0 +# +# NOOPTS should be set to be the C flags that turn off any optimization +NOOPTS = -fPIC -O0 +############################################################################ +# FORTRAN compiler setup +FORTRAN = \$(FC) +#F90FLAGS = -fast -Mipa=fast,safe +############################################################################ +LOADER = \$(CC) +#LOADOPTS = -fast +############################################################################ +# C preprocessor defs for compilation (-DNoChange, -DAdd_, or -DUpCase) +# +# Need follow the convention of how C calls a Fortran routine. +# +CDEFS = -DAdd_ +" >> make.inc + + # now compile superlu_dist + make superlulib + rm -f ${INSTALL_PATH}/lib/libsuperlu_dist.a + ln -s ${INSTALL_PATH}/lib/libsuperlu_dist_${VERSION}.a ${INSTALL_PATH}/lib/libsuperlu_dist.a + mkdir -p ${INSTALL_PATH}/include/superlu + cp SRC/*.h ${INSTALL_PATH}/include/superlu +} + +package_specific_register () { + export SUPERLU_DIR=${INSTALL_PATH} +} + diff --git a/deal.II/packages/trilinos.package b/deal.II/packages/trilinos.package index 4b7e3e2..476c5e8 100644 --- a/deal.II/packages/trilinos.package +++ b/deal.II/packages/trilinos.package @@ -7,10 +7,14 @@ BUILDCHAIN=cmake CONFOPTS="-D Trilinos_ENABLE_OpenMP:BOOL=OFF \ -D TPL_ENABLE_TBB:BOOL=OFF \ - -D Trilinos_ENABLE_OPTIONAL_PACKAGES:BOOL=ON \ -D Trilinos_ENABLE_Didasko:BOOL=ON \ -D Trilinos_ENABLE_Sacado:BOOL=ON \ -D Trilinos_ENABLE_Stratimikos:BOOL=ON \ + -D TPL_ENABLE_ParMETIS:BOOL=ON \ + -D TPL_ParMETIS_LIBRARIES:FILEPATH=${INSTALL_PATH}/lib/libparmetis.so \ + -D TPL_ENABLE_SuperLUDist:BOOL=ON \ + -D TPL_SuperLUDist_LIBRARIES:FILEPATH=${INSTALL_PATH}/lib/libsuperlu_dist_3.3.a \ + -D SuperLUDist_INCLUDE_DIRS:PATH=${INSTALL_PATH}/include/superlu \ -D CMAKE_BUILD_TYPE:STRING=RELEASE \ -D CMAKE_CXX_FLAGS:STRING=-fPIC -g -O3 \ -D CMAKE_C_FLAGS:STRING=-fPIC -g -O3 \ @@ -21,6 +25,12 @@ CONFOPTS="-D Trilinos_ENABLE_OpenMP:BOOL=OFF \ -D TPL_ENABLE_MPI:BOOL=ON \ -D BUILD_SHARED_LIBS:BOOL=ON" +package_specific_setup() { + # Apply patch to let Trilinos/Amesos work with SuperLUDist_3.3 + cd ${UNPACK_PATH}/${EXTRACTSTO}/packages/amesos/src + patch Amesos_Superludist.cpp < ${ORIG_DIR}/${PROJECT}/patches/Amesos_Superludist.cpp.patch +} + package_specific_register () { export TRILINOS_DIR=${INSTALL_PATH} } diff --git a/deal.II/patches/Amesos_Superludist.cpp.patch b/deal.II/patches/Amesos_Superludist.cpp.patch new file mode 100644 index 0000000..7680945 --- /dev/null +++ b/deal.II/patches/Amesos_Superludist.cpp.patch @@ -0,0 +1,7 @@ +476,477c476,477 +< else if( IterRefine_ == "DOUBLE" ) PrivateSuperluData_->options_.IterRefine = DOUBLE; +< else if( IterRefine_ == "EXTRA" ) PrivateSuperluData_->options_.IterRefine = EXTRA; +--- +> else if( IterRefine_ == "DOUBLE" ) PrivateSuperluData_->options_.IterRefine = SLU_DOUBLE; +> else if( IterRefine_ == "EXTRA" ) PrivateSuperluData_->options_.IterRefine = SLU_EXTRA; + diff --git a/deal.II/platforms/supported/centos7.platform b/deal.II/platforms/supported/centos7.platform index c2bc611..641b7e5 100644 --- a/deal.II/platforms/supported/centos7.platform +++ b/deal.II/platforms/supported/centos7.platform @@ -19,6 +19,8 @@ # # Define the packages this platform needs PACKAGES=( +once:parmetis +once:superlu_dist once:hdf5 once:p4est once:trilinos diff --git a/deal.II/platforms/supported/fedora19.platform b/deal.II/platforms/supported/fedora19.platform index a672ad4..ae7257d 100644 --- a/deal.II/platforms/supported/fedora19.platform +++ b/deal.II/platforms/supported/fedora19.platform @@ -17,6 +17,8 @@ # Define the packages this platform needs PACKAGES=( #once:boost +once:parmetis +once:superlu_dist once:hdf5 once:p4est once:trilinos diff --git a/deal.II/platforms/supported/fedora20.platform b/deal.II/platforms/supported/fedora20.platform index 30caadd..bf49450 100644 --- a/deal.II/platforms/supported/fedora20.platform +++ b/deal.II/platforms/supported/fedora20.platform @@ -18,6 +18,8 @@ # Define the packages this platform needs PACKAGES=( #once:boost +once:parmetis +once:superlu_dist once:hdf5 once:p4est once:trilinos diff --git a/deal.II/platforms/supported/opensuse12.platform b/deal.II/platforms/supported/opensuse12.platform index 5e54364..fa62370 100644 --- a/deal.II/platforms/supported/opensuse12.platform +++ b/deal.II/platforms/supported/opensuse12.platform @@ -23,6 +23,8 @@ # Define the packages this platform needs PACKAGES=( #once:boost +once:parmetis +once:superlu_dist once:hdf5 once:p4est once:trilinos diff --git a/deal.II/platforms/supported/opensuse13.platform b/deal.II/platforms/supported/opensuse13.platform index a0ce565..95c15c5 100644 --- a/deal.II/platforms/supported/opensuse13.platform +++ b/deal.II/platforms/supported/opensuse13.platform @@ -18,6 +18,8 @@ # Define the packages this platform needs PACKAGES=( #once:boost +once:parmetis +once:superlu_dist once:hdf5 once:p4est once:trilinos diff --git a/deal.II/platforms/supported/rhel6.platform b/deal.II/platforms/supported/rhel6.platform index 29f38ea..82ce6f4 100644 --- a/deal.II/platforms/supported/rhel6.platform +++ b/deal.II/platforms/supported/rhel6.platform @@ -16,6 +16,8 @@ # # Define the packages this platform needs PACKAGES=( +once:parmetis +once:superlu_dist once:hdf5 once:p4est once:trilinos diff --git a/deal.II/platforms/supported/rhel7.platform b/deal.II/platforms/supported/rhel7.platform index 8379e34..9f45b42 100644 --- a/deal.II/platforms/supported/rhel7.platform +++ b/deal.II/platforms/supported/rhel7.platform @@ -16,6 +16,8 @@ # # Define the packages this platform needs PACKAGES=( +once:parmetis +once:superlu_dist once:hdf5 once:p4est once:trilinos diff --git a/deal.II/platforms/supported/ubuntu13.platform b/deal.II/platforms/supported/ubuntu13.platform index 616b88c..946f7f8 100644 --- a/deal.II/platforms/supported/ubuntu13.platform +++ b/deal.II/platforms/supported/ubuntu13.platform @@ -15,6 +15,8 @@ # Define the packages this platform needs PACKAGES=( #once:boost +once:parmetis +once:superlu_dist once:hdf5 once:p4est once:trilinos diff --git a/deal.II/platforms/supported/ubuntu14.platform b/deal.II/platforms/supported/ubuntu14.platform index a078ddc..8209eea 100644 --- a/deal.II/platforms/supported/ubuntu14.platform +++ b/deal.II/platforms/supported/ubuntu14.platform @@ -16,6 +16,8 @@ # Define the packages this platform needs PACKAGES=( #once:boost +once:parmetis +once:superlu_dist once:hdf5 once:p4est once:trilinos -- 2.39.5