Skip to content

More robust check for compiler openmp support and enable lto#328

Merged
ljgray merged 3 commits intomainfrom
ljg/compiler-check
Feb 18, 2026
Merged

More robust check for compiler openmp support and enable lto#328
ljgray merged 3 commits intomainfrom
ljg/compiler-check

Conversation

@ljgray
Copy link
Contributor

@ljgray ljgray commented Feb 6, 2026

No description provided.

@ljgray ljgray force-pushed the ljg/compiler-check branch 3 times, most recently from 7cd77b1 to 6211d03 Compare February 6, 2026 01:23
@ljgray
Copy link
Contributor Author

ljgray commented Feb 6, 2026

Checking for the specific cpu is annoying for macs - only very recent versions of clang support -march=native, and there's no equivalent to autodetect, so we have to check for each different M-series CPU. They also aren't all compatible with each other.

We also try to use apple Accelerate where openmp isn't available. There's an edge case where blas/lapack calls in a prange cython loop results in Accelerate spawning it's own threads and slowing things down. I'm sure there's a better way around this, but for now I don't think we care too much. I'm open to other suggestions here, though.

Finally, I guess it doesn't really matter if we pass all these flags to both the compiler and the linker, so for simplicity I've switched to using a single list.

@ljgray ljgray requested a review from ketiltrout February 6, 2026 01:32
@ljgray ljgray force-pushed the ljg/compiler-check branch 3 times, most recently from 73cd2e5 to b9f6b50 Compare February 6, 2026 22:09
name = "caput"
description = "Cluster Astronomical Python Utilities"
license = { file = "LICENSE" }
license = "GPL-2.0-or-later"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old format is deprecated, so we need to update this everywhere. I'm using 2.0 or later here, but if there's an argument to use 2.0 only I'm fine with that as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.0 or later is the right one to use.

@ljgray ljgray force-pushed the ljg/compiler-check branch 4 times, most recently from 7343422 to 46a8e30 Compare February 11, 2026 23:37
name = "caput"
description = "Cluster Astronomical Python Utilities"
license = { file = "LICENSE" }
license = "GPL-2.0-or-later"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.0 or later is the right one to use.

@ljgray ljgray force-pushed the ljg/compiler-check branch from 46a8e30 to 5af356e Compare February 18, 2026 17:53
@ljgray ljgray merged commit 90f7a36 into main Feb 18, 2026
11 checks passed
@ljgray ljgray deleted the ljg/compiler-check branch February 18, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants