Stellarium / stellarium

Stellarium is a free GPL software which renders realistic skies in real time with OpenGL. It is available for Linux/Unix, Windows and macOS. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.
https://stellarium.org
GNU General Public License v2.0
7.61k stars 817 forks source link

Enabling std::execution::par for Clang 17+ and libc++ #3902

Open alex-w opened 1 week ago

alex-w commented 1 week ago

Enabling support of parallel algorithms for Clang 17+ and libc++ (like FreeBSD) via adding -fexperimental-library option for compiler. Of course other way to use parallel algorithms is adding Intel's oneDPL (Intel's oneAPI) library.

See:

Our CI instance FreeBSD/Clang 18 is passed the test

Type of change

Checklist:

10110111 commented 1 week ago

Is this sorting parallelization so crucial for performance that we want to enable all the experimental features of libc++?

gzotti commented 1 week ago

I see a good increase in performance with a large solarSystem. However, experimental lib support always sounds a bit scary for "safe and trusted" programs. It has been now built to be not an error if a compiler/library does not support std::execution::par, so I have no clear opinion on that. I understand only CLang/FreeBSD is affected? Maybe enable behind yet another CMake flag for this platform, and instruct users with problems to self-compile? (Any estimate of affected users on this platform?)

alex-w commented 1 week ago

Oops, I forget convert this PR to draft, sorry.

This is an experimental PR and in theory these changes affected FreeBSD and macOS. Of course we have very limited number of FreeBSD users and it looks as not critical changes for this platform. The number of macOS users are more than FreeBSD users, but AppleClang has some specifics and the latest release of AppleClang has version 16.0 (macOS 15.0 Sequoia), so, this patch is not applicable here. Probably I should add a separate solution for macOS via using oneDPL library.