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

Building on MinGW fails due to missing "std::mutex" #748

Closed
yaronct opened this issue Jan 26, 2022 · 2 comments · Fixed by #753
Closed

Building on MinGW fails due to missing "std::mutex" #748

yaronct opened this issue Jan 26, 2022 · 2 comments · Fixed by #753

Comments

@yaronct
Copy link

yaronct commented Jan 26, 2022

MinGW-w64 (GCC targetting Windows) that uses the "win32" threading model, doesn't provide some threading stuff like "std::mutex" (I'm not sue about the "posix" threading model), therefore building fails with:

./boost/math/special_functions/detail/bernoulli_details.hpp:563:9: error: ‘mutex’ in namespace ‘std’ does not name a type
563 | std::mutex m_mutex;
| ^~~~~

This can probably be solved by using threading stuff from the boost thread library (in the case of MinGW), as I think boost thread gives an API compatible with that of the standard C++ library ("std"). So I think, e.g. using "boost::mutex" should be compatible with "std::mutex". I haven't tried it though. Alternately, building boost math can be disabled on MinGW (possibly only for the "win32" threading model).

Tested against boost 1.78.0.

mborland added a commit to mborland/math that referenced this issue Jan 27, 2022
@mborland mborland linked a pull request Jan 27, 2022 that will close this issue
@mborland
Copy link
Member

Can you try the linked PR, and let me know if it solves your issue?

@yaronct
Copy link
Author

yaronct commented Jan 31, 2022

Thanks, @jzmaddock, #753 solves the problem. Or at least eliminates it 😄

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 a pull request may close this issue.

2 participants