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

shared_timed_mutex not available on older versions of MacOS #10531

Closed
jppelteret opened this issue Jun 14, 2020 · 8 comments · Fixed by #10532
Closed

shared_timed_mutex not available on older versions of MacOS #10531

jppelteret opened this issue Jun 14, 2020 · 8 comments · Fixed by #10532

Comments

@jppelteret
Copy link
Member

../include/deal.II/base/thread_local_storage.h:253:10: error: 'shared_timed_mutex' is unavailable: introduced in macOS 10.12
    std::shared_timed_mutex insertion_mutex;
         ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/shared_mutex:202:58: note: 'shared_timed_mutex' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_timed_mutex

I just rolled back to version 9.2, which is OK for now. @tamiko I think that you introduced this change a short while ago. Is there an easy(ish) workaround for this? I know that my OS is old (circa Sept 2015), so if the answer is "no" then I recognise that I might just need to upgrade everything. I wonder, though, if there are users that might hit the same issue.

@masterleinad
Copy link
Member

What's your compiler and version?

@bangerth
Copy link
Member

That's disappointing -- it's clearly marked as C++14: https://en.cppreference.com/w/cpp/thread/shared_timed_mutex

@jppelteret
Copy link
Member Author

What's your compiler and version?

$ clang -v
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0

It looks like this is based off of LLVM 3.9. So it looks like this falls below our minimum supported version of "Clang version 4.0 or later", and from the table I linked to we should blacklist everything below Apple LLVM version 9.0.0 (clang-900.0.37).

@jppelteret
Copy link
Member Author

It looks like there is a boost version of shared_mutex (which I could use as a workaround) but I feel that we should probably respect our minimum compiler requirements.

@tamiko
Copy link
Member

tamiko commented Jun 15, 2020 via email

@jppelteret
Copy link
Member Author

We can make a simple feature test for
std::shared_timed_mutex/shared_mutex and if not available fall back to
the boost version. I will make a pull request for this sometime this
week.

Thanks a lot for being willing to do that, but if we go with #10532 then I don't think that a workaround is necessary any more. The next version of MacOS (apparently) shipped with a compiler that provided this feature, and if we test the minimum required version of Clang and GCC then we should be able to verify that all's OK there too. Do you agree with this?

@tamiko
Copy link
Member

tamiko commented Jun 16, 2020 via email

@jppelteret
Copy link
Member Author

Let's do it properly then. If we say that we don't support a certain version of the compiler, then there's no point in doing any further work to support it :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants