summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/relion/0002-Simple-patch-to-fix-intel-mkl-linking.patch31
-rw-r--r--var/spack/repos/builtin/packages/relion/package.py2
2 files changed, 33 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/relion/0002-Simple-patch-to-fix-intel-mkl-linking.patch b/var/spack/repos/builtin/packages/relion/0002-Simple-patch-to-fix-intel-mkl-linking.patch
new file mode 100644
index 0000000000..6c2e036e4b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/relion/0002-Simple-patch-to-fix-intel-mkl-linking.patch
@@ -0,0 +1,31 @@
+From 0448e229d5c38d00e8a4b9f7081a862e966f8c17 Mon Sep 17 00:00:00 2001
+From: Evan Bollig <ebbollig@amazon.com>
+Date: Tue, 9 Feb 2021 09:48:13 -0600
+Subject: [PATCH] Simple patch to fix intel mkl linking
+
+---
+ src/apps/CMakeLists.txt | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt
+index 9f23f797..b26d373d 100644
+--- a/src/apps/CMakeLists.txt
++++ b/src/apps/CMakeLists.txt
+@@ -212,6 +212,14 @@ foreach (_target ${RELION_TARGETS})
+ target_link_libraries(${_target} ${LIB} ${EXTRA_LIBS} ${MPI_LIBRARIES} ${CMAKE_DL_LIBS})
+ else()
+ target_link_libraries(${_target} ${LIB} ${FFTW_LIBRARIES} ${EXTRA_LIBS} ${MPI_LIBRARIES} ${CMAKE_DL_LIBS})
++ # Intel MKL needs to be last in the list
++ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
++ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp -mkl -limf ")
++ #target_link_libraries(${_target} "fopenmp" "mkl" "imf")
++ else()
++ #SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential ")
++ target_link_libraries(${_target} "mkl_intel_ilp64" "mkl_core" "mkl_sequential")
++ endif()
+ endif(NOT MKLFFT)
+
+ if(CUDA_FOUND)
+--
+2.25.1
+
diff --git a/var/spack/repos/builtin/packages/relion/package.py b/var/spack/repos/builtin/packages/relion/package.py
index a2799782f7..5c8a455e86 100644
--- a/var/spack/repos/builtin/packages/relion/package.py
+++ b/var/spack/repos/builtin/packages/relion/package.py
@@ -53,6 +53,8 @@ class Relion(CMakePackage, CudaPackage):
depends_on('tbb', when='~cuda')
depends_on('mkl', when='~cuda +mklfft')
+ patch('0002-Simple-patch-to-fix-intel-mkl-linking.patch', when='@:3.1.1 os=ubuntu18.04')
+
def cmake_args(self):
carch = self.spec.variants['cuda_arch'].value[0]