From 8c165494f2767ddce7b8c44bfd4138dcb38b73ad Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Sun, 24 Mar 2019 22:16:47 -0500 Subject: hypre: add superlu-dist variant (#10985) - add a patch to fix build error with superlu-dist --- var/spack/repos/builtin/packages/hypre/package.py | 11 +++++++++++ .../repos/builtin/packages/hypre/superlu-dist-link.patch | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 var/spack/repos/builtin/packages/hypre/superlu-dist-link.patch diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index 9b4bc958c4..286d7b20ad 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -38,6 +38,8 @@ class Hypre(Package): # SuperluDist have conflicting headers with those in Hypre variant('internal-superlu', default=True, description="Use internal Superlu routines") + variant('superlu-dist', default=True, + description='Activates support for SuperluDist') variant('int64', default=False, description="Use 64bit integers") variant('mpi', default=True, description='Enable MPI support') @@ -50,10 +52,12 @@ class Hypre(Package): # Patch to build shared libraries on Darwin patch('darwin-shared-libs-for-hypre-2.13.0.patch', when='+shared@2.13.0 platform=darwin') patch('darwin-shared-libs-for-hypre-2.14.0.patch', when='+shared@2.14.0 platform=darwin') + patch('superlu-dist-link.patch') depends_on("mpi", when='+mpi') depends_on("blas") depends_on("lapack") + depends_on('superlu-dist', when='+superlu-dist+mpi') # Patch to build shared libraries on Darwin does not apply to # versions before 2.13.0 @@ -100,6 +104,13 @@ class Hypre(Package): configure_args.append("--without-mli") configure_args.append("--without-fei") + if 'superlu-dist' in self.spec: + configure_args.append('--with-dsuperlu-include=%s' % + spec['superlu-dist'].prefix.include) + configure_args.append('--with-dsuperlu-lib=%s' % + spec['superlu-dist'].libs) + configure_args.append('--with-dsuperlu') + if '+debug' in self.spec: configure_args.append("--enable-debug") else: diff --git a/var/spack/repos/builtin/packages/hypre/superlu-dist-link.patch b/var/spack/repos/builtin/packages/hypre/superlu-dist-link.patch new file mode 100644 index 0000000000..a2cc930f2d --- /dev/null +++ b/var/spack/repos/builtin/packages/hypre/superlu-dist-link.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/Makefile b/src/lib/Makefile +index f49d1683..615947b0 100644 +--- a/src/lib/Makefile ++++ b/src/lib/Makefile +@@ -58,7 +58,7 @@ $(BLASFILES)\ + $(LAPACKFILES) + + SONAME = libHYPRE-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} +-SOLIBS = ${MPILIBDIRS} ${MPILIBS} ${LAPACKLIBDIRS} ${LAPACKLIBS}\ ++SOLIBS = ${DSUPERLU_LIBS} ${MPILIBDIRS} ${MPILIBS} ${LAPACKLIBDIRS} ${LAPACKLIBS}\ + ${BLASLIBDIRS} ${BLASLIBS} ${LIBS} ${FLIBS} + + -- cgit v1.2.3-60-g2f50