Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue with universal2 on macos #430

Closed
t20100 opened this issue Dec 14, 2022 · 0 comments · Fixed by #431
Closed

Build issue with universal2 on macos #430

t20100 opened this issue Dec 14, 2022 · 0 comments · Fixed by #431

Comments

@t20100
Copy link
Contributor

t20100 commented Dec 14, 2022

Describe the bug
On macos, building a universal2 build (-arch arm64 -arch x86_64 options) of c-blosc2 fails when enabling SHUFFLE_[SSE2/AVX2]_ENABLED as those options are activated both for x86_64 and arm64. I expect similar issue the other way around with SHUFFLE_NEON_ENABLED.

Related to similar issue on c-blosc: Blosc/c-blosc#334

To Reproduce
On a macos ARM computer with a universal2 build of Python, compile blosc2 HDF5 filter as part of hdf5plugin (blosc2 PR: silx-kit/hdf5plugin#201) with python setup.py build

Expected behavior
Even if SHUFFLE_[SSE2/AVX2/NEON]_ENABLED are set, if the target platform does not support those instructions they should not be considered.
I would expect the same behavior as proposed for blosc(1) in PR Blosc/c-blosc#347.

Logs

Compilation logs... ``` gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DHAVE_LZ4=1 -DHAVE_ZLIB=1 -DHAVE_ZSTD=1 -DH5_USE_18_API -DSHUFFLE_SSE2_ENABLED=1 -Isrc/hdf5/include -Isrc/hdf5/include/darwin -Isrc/c-blosc2 -Isrc/c-blosc2/blosc -Isrc/c-blosc2/include -Isrc/c-blosc/internal-complibs/lz4-1.9.3 -Isrc/c-blosc/internal-complibs/zlib-1.2.11 -Isrc/c-blosc/internal-complibs/zstd-1.5.2 -Isrc/c-blosc/internal-complibs/zstd-1.5.2/common -Isrc/PyTables/hdf5-blosc2/src -Ivenv/py39/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/c-blosc2/blosc/bitshuffle-sse2.c -o build/temp.macosx-10.9-universal2-3.9/src/c-blosc2/blosc/bitshuffle-sse2.o -std=gnu99 -O3 -ffast-math -pthread -mcpu=native src/c-blosc2/blosc/bitshuffle-sse2.c:29:4: error: SSE2 is not supported by the target architecture/platform and/or this compiler. #error SSE2 is not supported by the target architecture/platform and/or this compiler. ^ In file included from src/c-blosc2/blosc/bitshuffle-sse2.c:32: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/emmintrin.h:13: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/xmmintrin.h:13: /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:50:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_vec_init_v2si(__i, 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:129:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:159:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:189:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:216:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:239:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:260:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:287:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:310:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:331:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:352:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:373:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:394:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:416:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:439:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:461:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:483:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_paddusw((__v4hi)__m1, (__v4hi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:504:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size return (__m64)__builtin_ia32_psubb((__v8qi)__m1, (__v8qi)__m2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. ```

System information:

  • OS: macos
  • Compiler clang
  • Version 2.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant