-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang fopenmp on macOS #40
Comments
Hi, is there any update on this issue ? If I run the following code on MacOS: from setuptools import Extension
from extension_helpers import add_openmp_flags_if_available
# create a dummy extension
dummy_ext = Extension(
'dummy_ext',
sources=['dummy.cpp'],
extra_compile_args=['-DNDEBUG', '-DUSE_BLAS_LIB', '-std=c++11'],
language='c++',
depends=['dummy.h']
)
# add OpenMP flag if available
omp_support = add_openmp_flags_if_available(dummy_ext) I get the following message:
I was thinking about doing a PR solving this but I am sure how to check for the compiler. [1] See
|
Working on a fix here #42 |
@lukeolson What is your OS configuration? I tried compiling the following code #include <omp.h>
#include <stdio.h>
int main() {
#pragma omp parallel
printf("Hello from thread %d over %d\n", omp_get_thread_num(), omp_get_num_threads());
} with Thanks Edit: |
#42 should fix the issue. |
I did the same... using
|
Great package.
To use OpenMP on a mac with clang, I replaced
-fopenmp
with-Xpreprocessor -fopenmp
in the compile flags and-fopenmp
with-lomp
in the link flags using the output fromget_openmp_flags()
here:https://github.com/astropy/extension-helpers/blob/main/extension_helpers/_openmp_helpers.py#L137
This is a bit of a hack (on my part). Are there better ideas (or any plans to add mac support like this)?
The text was updated successfully, but these errors were encountered: