emscripten-core / emscripten-core/emscripten

fatal error: 'wasm_simd128.h' file not found

Open
#20,399 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Attempting to use SIMD, I get

```
"emscripten-win-x64_66c3/emscripten/emcc.bat" -Wno-warn-absolute-paths -Wno-c++11-extensions -Wno-nonportable-include-path -ffunction-sections -fno-unwind-tables -fomit-frame-pointer -fno-exceptions -fno-threadsafe-statics -std=c++17 -Wno-missing-braces -Wno-sign-compare -Wno-int-to-pointer-cast -Wno-format -Wno-conversion -Wno-format-security -Wno-unused-function -Wno-comment -Wno-reorder -Wno-logical-op-parentheses -Wno-unnamed-type-template-args -Wno-unused-private-field -Wno-constant-logical-operand -Wno-unused-local-typedef -Werror=nonportable-include-path -Wno-deprecated-declarations -Wno-undefined-var-template -Werror=switch -Werror=enum-compare -Werror=char-subscripts -Werror=write-strings -Werror=return-type -Werror=parentheses -Werror=tautological-pointer-compare -Werror=self-assign -Werror=dynamic-class-memaccess -Werror=absolute-value -Werror=sometimes-uninitialized -Werror=tautological-constant-out-of-range-compare -Werror=dangling-else -Werror=deprecated-register -Werror=unused-comparison -Werror=missing-field-initializers -Werror=shift-op-parentheses -Werror=conditional-uninitialized -Werror=incompatible-pointer-types -Werror=vexing-parse -Werror=infinite-recursion -Werror=undefined-internal -Werror=macro-redefined -Werror=overloaded-virtual -Werror=null-arithmetic -Werror=inconsistent-missing-override -Werror=extra-tokens -Werror=pointer-bool-conversion -Wno-parentheses-equality -Werror=shift-negative-value -Werror=mismatched-tags -Werror=gnu-alignof-expression -Wno-return-type-c-linkage -Werror=uninitialized -Wno-unknown-warning-option -Wno-uninitialized-const-reference -fvisibility=hidden -fno-exceptions -fno-rtti -O2 -fno-strict-aliasing -fstrict-overflow -ffunction-sections -fdata-sections -fmessage-length=0 -pipe -DNDEBUG -I"." -o "artifacts/modules/UnityPlayer.Core/WebGL_wasm_dev_i_r_nothreads/obj/CoreBindings.gen_wwcko.o" -fcolor-diagnostics -fdiagnostics-absolute-paths -msimd128 -msse4.2 -msimd128 -msse4.2 -c -xc++ "artifacts/WebGL/Modules/WebGL_wasm_dev_i_r_nothreads/Bindings/CoreBindings.gen.cpp"
##### Custom Environment Variables
EM_CONFIG=C:\unity\emscripten-win-x64_66c3\.emscripten
EMSDK_PYTHON=emscripten-win-x64_66c3\python\python.exe
EMCC_SKIP_SANITY_CHECK=1
EM_FROZEN_CACHE=1
EM_WORKAROUND_PYTHON_BUG_34780=1
EM_WORKAROUND_WIN7_BAD_ERRORLEVEL_BUG=1
##### ExitCode
1
##### Output
In file included from artifacts/WebGL/Modules/WebGL_wasm_dev_i_r_nothreads/Bindings/CoreBindings.gen.cpp:4:
In file included from artifacts/WebGL/Modules/WebGL_wasm_dev_i_r_nothreads/Bindings/CoreBindings.gen.h:3:
In file included from .\Runtime/Scripting/Marshalling/Marshalling.h:3:
In file included from .\Runtime/Scripting/Marshalling/PrimitiveMarshalling.h:109:
In file included from .\Runtime/Scripting/Marshalling/StringMarshalling.h:9:
In file included from .\Runtime/Utilities/TextUtil.h:17:
In file included from .\Runtime/Math/Rect.h:5:
In file included from .\Runtime/Math/Matrix4x4.h:12:
In file included from .\Runtime/Math/Simd/SimdMath.h:14:
In file included from C:\unity\emscripten-win-x64_66c3\emscripten\cache\sysroot/include\compat\xmmintrin.h:10:
C:\unity\emscripten-win-x64_66c3\emscripten\cache\sysroot\include\wasm_simd128.h:10:15: fatal error: 'wasm_simd128.h' file not found
#include_next
^~~~~~~~~~~~~~~~
1 error generated.
emcc: error: 'C:/unity/artifacts/Stevedore/emscripten-win-x64_66c3/llvm\clang++.exe -target wasm32-unknown-emscripten -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN --sysroot=C:\unity\emscripten-win-x64_66c3\emscripten\cache\sysroot -D__SSE__=1 -D__SSE2__=1 -D__SSE3__=1 -D__SSSE3__=1 -D__SSE4_1__=1 -D__SSE4_2__=1 -Xclang -iwithsysroot/include\fakesdl -Xclang -iwithsysroot/include\compat -Wno-c++11-extensions -Wno-nonportable-include-path -ffunction-sections -fno-unwind-tables -fomit-frame-pointer -fno-exceptions -fno-threadsafe-statics -std=c++17 -Wno-missing-braces -Wno-sign-compare -Wno-int-to-pointer-cast -Wno-format -Wno-conversion -Wno-format-security -Wno-unused-function -Wno-comment -Wno-reorder -Wno-logical-op-parentheses -Wno-unnamed-type-template-args -Wno-unused-private-field -Wno-constant-logical-operand -Wno-unused-local-typedef -Werror=nonportable-include-path -Wno-deprecated-declarations -Wno-undefined-var-template -Werror=switch -Werror=enum-compare -Werror=char-subscripts -Werror=write-strings -Werror=return-type -Werror=parentheses -Werror=tautological-pointer-compare -Werror=self-assign -Werror=dynamic-class-memaccess -Werror=absolute-value -Werror=sometimes-uninitialized -Werror=tautological-constant-out-of-range-compare -Werror=dangling-else -Werror=deprecated-register -Werror=unused-comparison -Werror=missing-field-initializers -Werror=shift-op-parentheses -Werror=conditional-uninitialized -Werror=incompatible-pointer-types -Werror=vexing-parse -Werror=infinite-recursion -Werror=undefined-internal -Werror=macro-redefined -Werror=overloaded-virtual -Werror=null-arithmetic -Werror=inconsistent-missing-override -Werror=extra-tokens -Werror=pointer-bool-conversion -Wno-parentheses-equality -Werror=shift-negative-value -Werror=mismatched-tags -Werror=gnu-alignof-expression -Wno-return-type-c-linkage -Werror=uninitialized -Wno-unknown-warning-option -Wno-uninitialized-const-reference -fvisibility=hidden -fno-exceptions -fno-rtti -O2 -fno-strict-aliasing -fstrict-overflow -ffunction-sections -fdata-sections -fmessage-length=0 -pipe -DNDEBUG -I. -fcolor-diagnostics -fdiagnostics-absolute-paths -msimd128 -msimd128 -c -xc++ artifacts/WebGL/Modules/WebGL_wasm_dev_i_r_nothreads/Bindings/CoreBindings.gen.cpp -o artifacts/modules/UnityPlayer.Core/WebGL_wasm_dev_i_r_nothreads/obj/CoreBindings.gen_wwcko.o' failed (returned 1)
```

The root issue here is that I am using a custom script that compiles and bundles Emsdk from source, but that script does not bundle LLVM's wasm_simd128.h header.

So I'd like to fix that, and include the header in our own bundles.

But I am slightly stumped as to where I should place it. I.e. how does LLVM find `wasm_simd128.h` to include, when there are no `-Idir` directives that it are passed on the command line?

I see in the latest Emscripten precompiled version (`emsdk install latest`), there is a directory structure
```
.
..
bin/
bin/clang.exe
lib/
lib/clang/
lib/clang/17/
lib/clang/17/include/
lib/clang/17/include/wasm_simd128.h
```

but when compiling, there is nothing along the lines of `-I/lib/clang/17/include/` being said to clang.

Does clang.exe have some kind of internal hardcoded `-I../lib/clang/17/include/` at play? If I am bundling manually, should I expect to hardcode such a sibling directory path next to where `clang.exe` lives in? @tlively would you know?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.