nodejs/node-gyp

How to enable OpenMP on macOS (clang)

mahnunchik opened this issue · 1 comments

How to enable OpenMP on macOS (clang)?

  • Node Version: node v20.12.2, npm 10.5.0
  • Platform: Darwin MacBook-Pro.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
  • Compiler:
cc -v
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • Module: Any with OpenMP

Working example:

export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"
node-gyp rebuild

How to specify CPPFLAGS in binding.gyp config?

More info: https://open-box.readthedocs.io/en/latest/installation/openmp_macos.html

Could anyone help to solve the issue?