From 7f9acfa3b28d9a0acaada37ba61090a6b34bf879 Mon Sep 17 00:00:00 2001 From: Brian Van Essen Date: Fri, 28 Apr 2017 12:54:59 -0700 Subject: Various patches to Openblas for Intel (#4030) * Added a patch to the openblas package to change the openmp flag for icc to qopenmp. * Fixed a linking problem where when using Intel compilers, it was still pulling in -lgfortran --- .../packages/openblas/openblas_icc_fortran.patch | 12 ++++++++++ .../packages/openblas/openblas_icc_openmp.patch | 27 ++++++++++++++++++++++ .../repos/builtin/packages/openblas/package.py | 2 ++ 3 files changed, 41 insertions(+) create mode 100644 var/spack/repos/builtin/packages/openblas/openblas_icc_fortran.patch create mode 100644 var/spack/repos/builtin/packages/openblas/openblas_icc_openmp.patch diff --git a/var/spack/repos/builtin/packages/openblas/openblas_icc_fortran.patch b/var/spack/repos/builtin/packages/openblas/openblas_icc_fortran.patch new file mode 100644 index 0000000000..54b38a297e --- /dev/null +++ b/var/spack/repos/builtin/packages/openblas/openblas_icc_fortran.patch @@ -0,0 +1,12 @@ +diff -Naur a/f_check b/f_check +--- a/f_check 2017-04-27 23:16:41.496684722 -0700 ++++ b/f_check 2017-04-27 23:22:38.330563534 -0700 +@@ -322,7 +322,7 @@ + } + + if ($vendor eq "INTEL"){ +- $linker_a .= "-lgfortran" ++ $linker_a .= "-lifcore" + } + + open(MAKEFILE, ">> $makefile") || die "Can't append $makefile"; diff --git a/var/spack/repos/builtin/packages/openblas/openblas_icc_openmp.patch b/var/spack/repos/builtin/packages/openblas/openblas_icc_openmp.patch new file mode 100644 index 0000000000..f4f436c38e --- /dev/null +++ b/var/spack/repos/builtin/packages/openblas/openblas_icc_openmp.patch @@ -0,0 +1,27 @@ +diff -Naur a/Makefile.system b/Makefile.system +--- a/Makefile.system 2017-04-27 23:11:09.226514927 -0700 ++++ b/Makefile.system 2017-04-28 00:00:27.020649577 -0700 +@@ -415,7 +415,7 @@ + endif + + ifeq ($(C_COMPILER), INTEL) +-CCOMMON_OPT += -openmp ++CCOMMON_OPT += -qopenmp + endif + + ifeq ($(C_COMPILER), PGI) +@@ -639,13 +639,14 @@ + + ifeq ($(F_COMPILER), INTEL) + CCOMMON_OPT += -DF_INTERFACE_INTEL ++EXTRALIB += -lifcore + ifdef INTERFACE64 + ifneq ($(INTERFACE64), 0) + FCOMMON_OPT += -i8 + endif + endif + ifeq ($(USE_OPENMP), 1) +-FCOMMON_OPT += -openmp ++FCOMMON_OPT += -qopenmp + endif + endif diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 647cbb121a..81f4841931 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -56,6 +56,8 @@ class Openblas(MakefilePackage): # This patch is in a pull request to OpenBLAS that has not been handled # https://github.com/xianyi/OpenBLAS/pull/915 patch('openblas_icc.patch', when='%intel') + patch('openblas_icc_openmp.patch', when='%intel@16.0:') + patch('openblas_icc_fortran.patch', when='%intel@16.0:') # Change file comments to work around clang 3.9 assembler bug # https://github.com/xianyi/OpenBLAS/pull/982 -- cgit v1.2.3-60-g2f50