diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2020-02-12 16:21:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-12 16:21:43 -0500 |
commit | 90f3635afd5d4079631460535bcd8213945b0349 (patch) | |
tree | dded3a2a9d72de3a4b67d0b637d6b083688eeedb /var | |
parent | 7e50cec5a42b5dc9b1ae6ef9cacb1b73e6f155f2 (diff) | |
download | spack-90f3635afd5d4079631460535bcd8213945b0349.tar.gz spack-90f3635afd5d4079631460535bcd8213945b0349.tar.bz2 spack-90f3635afd5d4079631460535bcd8213945b0349.tar.xz spack-90f3635afd5d4079631460535bcd8213945b0349.zip |
protobuf: Fix intel compiler failures. (#14916)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/protobuf/intel-v1.patch (renamed from var/spack/repos/builtin/packages/protobuf/intel_inline.patch) | 0 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/protobuf/intel-v2.patch | 55 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/protobuf/package.py | 5 |
3 files changed, 59 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/protobuf/intel_inline.patch b/var/spack/repos/builtin/packages/protobuf/intel-v1.patch index 61f1334293..61f1334293 100644 --- a/var/spack/repos/builtin/packages/protobuf/intel_inline.patch +++ b/var/spack/repos/builtin/packages/protobuf/intel-v1.patch diff --git a/var/spack/repos/builtin/packages/protobuf/intel-v2.patch b/var/spack/repos/builtin/packages/protobuf/intel-v2.patch new file mode 100644 index 0000000000..4a3eb77339 --- /dev/null +++ b/var/spack/repos/builtin/packages/protobuf/intel-v2.patch @@ -0,0 +1,55 @@ +From 22f4f5422eddaac94750b268b7e6e305bd9cce5b Mon Sep 17 00:00:00 2001 +From: Chuck Atkins <chuck.atkins@kitware.com> +Date: Tue, 11 Feb 2020 10:21:44 -0500 +Subject: [PATCH 1/2] Intel compiler: ifdef out an incorrectly evaluated is_pod + type trait + +--- + src/google/protobuf/arena.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h +index d73b53c79f..3ecfe23c09 100644 +--- a/src/google/protobuf/arena.h ++++ b/src/google/protobuf/arena.h +@@ -338,8 +338,10 @@ class PROTOBUF_EXPORT alignas(8) Arena final { + template <typename T> + PROTOBUF_ALWAYS_INLINE static T* CreateArray(Arena* arena, + size_t num_elements) { ++#ifndef __INTEL_COMPILER // icc mis-evaluates some types as non-pod + static_assert(std::is_pod<T>::value, + "CreateArray requires a trivially constructible type"); ++#endif + static_assert(std::is_trivially_destructible<T>::value, + "CreateArray requires a trivially destructible type"); + GOOGLE_CHECK_LE(num_elements, std::numeric_limits<size_t>::max() / sizeof(T)) + +From 9c2c9861d5490801503b51936d00320bba68d465 Mon Sep 17 00:00:00 2001 +From: Chuck Atkins <chuck.atkins@kitware.com> +Date: Tue, 11 Feb 2020 10:22:38 -0500 +Subject: [PATCH 2/2] Intel compiler: silence noisy warning for incorrectly + evaluated inlining + +--- + cmake/CMakeLists.txt | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 8e5e68073b..849679995a 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -28,6 +28,14 @@ else() + set(CMAKE_CXX_EXTENSIONS OFF) + endif() + ++# The Intel compiler isn't able to deal with noinline member functions of ++# template classses defined in headers. As such it spams the output with ++# warning #2196: routine is both "inline" and "noinline" ++# This silences that warning. ++if (CMAKE_CXX_COMPILER_ID MATCHES Intel) ++ string(APPEND CMAKE_CXX_FLAGS " -diag-disable=2196") ++endif() ++ + # Options + option(protobuf_BUILD_TESTS "Build tests" ON) + option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF) diff --git a/var/spack/repos/builtin/packages/protobuf/package.py b/var/spack/repos/builtin/packages/protobuf/package.py index 513d5653b4..0923d3a961 100644 --- a/var/spack/repos/builtin/packages/protobuf/package.py +++ b/var/spack/repos/builtin/packages/protobuf/package.py @@ -48,7 +48,10 @@ class Protobuf(CMakePackage): # first fixed in 3.4.0: https://github.com/google/protobuf/pull/3406 patch('pkgconfig.patch', when='@:3.3.2') - patch('intel_inline.patch', when='@3.2.0: %intel') + patch('intel-v1.patch', when='@3.2:@3.6 %intel') + + # See https://github.com/protocolbuffers/protobuf/pull/7197 + patch('intel-v2.patch', when='@3.7:@3.11.4 %intel') def fetch_remote_versions(self): """Ignore additional source artifacts uploaded with releases, |