Open barracuda156 opened 3 weeks ago
Duplicate of https://github.com/Blosc/c-blosc2/issues/592 which should be re-opened.
@barracuda156, can you try building hdf5plugin
with the following patch?
diff --git a/src/c-blosc2/blosc/bitshuffle-altivec.c b/src/c-blosc2/blosc/bitshuffle-altivec.c
index 0dd33b8..634396c 100644
--- a/src/c-blosc2/blosc/bitshuffle-altivec.c
+++ b/src/c-blosc2/blosc/bitshuffle-altivec.c
@@ -26,7 +26,7 @@
#include "bitshuffle-generic.h"
/* Make sure ALTIVEC is available for the compilation target and compiler. */
-#if defined(__ALTIVEC__)
+#if defined(__ALTIVEC__) && defined(__VSX__) && defined(_ARCH_PWR8)
#include "transpose-altivec.h"
diff --git a/src/c-blosc2/blosc/shuffle-altivec.c b/src/c-blosc2/blosc/shuffle-altivec.c
index d0077c5..b1d936f 100644
--- a/src/c-blosc2/blosc/shuffle-altivec.c
+++ b/src/c-blosc2/blosc/shuffle-altivec.c
@@ -12,7 +12,7 @@
#include "shuffle-generic.h"
/* Make sure ALTIVEC is available for the compilation target and compiler. */
-#if defined(__ALTIVEC__)
+#if defined(__ALTIVEC__) && defined(__VSX__) && defined(_ARCH_PWR8)
#include "transpose-altivec.h"
diff --git a/src/c-blosc2/blosc/shuffle.h b/src/c-blosc2/blosc/shuffle.h
index 3421e52..21f146d 100644
--- a/src/c-blosc2/blosc/shuffle.h
+++ b/src/c-blosc2/blosc/shuffle.h
@@ -39,7 +39,7 @@
#define SHUFFLE_USE_SSE2
#endif
-#if defined(SHUFFLE_ALTIVEC_ENABLED) && defined(__ALTIVEC__)
+#if defined(SHUFFLE_ALTIVEC_ENABLED) && defined(__ALTIVEC__) && defined(__VSX__) && defined(_ARCH_PWR8)
#define SHUFFLE_USE_ALTIVEC
#endif
With this patch, on Ubuntu20.04 on Power9 it compiles blosc2 with the altivec implementation, and trying to compile with -mcpu=power6|power7|power8
also works.
This will be fixed by updating the embedded version of c-blosc2 to >= v2.15.0. Actually waiting for a c-blosc2 release including https://github.com/Blosc/c-blosc2/pull/622.
VSX is ISA 2.06+, they should be used conditionally.