emscripten-core / emscripten-core/emscripten

OpenMP support (omp.h file not found)

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

Description

I want to compile [this C++ project][1] to WASM using Emscripten. For this, I am following the [documentation on building projects][2].

The project only has a Makefile, no Configure or CMake. From what I can tell, the only necessary change to the Makefile is to change the CC flag from `g++` to `em++` (in the `flags.mk` file).

Running `emmake make` gives this error: `em++: error: Passing any of -msse, -msse2, -msse3, -mssse3, -msse4.1, -msse4.2, -msse4, -mavx, -mfpu=neon flags also requires passing -msimd128 (or -mrelaxed-simd)!`

So, adding `-msimd128` to the `flags.mk` file, I now an error that the header `omp.h` can't be found in one of the source files. This is a header file for OpenMP, and it seems that this is not supported by WASM at the moment (found [this thread on SO](https://stackoverflow.com/questions/56118742/compiling-openmp-to-webassembly)).

There is also [this issue](https://github.com/emscripten-core/emscripten/issues/13892), but adding the simpleomp code didn#t work either.

So, is there any way to compile this project without removing OpenMP?

[1]: https://github.com/TrustworthyComputing/Zilch
[2]: https://emscripten.org/docs/compiling/Building-Projects.html

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.