nodejs / nodejs/node-gyp

How to enable OpenMP on macOS (clang)

Open
#3,058 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.7k
Forks
1.9k
Avg merge
1d 4h
Merged PRs (30d)
5

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the binding.gyp configuration and the working CPPFLAGS example in the issue, then run node-gyp rebuild using the reported Apple clang environment. Confirm how the flags should be represented in binding.gyp and document the resulting macOS OpenMP setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, node.js
Domain
build-system
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.