summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew W Elble <aweits@rit.edu>2020-06-30 12:27:34 -0400
committerGitHub <noreply@github.com>2020-06-30 11:27:34 -0500
commit78ac36204e22ae430470521dfaa2fc1232bd9a46 (patch)
treeaff0f8540b7e88d89304686ccdd4c36d759f6e49
parent463d0d7bd9d79d45071ff59401d21f500da2119d (diff)
downloadspack-78ac36204e22ae430470521dfaa2fc1232bd9a46.tar.gz
spack-78ac36204e22ae430470521dfaa2fc1232bd9a46.tar.bz2
spack-78ac36204e22ae430470521dfaa2fc1232bd9a46.tar.xz
spack-78ac36204e22ae430470521dfaa2fc1232bd9a46.zip
half: fix __F16C__ include of immintrin.h (#17272)
Small fix so that immintrin.h gets included properly when the compiler sets __F16C__. Upstream has been notified.
-rw-r--r--var/spack/repos/builtin/packages/half/f16fix.patch23
-rw-r--r--var/spack/repos/builtin/packages/half/package.py2
2 files changed, 25 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/half/f16fix.patch b/var/spack/repos/builtin/packages/half/f16fix.patch
new file mode 100644
index 0000000000..f913c6f4d9
--- /dev/null
+++ b/var/spack/repos/builtin/packages/half/f16fix.patch
@@ -0,0 +1,23 @@
+--- a/include/half.hpp.orig 2020-06-26 07:46:50.861595808 -0400
++++ b/include/half.hpp 2020-06-26 07:47:31.353286730 -0400
+@@ -266,9 +266,6 @@
+ #if HALF_ENABLE_CPP11_HASH
+ #include <functional>
+ #endif
+-#if HALF_ENABLE_F16C_INTRINSICS
+- #include <immintrin.h>
+-#endif
+
+
+ #ifndef HALF_ENABLE_F16C_INTRINSICS
+@@ -281,6 +278,10 @@
+ #define HALF_ENABLE_F16C_INTRINSICS __F16C__
+ #endif
+
++#if HALF_ENABLE_F16C_INTRINSICS
++ #include <immintrin.h>
++#endif
++
+ #ifdef HALF_DOXYGEN_ONLY
+ /// Type for internal floating-point computations.
+ /// This can be predefined to a built-in floating-point type (`float`, `double` or `long double`) to override the internal
diff --git a/var/spack/repos/builtin/packages/half/package.py b/var/spack/repos/builtin/packages/half/package.py
index f1ec03c4e5..14c12cc0cd 100644
--- a/var/spack/repos/builtin/packages/half/package.py
+++ b/var/spack/repos/builtin/packages/half/package.py
@@ -23,6 +23,8 @@ class Half(Package):
version('2.1.0', sha256='ad1788afe0300fa2b02b0d1df128d857f021f92ccf7c8bddd07812685fa07a25')
+ patch('f16fix.patch')
+
def install(self, spec, prefix):
mkdirp(prefix.include)
install_tree('include', prefix.include)