Skip to content

OpenMP support (omp.h file not found) #17637

Open

Description

@johannesmols

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

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).

There is also this issue, but adding the simpleomp code didn#t work either.

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

Activity

  1. sbc100 commented on Sep 20, 2022

    @sbc100
    Collaborator

    No way that I'm aware of no. You could try porting OpenMP to wasm but that sounds like it could be a lot of work. If you can I would try to find a way to disable the use of OpenMP in the software you are porting.

  2. added a commit that references this issue on Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions