-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
Check OpenMP at configuration #31499
Comments
comment:3
Seems fair. Why is the extra test in |
comment:4
As |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
Replying to @mkoeppe:
Good point. |
comment:7
Replying to @kiwifb:
Exactly. In #27122 I didn't consider this and then we had to solve #30725. This was the solution we came up with (just reject OpenMP alltogether, if we cannot find consistent arguments to make it work.) We don't try as hard as we could (if sage uses gcc, but for cython clang, it still might be possible to enable OpenMP for cython with different arguments). But this solution here should enable OpenMP in cython on many platforms and still work on the others. |
comment:8
Argh!!! I was going to answer that - hours ago - but I got interrupted by my day work (which is currently horrible, 2021 so far is worse for me than the whole of 2020).
As you can see there is only a single switch in each case which tells the compiler what headers and macro to enable at compile time and what library to use at link time. The greatest danger usually is that people, or build systems, forget you should also include the CFLAGS at linking time. Very often I guess that proof things in case things change in the future (most likely several years). |
comment:10
It would be better to set the new variables in And I think you can get rid of |
comment:12
I guess that should be |
comment:13
And |
comment:14
Replying to @mkoeppe:
... if you set a default of |
comment:16
On macOS (using /usr/bin/gcc) I am getting
is this expected? |
comment:17
Also, best to merge #31384 which touches the same function and will cause a merge conflict |
comment:18
Replying to @mkoeppe:
macOS might be a bit more complicated. https://stackoverflow.com/questions/66040039/openmp-support-for-mac-using-clang-or-gcc I'm happy to add whatever to the list to make it work. Maybe |
comment:19
I usually take the example from |
comment:21
How about |
comment:22
Let's just take this to mean that Xcode's gcc can't do OpenMP. |
Changed reviewer from https://github.com/kliem/sage/pull/43/checks to Matthias Koeppe |
comment:23
Thank you. |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
|
comment:25
Merged in #31384 as requested. |
Dependencies: #31384 |
comment:26
Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review. |
Changed branch from u/gh-kliem/check_openmp_at_configuration to |
We define cython aliases
OPENMP_CFLAGS
andOPENMP_CXXFLAGS
.They must be used as
extra_link_args
andextra_compile_args
to getcython.parallel
to work in parallel.If they are empty,
cython.parallel.prange
will still compile and work (but not in parallel). This is useful in case that OpenMP isn't supported, see e.g. https://github.com/kliem/sage/pull/40/checks?check_run_id=2076988665).With this ticket we can just run
regardless of whether the current system actually supports OpenMP.
Depends on #31384
CC: @tscrim @mkoeppe @kiwifb @kliem @w-bruns
Component: cython
Keywords: openmp, parallel
Author: Jonathan Kliem
Branch/Commit:
c3cc31e
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/31499
The text was updated successfully, but these errors were encountered: