Skip to content
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

CMake: Ensure we use "-pthread" instead of "-lpthread" for thread support #14540

Merged
merged 1 commit into from Dec 7, 2022

Conversation

tamiko
Copy link
Member

@tamiko tamiko commented Dec 7, 2022

We will need this in 9.4 as well.

@tamiko
Copy link
Member Author

tamiko commented Dec 7, 2022

/rebuild

@tamiko
Copy link
Member Author

tamiko commented Dec 7, 2022

The difference for gcc-9.4.0 (on Ubuntu 20.04.1) is subtle: -lpthread results in a final linkage via collect2 [...] -lpthread -lstdc++ [...] whereas -pthread results in collect2 [...] -lstdc++ -lpthread [...] (and some different options for an lto plugin). The former unfortunately leads to linker errors if we happen to use threading facilities from the standard libraries in the example step directly.

Copy link
Member

@tjhei tjhei left a comment

Choose a reason for hiding this comment

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

Awesome, thank you! Would you mind adding the DSO error message to the comments somewhere.

@tamiko
Copy link
Member Author

tamiko commented Dec 7, 2022

@tjhei done.

@tjhei tjhei merged commit d91250a into dealii:master Dec 7, 2022
drwells added a commit that referenced this pull request Dec 9, 2022
@tamiko tamiko deleted the use_pthread_flag branch July 7, 2023 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants