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

dealii build fails on Mac arm due to use of "unary_function" #388

Open
naliboff opened this issue Jun 26, 2024 · 3 comments
Open

dealii build fails on Mac arm due to use of "unary_function" #388

naliboff opened this issue Jun 26, 2024 · 3 comments

Comments

@naliboff
Copy link

While building deal.II via candi on recent arm-based mac (Sonoma 14.5), I ran into the following error while compiling deal.II 9.5.2 (i.e., it made it through installation of the other packages).

In file included from /Users/naliboff/software/dealii/v9.5.2/install/tmp/unpack/deal.II-v9.5.2/bundled/boost-1.70.0/libs/serialization/src/../../../include/boost/type_index/stl_type_index.hpp:47:
/Users/naliboff/software/dealii/v9.5.2/install/tmp/unpack/deal.II-v9.5.2/bundled/boost-1.70.0/libs/serialization/src/../../../include/boost/container_hash/hash.hpp:130:33: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
        struct hash_base : std::unary_function<T, std::size_t> {};
                           ~~~~~^~~~~~~~~~~~~~
                                __unary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
^
[ 30%] Built target bundled_umfpack_ZL_STORE_debug
make[2]: *** [bundled/boost-1.70.0/libs/serialization/src/CMakeFiles/bundled_boost_serialization_debug.dir/xml_grammar.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

This seems likely related to the following deprecation in Xcode15, as noted here:
unary_function and binary_function are no longer provided in C++17 and newer Standard modes. They can be re-enabled with _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION.

For reference, I followed the instruction for building deal.II on a Mac ARM system from here, with the exception of:

  1. building gcc@11 with homebrew (likely not an issue since I used the clang compilers)
  2. I used the candi configuration file from the ASPECT repository

Any suggestions for how to proceed?

Thanks!
John

@naliboff
Copy link
Author

I resolved this by installing boost through candi, where boost version 1.8.x and above no longer uses std::unary_function. Would making a note of this be a helpful addition to one of the wikis and/or add a new platform under deal.II-toolchain/platforms/supported/ for Mac osx Sonoma?

@QY-Shi
Copy link

QY-Shi commented Jul 5, 2024

You can choose the master version of deal.II instead of 9.5.2.
I reported this std::unary_function issue, and it was solved.

@pawantakhar
Copy link

I was having problems with both Candi and precompiled (.dmg) versions. I was able to compile ver 9.5.2 for M2 Mac without any issues.

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

No branches or pull requests

3 participants