title: Emscripten: how can i compile a c file with an intrinsic header like immintrin.h?
body: <p>I am trying to compile CLBG benchmarks with emscripten (C to WASM). However, most of them has included intrinsic headers (like &lt;immintrin.h&gt;) and that gave me a lot of errors (let`s use nbody.c as an example) like this:</p>
  <p><code> nbody.c:137:20: error: use of undeclared identifier '__m128d' static alignas(__m128d) double</code></p>
  <p>I already tried to compile with these flags</p>
  <p><code>emcc nbody.c -o nbody.js -O2 -s WASM=1 -msse2 -msimd128</code></p>
  <p>and it compiles. However, when I tried to run nbody.js with nodejs, it doesn`t work. I have also tried to run nodejs with</p>
  <p><code> --experimental-wasm-simd</code></p>
  <p>like this <a href="https://github.com/adrianchang/Javascript-Parallel-Library" rel="nofollow noreferrer">git</a> tells, but it also doesn't work. It says:</p>
  <blockquote>
  <p><code>failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): Compiling function #4:&quot;main&quot; failed: invalid value type 'Simd128', enable with --experimental-wasm-simd @+422</code><br />
  <code>CompileError: WebAssembly.instantiate(): Compiling function #4:&quot;main&quot; failed: invalid value type 'Simd128', enable with --experimental-wasm-simd @+422</code><br />
  <code>RuntimeError: abort(CompileError: WebAssembly.instantiate(): Compiling function #4:&quot;main&quot; failed: invalid value type 'Simd128', enable with --experimental-wasm-simd @+422).</code><br />
  <code>Build with -s ASSERTIONS=1 for more info.</code></p>
  </blockquote>
  <p>Can anyone give me a hand? I am not understanding if this is already possible to do.</p>