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?
This commit is contained in:
parent
ae3178f4eb
commit
d6f0cb0461
116
var/spack/repos/builtin/packages/hypre/detect-compiler.patch
Normal file
116
var/spack/repos/builtin/packages/hypre/detect-compiler.patch
Normal file
@ -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
|
@ -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.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('superlu-dist-link-2.14.0.patch', when='+superlu-dist @:2.14.0')
|
||||||
patch('hypre21800-compat.patch', when='@2.18.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("mpi", when='+mpi')
|
||||||
depends_on("blas")
|
depends_on("blas")
|
||||||
|
Loading…
Reference in New Issue
Block a user