From cc6d05578666797ebab03aa84488d55170d2f19d Mon Sep 17 00:00:00 2001 From: Evan Bollig Date: Tue, 9 Feb 2021 13:07:06 -0600 Subject: [PATCH] Relion 3.1.1 patch for Ubuntu18.04 (#21556) --- ...imple-patch-to-fix-intel-mkl-linking.patch | 31 +++++++++++++++++++ .../repos/builtin/packages/relion/package.py | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 var/spack/repos/builtin/packages/relion/0002-Simple-patch-to-fix-intel-mkl-linking.patch 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 +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]