Open fsuarezg opened 3 years ago
The version of C++ does matter with USD, as your error is coming from a USD include. It looks like USD is built against C++14 here: https://github.com/PixarAnimationStudios/USD/blob/dc710925675f7f58f7a37f6c18d046a687b09271/cmake/defaults/CXXDefaults.cmake#L29
Does it work if you add -DCMAKE_CXX_STANDARD=14 when you call Cmake? https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html#variable:CMAKE_CXX_STANDARD
Hi Colin, First of all thanks for the reply!
I tried your suggestion of adding the cmake flag to the command
USD_INSTALL_ROOT=/home/fernandos/Documents/USD cmake -DCMAKE_CXX_STANDARD=14 ..
which added these lines in the cmakeCache file:
//No help, variable specified on the command line.
CMAKE_CXX_STANDARD:UNINITIALIZED=14
but when I ran make install
, it unfortunately still results in the same enable_if_t not a type error.
I'm trying to understand how that is possible. I'm on a Virtual Machine to make sure that my environment is as clean as possible: all I did was install on a clean Centos 7 devtoolset-8, cmake 3.14.6, and python-devel.
I'm also going to try if there is any other cmake flag that I should set.
AH I found the solution and also why adding -DCMAKE_CXX_STANDARD=14 when calling cmake didn't work. In the custom_resolver/project/CMakeLists.txt file the was a line set(CMAKE_CXX_STANDARD 11), so I had to change it to 14 and that fixed it. This caused the flag to be overwritten even when it was passed to cmake.
Ah that'll do it! @ColinKennedy USD versions after 20.02 look like they require C++14. Probably rework that line to support newer versions. Perhaps something here can help?
Hey @fsuarezg and apologies for the confusion. USD-Cookbook is built against on an old USD version so this was bound to happen at some point. @colevfx rightly pointed out to me the other day that we need some automated testing to make sure this repository stays build-able.
Probably that'll necessitate combining all of the ~40 CMake projects into a single build and then adding some CI so we can make sure this works on different OSes. It'll take a while to move everything over so in the meantime, please use this ticket to flag any other projects which you're unable to build in later versions and we'll address them once that automation is in a usable state.
Edit: Also FYI there's a similar thread on usd-interest - https://groups.google.com/g/usd-interest/c/XeYSf-IpzG8/m/5G3NnOB-AgAJ
Hello ,
I'm currently trying to build your example plugin of the custom asset resolver, and I'm running into a bit of a problem building it and I was wondering if you had maybe encountered a similar error.
I'm on a Centos 7 machine, with a built version of USD (21.02), devtoolset-8 (for gcc 8.3.1), and cmake (3.14.6).
Running the
USD_INSTALL_ROOT=/home/fernandos/Documents/USD cmake ..
command seems to work, the problem occurs when running themake install
command:This type error seems to indicate an error possibly caused by a wrong version of gcc. I know that
enable_if_t
was added in c++14, so if you have an old compiler (such as the standard gcc 4.8.1 on Centos 7) it would throw this error as it standard uses c++11 to compile. However, I'm using the devtoolset-8 environment and everything seems to indicate that I am using gcc 8.3.1 to compile. Now I noticed that you previously built this project with USD 19.07, might it be that that version was still compiled with and old version of gcc that used c++11 as the standard and that the makefile somehow uses a wrong version of gcc (the standard 4.8.1 version on Centos 7)(This does not seem the case, but I thought I ask)So I guess my question is: is it normal that I am encountering this problem with USD 21.02? or are you able to build it without any issues with that USD version?