emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.61k stars 3.28k forks source link

Passing any of -msse, -msse2, -msse3, -mssse3, -msse4.1, -msse4.2, -mavx, -mfpu=neon flags also requires passing -msimd128 #14132

Open raphael10-collab opened 3 years ago

raphael10-collab commented 3 years ago

As described here: https://github.com/kaldi-asr/kaldi/issues/4523 I'm getting this error message: em++: error: Passing any of -msse, -msse2, -msse3, -mssse3, -msse4.1, -msse4.2, -mavx, -mfpu=neon flags also requires passing -msimd128!

How to solve the problem?

kripken commented 3 years ago

Does also passing -msimd128 fix things?

RReverser commented 3 years ago

I suspect we'll be seeing more of this unless we adopt https://github.com/emscripten-core/emscripten/issues/12714. Updating each build system / config is not always an easy change.

Level0r0s commented 3 years ago

Having a -s ENABLE_EXPERIMENTAL_SIMD128=1 flag that is required to enable -msse (without -msimd128)

leopsidom commented 2 years ago

Is there an update on this ? I'm also getting the same problem while trying to compile numpy 1.21.2. This was not a problem when we were compiling numpy 1.17.5 / 1.18.5 but start having the problem from 1.20+. Wonder why would emcc suddenly require a new flag ?

PS: I also tried to pass -msimd128 to emcc but it causes another problem, some type could not be found (__m512i, etc).

kripken commented 2 years ago

@leopsidom

PS: I also tried to pass -msimd128 to emcc but it causes another problem, some type could not be found (__m512i, etc).

Is __m512i an intrinsic not supported by clang perhaps @tlively ?

tlively commented 2 years ago

It looks like we don't implement AVX-512 headers that would define __m512i.

leopsidom commented 2 years ago

Thanks for the reply @kripken & @tlively. Yeah numpy is adding support for avx512 in the new version.

It looks like we don't implement AVX-512 headers that would define __m512i.

This sounds like the issue.

leopsidom commented 2 years ago

@tlively Based on the numpy compile options documentation, it seems numpy can select what features to be enabled based on the compiler support: https://numpy.org/devdocs/reference/simd/simd-optimizations.html#build-options-for-compilation. Do you know why it couldn't detect that emcc doesn't support beyond 128bit avx and try to compile with all cpu features ?

Also do you know how we can pass the compiler option --cpu-baseline and --cpu-dispatch to emcc ?

I tried: emcc .... --cpu-baseline=avx and emcc ... --cpu-baseline="avx"

But I got the following error:

clang-13: error: unsupported option '--cpu-baseline="avx"' clang-13: error: unsupported option '--cpu-dispatch="avx"'

leopsidom commented 2 years ago

Okay I have figured out how to pass the compiler option to numpy via the build.py and the issue has resolved for me. Thanks @kripken and @tlively both for the pointer.