summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorDavid M. Rogers <predictivestatmech@gmail.com>2020-10-30 15:55:21 -0400
committerGitHub <noreply@github.com>2020-10-30 14:55:21 -0500
commitd6f0cb04611737055d5caf91a5b0a9a5874d9952 (patch)
tree22c7226ca71f5e85ccc373698b3cf2ed34e84cce /var
parentae3178f4ebd083127aaba005b8f4505026a70dc0 (diff)
downloadspack-d6f0cb04611737055d5caf91a5b0a9a5874d9952.tar.gz
spack-d6f0cb04611737055d5caf91a5b0a9a5874d9952.tar.bz2
spack-d6f0cb04611737055d5caf91a5b0a9a5874d9952.tar.xz
spack-d6f0cb04611737055d5caf91a5b0a9a5874d9952.zip
Patched hypre to better add flags based on compiler. (#19498)
* Patched hypre to better add flags based on compiler. * Update package.py This file seems to have lots of edits, so the patch may succeed with offsets. Has anyone checked with spack patch to be sure it'll work with versions 2.15 - 2.20?
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hypre/detect-compiler.patch116
-rw-r--r--var/spack/repos/builtin/packages/hypre/package.py2
2 files changed, 118 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hypre/detect-compiler.patch b/var/spack/repos/builtin/packages/hypre/detect-compiler.patch
new file mode 100644
index 0000000000..a4f3b3cb89
--- /dev/null
+++ b/var/spack/repos/builtin/packages/hypre/detect-compiler.patch
@@ -0,0 +1,116 @@
+diff --git a/src/config/hypre_macros_misc.m4 b/src/config/hypre_macros_misc.m4
+index 2b9b19c92..14319b509 100644
+--- a/src/config/hypre_macros_misc.m4
++++ b/src/config/hypre_macros_misc.m4
+@@ -98,7 +98,7 @@ AC_DEFUN([AC_HYPRE_OPTIMIZATION_FLAGS],
+
+ if test "x${hypre_user_chose_cflags}" = "xno"
+ then
+- case "${CC}" in
++ case `basename "${CC}"` in
+ gcc|mpigcc|mpicc)
+ CFLAGS="-O2"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -138,7 +138,7 @@ fi
+
+ if test "x${hypre_user_chose_cxxflags}" = "xno"
+ then
+- case "${CXX}" in
++ case `basename "${CXX}"` in
+ g++|gCC|mpig++|mpicxx|mpic++|mpiCC)
+ CXXFLAGS="-O2"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -174,7 +174,7 @@ fi
+
+ if test "x${hypre_user_chose_fflags}" = "xno"
+ then
+- case "${FC}" in
++ case `basename "${FC}"` in
+ g77|gfortran|mpigfortran|mpif77)
+ FFLAGS="-O2"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -218,7 +218,7 @@ AC_DEFUN([AC_HYPRE_DEBUG_FLAGS],
+
+ if test "x${hypre_user_chose_cflags}" = "xno"
+ then
+- case "${CC}" in
++ case `basename "${CC}"` in
+ gcc|mpigcc|mpicc)
+ CFLAGS="-g -Wall"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -258,7 +258,7 @@ fi
+
+ if test "x${hypre_user_chose_cxxflags}" = "xno"
+ then
+- case "${CXX}" in
++ case `basename "${CXX}"` in
+ g++|gCC|mpig++|mpicxx|mpic++|mpiCC)
+ CXXFLAGS="-g -Wall"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -294,7 +294,7 @@ fi
+
+ if test "x${hypre_user_chose_fflags}" = "xno"
+ then
+- case "${FC}" in
++ case `basename "${FC}"` in
+ g77|gfortran|mpigfortran|mpif77)
+ FFLAGS="-g -Wall"
+ if test "$hypre_using_openmp" = "yes" ; then
+diff --git a/src/configure b/src/configure
+index dd7555b10..696b41132 100755
+--- a/src/configure
++++ b/src/configure
+@@ -7765,7 +7765,7 @@ then
+
+ if test "x${hypre_user_chose_cflags}" = "xno"
+ then
+- case "${CC}" in
++ case `basename "${CC}"` in
+ gcc|mpigcc|mpicc)
+ CFLAGS="-g -Wall"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -7805,7 +7805,7 @@ fi
+
+ if test "x${hypre_user_chose_cxxflags}" = "xno"
+ then
+- case "${CXX}" in
++ case `basename "${CXX}"` in
+ g++|gCC|mpig++|mpicxx|mpic++|mpiCC)
+ CXXFLAGS="-g -Wall"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -7841,7 +7841,7 @@ fi
+
+ if test "x${hypre_user_chose_fflags}" = "xno"
+ then
+- case "${FC}" in
++ case `basename "${FC}"` in
+ g77|gfortran|mpigfortran|mpif77)
+ FFLAGS="-g -Wall"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -7881,7 +7881,7 @@ else
+
+ if test "x${hypre_user_chose_cflags}" = "xno"
+ then
+- case "${CC}" in
++ case `basename "${CC}"` in
+ gcc|mpigcc|mpicc)
+ CFLAGS="-O2"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -7921,7 +7921,7 @@ fi
+
+ if test "x${hypre_user_chose_cxxflags}" = "xno"
+ then
+- case "${CXX}" in
++ case `basename "${CXX}"` in
+ g++|gCC|mpig++|mpicxx|mpic++|mpiCC)
+ CXXFLAGS="-O2"
+ if test "$hypre_using_openmp" = "yes" ; then
+@@ -7957,7 +7957,7 @@ fi
+
+ if test "x${hypre_user_chose_fflags}" = "xno"
+ then
+- case "${FC}" in
++ case `basename "${FC}"` in
+ g77|gfortran|mpigfortran|mpif77)
+ FFLAGS="-O2"
+ if test "$hypre_using_openmp" = "yes" ; then
diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py
index 8c0347fef9..da2b8a03ee 100644
--- a/var/spack/repos/builtin/packages/hypre/package.py
+++ b/var/spack/repos/builtin/packages/hypre/package.py
@@ -68,6 +68,8 @@ class Hypre(Package):
patch('superlu-dist-link-2.15.0.patch', when='+superlu-dist @2.15:2.16.0')
patch('superlu-dist-link-2.14.0.patch', when='+superlu-dist @:2.14.0')
patch('hypre21800-compat.patch', when='@2.18.0')
+ # Patch to get config flags right
+ patch('detect-compiler.patch', when='@2.15.0:2.20.0')
depends_on("mpi", when='+mpi')
depends_on("blas")