summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorQuellynSnead <quellyn@lanl.gov>2021-09-08 02:09:12 -0600
committerGitHub <noreply@github.com>2021-09-08 04:09:12 -0400
commita86279cc527e12d125f325dade21cd0ee9eb1907 (patch)
treee36f600823e0b9a1fb799fc55eb55e55a9b7d80d /var
parentfd111a33950e57ee96ee8a85cf45a6e1f9de51bd (diff)
downloadspack-a86279cc527e12d125f325dade21cd0ee9eb1907.tar.gz
spack-a86279cc527e12d125f325dade21cd0ee9eb1907.tar.bz2
spack-a86279cc527e12d125f325dade21cd0ee9eb1907.tar.xz
spack-a86279cc527e12d125f325dade21cd0ee9eb1907.zip
netlib-lapack: Fixes for IBM XL builds (#25793)
netlib-lapack: Version 3.9.0 and above no longer builds with the IBM XL compiler (#25447). Ported some fixes from the old ibm-xl.patch and added logic for detection of XL's -qrecur flag.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/netlib-lapack/ibm-xl-3.9.1.patch94
-rw-r--r--var/spack/repos/builtin/packages/netlib-lapack/package.py7
2 files changed, 99 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/netlib-lapack/ibm-xl-3.9.1.patch b/var/spack/repos/builtin/packages/netlib-lapack/ibm-xl-3.9.1.patch
new file mode 100644
index 0000000000..38f4e9c41f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/netlib-lapack/ibm-xl-3.9.1.patch
@@ -0,0 +1,94 @@
+diff -Naur a/CBLAS/CMakeLists.txt b/CBLAS/CMakeLists.txt
+--- a/CBLAS/CMakeLists.txt 2021-03-25 12:25:15.000000000 -0600
++++ b/CBLAS/CMakeLists.txt 2021-09-01 16:27:23.561355382 -0600
+@@ -11,9 +11,7 @@
+ MACRO_NAMESPACE "F77_"
+ SYMBOL_NAMESPACE "F77_")
+ if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
+- message(WARNING "Reverting to pre-defined include/lapacke_mangling.h")
+- configure_file(include/lapacke_mangling_with_flags.h.in
+- ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h)
++ message(WARNING "Reverting to pre-defined include/cblas_mangling.h")
+ configure_file(include/cblas_mangling_with_flags.h.in
+ ${LAPACK_BINARY_DIR}/include/cblas_mangling.h)
+ endif()
+diff -Naur a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2021-03-25 12:25:15.000000000 -0600
++++ b/CMakeLists.txt 2021-09-02 09:49:18.070436958 -0600
+@@ -94,16 +94,22 @@
+
+ # Check if recursive flag exists
+ include(CheckFortranCompilerFlag)
+-check_fortran_compiler_flag("-recursive" _recursiveFlag)
+-check_fortran_compiler_flag("-frecursive" _frecursiveFlag)
+-check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
++if(CMAKE_Fortran_COMPILER_ID STREQUAL Flang)
++ check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
++elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
++ check_fortran_compiler_flag("-frecursive" _frecursiveFlag)
++elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
++ check_fortran_compiler_flag("-recursive" _recursiveFlag)
++elseif(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
++ check_fortran_compiler_flag("-qrecur" _qrecurFlag)
++endif()
+
+ # Add recursive flag
+-if(_recursiveFlag)
+- string(REGEX MATCH "-recursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
++if(_MrecursiveFlag)
++ string(REGEX MATCH "-Mrecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
+ if(NOT output_test)
+- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive"
+- CACHE STRING "Recursive flag must be set" FORCE)
++ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive"
++ CACHE STRING "Recursive flag must be set" FORCE)
+ endif()
+ elseif(_frecursiveFlag)
+ string(REGEX MATCH "-frecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
+@@ -111,11 +117,17 @@
+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive"
+ CACHE STRING "Recursive flag must be set" FORCE)
+ endif()
+-elseif(_MrecursiveFlag)
+- string(REGEX MATCH "-Mrecursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
++elseif(_recursiveFlag)
++ string(REGEX MATCH "-recursive" output_test <string> "${CMAKE_Fortran_FLAGS}")
+ if(NOT output_test)
+- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive"
+- CACHE STRING "Recursive flag must be set" FORCE)
++ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive"
++ CACHE STRING "Recursive flag must be set" FORCE)
++ endif()
++elseif(_qrecurFlag)
++ string(REGEX MATCH "-qrecur" output_test <string> "${CMAKE_Fortran_FLAGS}")
++ if(NOT output_test)
++ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qrecur"
++ CACHE STRING "Recursive flag must be set" FORCE)
+ endif()
+ endif()
+
+@@ -124,7 +136,7 @@
+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict")
+ endif()
+ if(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
+- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave -qstrict=none")
++ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave -qstrict")
+ endif()
+ # Delete libmtsk in linking sequence for Sun/Oracle Fortran Compiler.
+ # This library is not present in the Sun package SolarisStudio12.3-linux-x86-bin
+diff -Naur a/INSTALL/make.inc.XLF b/INSTALL/make.inc.XLF
+--- a/INSTALL/make.inc.XLF 2021-03-25 12:25:15.000000000 -0600
++++ b/INSTALL/make.inc.XLF 2021-09-02 09:50:02.664646455 -0600
+@@ -14,10 +14,10 @@
+ # the compiler options desired when NO OPTIMIZATION is selected.
+ #
+ FC = xlf
+-FFLAGS = -O3 -qfixed -qnosave
++FFLAGS = -O3 -qfixed -qnosave -qrecur
+ # For -O2, add -qstrict=none
+ FFLAGS_DRV = $(FFLAGS)
+-FFLAGS_NOOPT = -O0 -qfixed -qnosave
++FFLAGS_NOOPT = -O0 -qfixed -qnosave -qrecur
+
+ # Define LDFLAGS to the desired linker options for your machine.
+ #
diff --git a/var/spack/repos/builtin/packages/netlib-lapack/package.py b/var/spack/repos/builtin/packages/netlib-lapack/package.py
index 92ada1ba05..c47d33eb84 100644
--- a/var/spack/repos/builtin/packages/netlib-lapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-lapack/package.py
@@ -42,10 +42,13 @@ class NetlibLapack(CMakePackage):
variant('xblas', default=False,
description='Builds extended precision routines using XBLAS')
- patch('ibm-xl.patch', when='@3.7: %xl')
- patch('ibm-xl.patch', when='@3.7: %xl_r')
+ patch('ibm-xl.patch', when='@3.7:3.8 %xl')
+ patch('ibm-xl.patch', when='@3.7:3.8 %xl_r')
patch('ibm-xl.patch', when='@3.7: %cce@9:')
+ patch('ibm-xl-3.9.1.patch', when='@3.9.1 %xl')
+ patch('ibm-xl-3.9.1.patch', when='@3.9.1 %xl_r')
+
# https://github.com/Reference-LAPACK/lapack/issues/228
patch('undefined_declarations.patch', when='@3.8.0:3.8.9999')