summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorserbanmaerean <serban@us.ibm.com>2017-02-17 18:51:10 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2017-02-17 15:51:10 -0800
commit0d22b3eea9e7adc4af999c96f1e92f38ce998351 (patch)
tree7e3e6a1074eb01d070ce72db8ce0b9de063d5ca0 /var
parent5c37c17173d343cf75d27f7105064f183a365761 (diff)
downloadspack-0d22b3eea9e7adc4af999c96f1e92f38ce998351.tar.gz
spack-0d22b3eea9e7adc4af999c96f1e92f38ce998351.tar.bz2
spack-0d22b3eea9e7adc4af999c96f1e92f38ce998351.tar.xz
spack-0d22b3eea9e7adc4af999c96f1e92f38ce998351.zip
netlib-lapack: Update package file for netlib-lapack to work with IBM (#3040)
Update package file for netlib-lapack to work with IBM XL compiler The flag -qzerosize is redundant, as the IBM XL compiler should set this flag by default. However, at this time the default flag appears to be ignore. Hence, I am setting it in the package file as well, as it has no negative effect if set twice.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/netlib-lapack/ibm-xl.patch16
-rw-r--r--var/spack/repos/builtin/packages/netlib-lapack/package.py12
2 files changed, 27 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/netlib-lapack/ibm-xl.patch b/var/spack/repos/builtin/packages/netlib-lapack/ibm-xl.patch
new file mode 100644
index 0000000000..c9598a4e7c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/netlib-lapack/ibm-xl.patch
@@ -0,0 +1,16 @@
+diff -Naur lapack-3.6.1/CMAKE/CheckLAPACKCompilerFlags.cmake lapack-3.6.1-patched/CMAKE/CheckLAPACKCompilerFlags.cmake
+--- lapack-3.6.1/CMAKE/CheckLAPACKCompilerFlags.cmake 2017-01-27 17:14:37.414854283 -0500
++++ lapack-3.6.1-patched/CMAKE/CheckLAPACKCompilerFlags.cmake 2017-01-27 17:14:24.754719546 -0500
+@@ -43,12 +43,6 @@
+ if( "${CMAKE_Fortran_FLAGS}" MATCHES "-qflttrap=[a-zA-Z:]:enable" )
+ set( FPE_EXIT TRUE )
+ endif()
+-
+- if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-qfixed") )
+- message( STATUS "Enabling fixed format F90/F95 with -qfixed" )
+- set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qfixed"
+- CACHE STRING "Flags for Fortran compiler." FORCE )
+- endif()
+
+ # HP Fortran
+ elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "HP" )
diff --git a/var/spack/repos/builtin/packages/netlib-lapack/package.py b/var/spack/repos/builtin/packages/netlib-lapack/package.py
index 4b03259cbd..ee011e7d1b 100644
--- a/var/spack/repos/builtin/packages/netlib-lapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-lapack/package.py
@@ -52,6 +52,9 @@ class NetlibLapack(Package):
variant('lapacke', default=True,
description='Activates the build of the LAPACKE C interface')
+ patch('ibm-xl.patch', when='@3:6%xl')
+ patch('ibm-xl.patch', when='@3:6%xl_r')
+
# virtual dependency
provides('blas', when='~external-blas')
provides('lapack')
@@ -96,7 +99,14 @@ class NetlibLapack(Package):
cmake_args.extend(['-DCBLAS=OFF'])
cmake_args.extend(['-DLAPACKE:BOOL=OFF'])
- # deprecated routines are commonly need by, for example, suitesparse
+ if self.compiler.name == 'xl' or self.compiler.name == 'xl_r':
+ # use F77 compiler if IBM XL
+ cmake_args.extend([
+ '-DCMAKE_Fortran_COMPILER=%s' % self.compiler.f77,
+ '-DCMAKE_Fortran_FLAGS=-qzerosize'
+ ])
+
+ # deprecated routines are commonly needed by, for example, suitesparse
# Note that OpenBLAS spack is built with deprecated routines
cmake_args.extend(['-DBUILD_DEPRECATED:BOOL=ON'])