Fix OpenMP build failure on macOS#2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the following issue that occurred on macOS when trying to install PyXDM via
pip install -e:clang++ -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /Users/joaomorado/.local/share/mamba/envs/pyxdm/include -arch arm64 -fPIC -O2 -isystem /Users/joaomorado/.local/share/mamba/envs/pyxdm/include -arch arm64 -I/private/var/folders/pk/bm5cw1295zz3n_228g98rz740000gn/T/pip-build-env-4a8mudzl/overlay/lib/python3.12/site-packages/pybind11/include -I/Users/joaomorado/.local/share/mamba/envs/pyxdm/include/python3.12 -c pyxdm/cpp/exchange_hole.cpp -o /var/folders/pk/bm5cw1295zz3n_228g98rz740000gn/T/tmpmktk64mk.build-temp/pyxdm/cpp/exchange_hole.o -O3 -fopenmp clang++: error: unsupported option '-fopenmp' error: command '/usr/bin/clang++' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building editable for pyxdm Failed to build pyxdm error: failed-wheel-build-for-install × Failed to build installable wheels for some pyproject.toml based projects ╰─> pyxdmApple's bundled clang does not support
-fopenmpdirectly. As a result, building theexchange_hole_cppC++ extension fails on macOS systems. This PR updatessetup.pyto detect macOS at build time and apply the appropriate compiler and linker flags using the OpenMP runtime provided by the active conda environment. It also addsllvm-openmpto the conda environment dependencies.