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

Failed compilation on MacOS #14

Closed
3d4m-volodymyr opened this issue Feb 7, 2024 · 3 comments
Closed

Failed compilation on MacOS #14

3d4m-volodymyr opened this issue Feb 7, 2024 · 3 comments

Comments

@3d4m-volodymyr
Copy link

Macbook Apple M1 Pro
macOS Sonoma 14.3 (23D56)
Xcode 15.2

USD v23.11 - (0b18ad3f840c24eb25e16b795a5b0821cf05126e)
usdtweak - develop barnch (e01216d)

[ 25%] Linking C static library libglfw3.a
[ 25%] Built target glfw
[ 26%] Building CXX object CMakeFiles/usdtweak.dir/src/Blueprints.cpp.o
In file included from /Users/b/Developer/usdtweak/src/Blueprints.cpp:5:
In file included from /Users/b/Developer/USD_build/include/pxr/usd/sdf/fileFormat.h:32:
In file included from /Users/b/Developer/USD_build/include/pxr/usd/sdf/declareHandles.h:33:
In file included from /Users/b/Developer/USD_build/include/pxr/base/tf/diagnostic.h:46:
In file included from /Users/b/Developer/USD_build/include/pxr/base/tf/diagnosticHelper.h:35:
In file included from /Users/b/Developer/USD_build/include/boost/any.hpp:20:
In file included from /Users/b/Developer/USD_build/include/boost/type_index.hpp:29:
In file included from /Users/b/Developer/USD_build/include/boost/type_index/stl_type_index.hpp:47:
/Users/b/Developer/USD_build/include/boost/container_hash/hash.hpp:132: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> {};
                           ~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.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>;
^
1 error generated.
make[2]: *** [CMakeFiles/usdtweak.dir/src/Blueprints.cpp.o] Error 1
make[1]: *** [CMakeFiles/usdtweak.dir/all] Error 2
make: *** [all] Error 2
@3d4m-volodymyr
Copy link
Author

I fixed it by executing this line before cmake command.
export CXXFLAGS="-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION=1"

@3d4m-volodymyr
Copy link
Author

Another option that is also worked is
cmake -G Xcode -Dpxr_DIR=/Users/b/Developer/USD_build -DMaterialX_DIR=/Users/b/Developer/USD_build/lib/cmake/MaterialX ..

@cpichard
Copy link
Owner

Thanks for reporting this issue @3d4m-volodymyr, I have updated the cmake file to prevent this compilation error.
C

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

2 participants