summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToyohisa Kameyama <kameyama@riken.jp>2019-08-06 10:04:16 +0900
committerPeter Scheibel <scheibel1@llnl.gov>2019-08-05 18:04:16 -0700
commit567cef7ae3e9e744b8b9654a86ea9e863ccc75f9 (patch)
treec0e8dbcf396bc34c2daded1b2e1dcd1c377442bc
parent2e14cdb8fd8fc4f681c5ec7b63142bd319eab2ad (diff)
downloadspack-567cef7ae3e9e744b8b9654a86ea9e863ccc75f9.tar.gz
spack-567cef7ae3e9e744b8b9654a86ea9e863ccc75f9.tar.bz2
spack-567cef7ae3e9e744b8b9654a86ea9e863ccc75f9.tar.xz
spack-567cef7ae3e9e744b8b9654a86ea9e863ccc75f9.zip
c-blosc package: Add -std=gnu99 flag for gcc (#11959)
When building with GCC, c-blosc requires the -std=gnu99 flag. Before this patch, the build would only add -std=gnu99 for GCC when building on specific architectures; this adds -std=gnu99 in all cases when using GCC.
-rwxr-xr-xvar/spack/repos/builtin/packages/c-blosc/gcc.patch23
-rw-r--r--var/spack/repos/builtin/packages/c-blosc/package.py1
2 files changed, 24 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/c-blosc/gcc.patch b/var/spack/repos/builtin/packages/c-blosc/gcc.patch
new file mode 100755
index 0000000000..8390b01e3d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/c-blosc/gcc.patch
@@ -0,0 +1,23 @@
+diff -u c-blosc-1.16.3/CMakeLists.txt c-blosc-1.16.3.mod/CMakeLists.txt
+--- c-blosc-1.16.3/CMakeLists.txt 2019-03-08 21:38:45.000000000 +0900
++++ c-blosc-1.16.3.mod/CMakeLists.txt 2019-07-08 18:47:00.660334280 +0900
+@@ -197,6 +197,10 @@
+ set(CMAKE_MACOSX_RPATH TRUE)
+ endif()
+
++if(CMAKE_C_COMPILER_ID STREQUAL GNU)
++ # We need C99 (GNU99 more exactly)
++ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
++endif()
+ # Based on the target system's processor and the compiler being used,
+ # set build variables indicating which hardware features can be targeted
+ # by the compiler. Note we DO NOT check which hardware features are supported
+@@ -209,8 +213,6 @@
+ CMAKE_SYSTEM_PROCESSOR STREQUAL amd64 OR
+ CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)
+ if(CMAKE_C_COMPILER_ID STREQUAL GNU)
+- # We need C99 (GNU99 more exactly)
+- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
+ set(COMPILER_SUPPORT_SSE2 TRUE)
+ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.7 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.7)
+ set(COMPILER_SUPPORT_AVX2 TRUE)
diff --git a/var/spack/repos/builtin/packages/c-blosc/package.py b/var/spack/repos/builtin/packages/c-blosc/package.py
index c8a8a0cc14..da22f4ff17 100644
--- a/var/spack/repos/builtin/packages/c-blosc/package.py
+++ b/var/spack/repos/builtin/packages/c-blosc/package.py
@@ -33,6 +33,7 @@ class CBlosc(CMakePackage):
depends_on('zstd')
depends_on('lz4')
+ patch('gcc.patch', when="@1.12.1:1.17.0")
patch('test_forksafe.patch', when='@1.15.0:1.17.0%intel')
def cmake_args(self):