diff options
author | Ricardo Silva <ricardo.silva@epfl.ch> | 2019-08-10 04:38:16 +0200 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2019-08-09 21:38:16 -0500 |
commit | c5849ce04f34c359b8a14780b3239c30073b53f0 (patch) | |
tree | b0165e703304a25243accf61117628530ba5ce0a | |
parent | 7cc57d74e4c81815dd56c466fce54e1be084ba49 (diff) | |
download | spack-c5849ce04f34c359b8a14780b3239c30073b53f0.tar.gz spack-c5849ce04f34c359b8a14780b3239c30073b53f0.tar.bz2 spack-c5849ce04f34c359b8a14780b3239c30073b53f0.tar.xz spack-c5849ce04f34c359b8a14780b3239c30073b53f0.zip |
gromacs: fix CPU optimizations detection (simd=auto) (#12354)
* SL-637
* https://redmine.gromacs.org/issues/2927
* tested with cmake 3.14.4 and 3.15.1
-rw-r--r-- | var/spack/repos/builtin/packages/gromacs/gmxDetectCpu-cmake-3.14.patch | 12 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/gromacs/package.py | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gromacs/gmxDetectCpu-cmake-3.14.patch b/var/spack/repos/builtin/packages/gromacs/gmxDetectCpu-cmake-3.14.patch new file mode 100644 index 0000000000..bd262bee5e --- /dev/null +++ b/var/spack/repos/builtin/packages/gromacs/gmxDetectCpu-cmake-3.14.patch @@ -0,0 +1,12 @@ +/cmake/gmxDetectCpu.cmake ++++ b/cmake/gmxDetectCpu.cmake +@@ -83,7 +83,7 @@ function(gmx_run_cpu_detection TYPE) + set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=0") + endif() + +- set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${PROJECT_SOURCE_DIR}/src -DGMX_CPUINFO_STANDALONE ${GMX_STDLIB_CXX_FLAGS} -DGMX_TARGET_X86=${GMX_TARGET_X86_VALUE}") ++ set(_compile_definitions ${GCC_INLINE_ASM_DEFINE} -I${PROJECT_SOURCE_DIR}/src -DGMX_CPUINFO_STANDALONE ${GMX_STDLIB_CXX_FLAGS} -DGMX_TARGET_X86=${GMX_TARGET_X86_VALUE}) + set(LINK_LIBRARIES "${GMX_STDLIB_LIBRARIES}") + try_compile(CPU_DETECTION_COMPILED + "${PROJECT_BINARY_DIR}" + diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index 2aedf025e4..51f7830207 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -74,6 +74,8 @@ class Gromacs(CMakePackage): depends_on('cmake@3.4.3:3.99.99', type='build', when='@2018:') depends_on('cuda', when='+cuda') + patch('gmxDetectCpu-cmake-3.14.patch', when='^cmake@3.14.0:') + def patch(self): if '+plumed' in self.spec: self.spec['plumed'].package.apply_patch(self) |