summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Silva <ricardo.silva@epfl.ch>2019-08-14 02:21:59 +0200
committerAdam J. Stewart <ajstewart426@gmail.com>2019-08-13 19:21:59 -0500
commit5116312ca231ba05666055768a351399aed60a3b (patch)
tree352b09d6abfde2c289c15971f2e3d8950c082473
parent5429713eef6b1cb8e51e8f6ba9083d4272ddcba6 (diff)
downloadspack-5116312ca231ba05666055768a351399aed60a3b.tar.gz
spack-5116312ca231ba05666055768a351399aed60a3b.tar.bz2
spack-5116312ca231ba05666055768a351399aed60a3b.tar.xz
spack-5116312ca231ba05666055768a351399aed60a3b.zip
package/gromacs: simd optimizations autodetection for more versions (#12402)
* gromacs: fix simd detection for pre 2018 versions * pre 2018 the cmake file was named differently * fixed up post 2018 patch file which was non pretty * Trim patch
-rw-r--r--var/spack/repos/builtin/packages/gromacs/gmxDetectCpu-cmake-3.14.patch2
-rw-r--r--var/spack/repos/builtin/packages/gromacs/gmxDetectSimd-cmake-3.14.patch11
-rw-r--r--var/spack/repos/builtin/packages/gromacs/package.py3
3 files changed, 14 insertions, 2 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
index bd262bee5e..2f94a6a99e 100644
--- a/var/spack/repos/builtin/packages/gromacs/gmxDetectCpu-cmake-3.14.patch
+++ b/var/spack/repos/builtin/packages/gromacs/gmxDetectCpu-cmake-3.14.patch
@@ -1,4 +1,4 @@
-/cmake/gmxDetectCpu.cmake
+--- a/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")
diff --git a/var/spack/repos/builtin/packages/gromacs/gmxDetectSimd-cmake-3.14.patch b/var/spack/repos/builtin/packages/gromacs/gmxDetectSimd-cmake-3.14.patch
new file mode 100644
index 0000000000..f30ec78a7a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gromacs/gmxDetectSimd-cmake-3.14.patch
@@ -0,0 +1,11 @@
+--- a/cmake/gmxDetectSimd.cmake
++++ b/cmake/gmxDetectSimd.cmake
+@@ -77,7 +77,7 @@ function(gmx_suggest_simd _suggested_simd)
+ else()
+ set(GMX_TARGET_X86_VALUE 0)
+ endif()
+- set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_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${CMAKE_SOURCE_DIR}/src -DGMX_CPUINFO_STANDALONE ${GMX_STDLIB_CXX_FLAGS} -DGMX_TARGET_X86=${GMX_TARGET_X86_VALUE})
+
+ # Prepare a default suggestion
+ set(OUTPUT_SIMD "None")
diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py
index 51f7830207..eb08c0393b 100644
--- a/var/spack/repos/builtin/packages/gromacs/package.py
+++ b/var/spack/repos/builtin/packages/gromacs/package.py
@@ -74,7 +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:')
+ patch('gmxDetectCpu-cmake-3.14.patch', when='@2018:^cmake@3.14.0:')
+ patch('gmxDetectSimd-cmake-3.14.patch', when='@:2017.99^cmake@3.14.0:')
def patch(self):
if '+plumed' in self.spec: