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

[gcc:11/clang:11] build fails, nonconforming code. #1546

Closed
bartoszek opened this issue Jun 24, 2021 · 1 comment
Closed

[gcc:11/clang:11] build fails, nonconforming code. #1546

bartoszek opened this issue Jun 24, 2021 · 1 comment

Comments

@bartoszek
Copy link

Description of Issue

  1. <cxxabi.h> in demangle.cpp has to be included earlier, otherwise gcc:11/clang:11 complains about:
FAILED: pxr/base/arch/CMakeFiles/arch.dir/demangle.cpp.o
/usr/lib/ccache/bin/c++ -DARCH_EXPORTS=1 -DAR_EXPORTS=1 -DBOOST_PYTHON_NO_PY_SIGNATURES -DCAMERAUTIL_EXPORTS=1 -DGARCH_EXPORTS=1 -DGF_EXPORTS=1 -DGLF_EXPORTS=1 -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DHDSTORM_EXPORTS=1 -DHDST_EXPORTS=1 -DHDX_EXPORTS=1 -DHD_EXPORTS=1 -DHF_EXPORTS=1 -DHGIGL_EXPORTS=1 -DHGIINTEROP_EXPORTS=1 -DHGI_EXPORTS=1 -DHIO_EXPORTS=1 -DJS_EXPORTS=1 -DKIND_EXPORTS=1 -DMFB_ALT_PACKAGE_NAME=arch -DMFB_PACKAGE_MODULE=Arch -DMFB_PACKAGE_NAME=arch -DNDR_EXPORTS=1 -DPCP_EXPORTS=1 -DPLUG_EXPORTS=1 -DPXOSD_EXPORTS=1 -DPXR_BUILD_LOCATION=usd -DPXR_PLUGIN_BUILD_LOCATION=../plugin/usd -DPXR_PTEX_SUPPORT_ENABLED -DPXR_PYTHON_ENABLED=1 -DPXR_PYTHON_MODULES_ENABLED=1 -DSDF_EXPORTS=1 -DSDRGLSLFX_EXPORTS=1 -DSDR_EXPORTS=1 -DTF_EXPORTS=1 -DTRACE_EXPORTS=1 -DUSDAPPUTILS_EXPORTS=1 -DUSDGEOM_EXPORTS=1 -DUSDHYDRA_EXPORTS=1 -DUSDIMAGINGGL_EXPORTS=1 -DUSDIMAGING_EXPORTS=1 -DUSDLUX_EXPORTS=1 -DUSDMEDIA_EXPORTS=1 -DUSDRENDER_EXPORTS=1 -DUSDRIIMAGING_EXPORTS=1 -DUSDRI_EXPORTS=1 -DUSDSHADERS_EXPORTS=1 -DUSDSHADE_EXPORTS=1 -DUSDSKELIMAGING_EXPORTS=1 -DUSDSKEL_EXPORTS=1 -DUSDUI_EXPORTS=1 -DUSDUTILS_EXPORTS=1 -DUSDVIEWQ_EXPORTS=1 -DUSDVOLIMAGING_EXPORTS=1 -DUSDVOL_EXPORTS=1 -DUSD_EXPORTS=1 -DVT_EXPORTS=1 -DWORK_EXPORTS=1 -Iinclude -Wall -pthread -Wno-deprecated -Wno-deprecated-declarations -Wno-unused-local-typedefs -D_FORTIFY_SOURCE=2 -march=native -mtune=native -O2 -pipe -fstack-protector-strong -fno-plt -O3 -DNDEBUG -fPIC -std=c++14 -MD -MT pxr/base/arch/CMakeFiles/arch.dir/demangle.cpp.o -MF pxr/base/arch/CMakeFiles/arch.dir/demangle.cpp.o.d -o pxr/base/arch/CMakeFiles/arch.dir/demangle.cpp.o -c /build/usd-qfix/src/USD/pxr/base/arch/demangle.cpp
In file included from /build/usd-qfix/src/USD/pxr/base/arch/demangle.cpp:141:
/usr/include/c++/11.1.0/cxxabi.h:219:47: error: invalid use of incomplete type ‘class usdBlender__pxrReserved__::std::type_info’
  219 |   class __fundamental_type_info : public std::type_info
      |                                               ^~~~~~~~~
In file included from /usr/include/c++/11.1.0/cxxabi.h:52,
                 from /build/usd-qfix/src/USD/pxr/base/arch/demangle.cpp:141:
/usr/include/c++/11.1.0/bits/cxxabi_init_exception.h:52:9: note: forward declaration of ‘class usdBlender__pxrReserved__::std::type_info’
   52 |   class type_info;
      |         ^~~~~~~~~

Quick fix:

--- USD-21.02/pxr/base/arch/demangle.cpp.orig   2021-01-20 09:13:57.000000000 +0900
+++ USD-21.02/pxr/base/arch/demangle.cpp        2021-02-05 16:37:27.154126908 +0900
@@ -36,6 +36,7 @@ using std::string;
 #if (ARCH_COMPILER_GCC_MAJOR == 3 && ARCH_COMPILER_GCC_MINOR >= 1) || \
     ARCH_COMPILER_GCC_MAJOR > 3 || defined(ARCH_COMPILER_CLANG)
 #define _AT_LEAST_GCC_THREE_ONE_OR_CLANG
+#include <cxxabi.h>
 #endif
 
 PXR_NAMESPACE_OPEN_SCOPE
@@ -138,7 +139,6 @@ _StripPxrInternalNamespace(string* name)
 #endif
 
 #if defined(_AT_LEAST_GCC_THREE_ONE_OR_CLANG)
-#include <cxxabi.h>
 2. 
 /*
  * This routine doesn't work when you get to gcc3.4.
  1. sort in singularTask.cpp has to be referenced through std:: otherwise gcc:11/clang:11 complains about:
FAILED: pxr/base/work/CMakeFiles/work.dir/singularTask.cpp.o
/usr/lib/ccache/bin/clang++ -DARCH_EXPORTS=1 -DAR_EXPORTS=1 -DBOOST_PYTHON_NO_PY_SIGNATURES -DCAMERAUTIL_EXPORTS=1 -DGARCH_EXPORTS=1 -DGF_EXPORTS=1 -DGLF_EXPORTS=1 -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DHDSTORM_EXPORTS=1 -DHDST_EXPORTS=1 -DHDX_EXPORTS=1 -DHD_EXPORTS=1 -DHF_EXPORTS=1 -DHGIGL_EXPORTS=1 -DHGIINTEROP_EXPORTS=1 -DHGI_EXPORTS=1 -DHIO_EXPORTS=1 -DJS_EXPORTS=1 -DKIND_EXPORTS=1 -DMFB_ALT_PACKAGE_NAME=work -DMFB_PACKAGE_MODULE=Work -DMFB_PACKAGE_NAME=work -DNDR_EXPORTS=1 -DPCP_EXPORTS=1 -DPLUG_EXPORTS=1 -DPXOSD_EXPORTS=1 -DPXR_BUILD_LOCATION=usd -DPXR_PLUGIN_BUILD_LOCATION=../plugin/usd -DPXR_PTEX_SUPPORT_ENABLED -DPXR_PYTHON_ENABLED=1 -DPXR_PYTHON_MODULES_ENABLED=1 -DSDF_EXPORTS=1 -DSDRGLSLFX_EXPORTS=1 -DSDR_EXPORTS=1 -DTF_EXPORTS=1 -DTRACE_EXPORTS=1 -DUSDAPPUTILS_EXPORTS=1 -DUSDGEOM_EXPORTS=1 -DUSDHYDRA_EXPORTS=1 -DUSDIMAGINGGL_EXPORTS=1 -DUSDIMAGING_EXPORTS=1 -DUSDLUX_EXPORTS=1 -DUSDMEDIA_EXPORTS=1 -DUSDRENDER_EXPORTS=1 -DUSDRIIMAGING_EXPORTS=1 -DUSDRI_EXPORTS=1 -DUSDSHADERS_EXPORTS=1 -DUSDSHADE_EXPORTS=1 -DUSDSKELIMAGING_EXPORTS=1 -DUSDSKEL_EXPORTS=1 -DUSDUI_EXPORTS=1 -DUSDUTILS_EXPORTS=1 -DUSDVIEWQ_EXPORTS=1 -DUSDVOLIMAGING_EXPORTS=1 -DUSDVOL_EXPORTS=1 -DUSD_EXPORTS=1 -DVT_EXPORTS=1 -DWORK_EXPORTS=1 -Ipxr/base/work -I/build/usd21/src/USD/pxr/base/work -Iinclude -isystem /usr/include/python2.7 -Wall -pthread -Wno-deprecated -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-command-line-argument -D_FORTIFY_SOURCE=2 -march=native -mtune=native -O2 -pipe -fstack-protector-strong -fno-plt -O3 -DNDEBUG -fPIC -std=c++14 -MD -MT pxr/base/work/CMakeFiles/work.dir/singularTask.cpp.o -MF pxr/base/work/CMakeFiles/work.dir/singularTask.cpp.o.d -o pxr/base/work/CMakeFiles/work.dir/singularTask.cpp.o -c /build/usd21/src/USD/pxr/base/work/singularTask.cpp
In file included from /build/usd21/src/USD/pxr/base/work/singularTask.cpp:24:
/build/usd21/src/USD/pxr/base/work/singularTask.h:123:21: error: unknown type name 'size_t'; did you mean 'std::size_t'?
                    size_t old = count;
                    ^~~~~~
                    std::size_t
  1. <algorithm> header is missing in eventTreeBuilder.cpp and token.cpp otherwise clang:11 complains about (gcc:11 works fine without those):
FAILED: pxr/base/tf/CMakeFiles/tf.dir/token.cpp.o 
/usr/lib/ccache/bin/clang++ -DARCH_EXPORTS=1 -DAR_EXPORTS=1 -DBOOST_PYTHON_NO_PY_SIGNATURES -DCAMERAUTIL_EXPORTS=1 -DGARCH_EXPORTS=1 -DGF_EXPORTS=1 -DGLF_EXPORTS=1 -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DHDSTORM_EXPORTS=1 -DHDST_EXPORTS=1 -DHDX_EXPORTS=1 -DHD_EXPORTS=1 -DHF_EXPORTS=1 -DHGIGL_EXPORTS=1 -DHGIINTEROP_EXPORTS=1 -DHGI_EXPORTS=1 -DHIO_EXPORTS=1 -DJS_EXPORTS=1 -DKIND_EXPORTS=1 -DMFB_ALT_PACKAGE_NAME=tf -DMFB_PACKAGE_MODULE=Tf -DMFB_PACKAGE_NAME=tf -DNDR_EXPORTS=1 -DPCP_EXPORTS=1 -DPLUG_EXPORTS=1 -DPXOSD_EXPORTS=1 -DPXR_BUILD_LOCATION=usd -DPXR_PLUGIN_BUILD_LOCATION=../plugin/usd -DPXR_PTEX_SUPPORT_ENABLED -DPXR_PYTHON_ENABLED=1 -DPXR_PYTHON_MODULES_ENABLED=1 -DSDF_EXPORTS=1 -DSDRGLSLFX_EXPORTS=1 -DSDR_EXPORTS=1 -DTF_EXPORTS=1 -DTRACE_EXPORTS=1 -DUSDAPPUTILS_EXPORTS=1 -DUSDGEOM_EXPORTS=1 -DUSDHYDRA_EXPORTS=1 -DUSDIMAGINGGL_EXPORTS=1 -DUSDIMAGING_EXPORTS=1 -DUSDLUX_EXPORTS=1 -DUSDMEDIA_EXPORTS=1 -DUSDRENDER_EXPORTS=1 -DUSDRIIMAGING_EXPORTS=1 -DUSDRI_EXPORTS=1 -DUSDSHADERS_EXPORTS=1 -DUSDSHADE_EXPORTS=1 -DUSDSKELIMAGING_EXPORTS=1 -DUSDSKEL_EXPORTS=1 -DUSDUI_EXPORTS=1 -DUSDUTILS_EXPORTS=1 -DUSDVIEWQ_EXPORTS=1 -DUSDVOLIMAGING_EXPORTS=1 -DUSDVOL_EXPORTS=1 -DUSD_EXPORTS=1 -DVT_EXPORTS=1 -DWORK_EXPORTS=1 -Iinclude -isystem /usr/include/python2.7 -Wall -pthread -Wno-deprecated -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-command-line-argument -D_FORTIFY_SOURCE=2 -march=native -mtune=native -O2 -pipe -fstack-protector-strong -fno-plt -O3 -DNDEBUG -fPIC -std=c++14 -MD -MT pxr/base/tf/CMakeFiles/tf.dir/token.cpp.o -MF pxr/base/tf/CMakeFiles/tf.dir/token.cpp.o.d -o pxr/base/tf/CMakeFiles/tf.dir/token.cpp.o -c /build/usd21/src/USD/pxr/base/tf/token.cpp
/build/usd21/src/USD/pxr/base/tf/token.cpp:173:14: error: no member named 'sort' in namespace 'std'
        std::sort(sizesWithSet.begin(), sizesWithSet.end());
        ~~~~~^
1 error generated.
...
FAILED: pxr/base/trace/CMakeFiles/trace.dir/eventTreeBuilder.cpp.o 
/usr/lib/ccache/bin/clang++ -DARCH_EXPORTS=1 -DAR_EXPORTS=1 -DBOOST_PYTHON_NO_PY_SIGNATURES -DCAMERAUTIL_EXPORTS=1 -DGARCH_EXPORTS=1 -DGF_EXPORTS=1 -DGLF_EXPORTS=1 -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DHDSTORM_EXPORTS=1 -DHDST_EXPORTS=1 -DHDX_EXPORTS=1 -DHD_EXPORTS=1 -DHF_EXPORTS=1 -DHGIGL_EXPORTS=1 -DHGIINTEROP_EXPORTS=1 -DHGI_EXPORTS=1 -DHIO_EXPORTS=1 -DJS_EXPORTS=1 -DKIND_EXPORTS=1 -DMFB_ALT_PACKAGE_NAME=trace -DMFB_PACKAGE_MODULE=Trace -DMFB_PACKAGE_NAME=trace -DNDR_EXPORTS=1 -DPCP_EXPORTS=1 -DPLUG_EXPORTS=1 -DPXOSD_EXPORTS=1 -DPXR_BUILD_LOCATION=usd -DPXR_PLUGIN_BUILD_LOCATION=../plugin/usd -DPXR_PTEX_SUPPORT_ENABLED -DPXR_PYTHON_ENABLED=1 -DPXR_PYTHON_MODULES_ENABLED=1 -DSDF_EXPORTS=1 -DSDRGLSLFX_EXPORTS=1 -DSDR_EXPORTS=1 -DTF_EXPORTS=1 -DTRACE_EXPORTS=1 -DUSDAPPUTILS_EXPORTS=1 -DUSDGEOM_EXPORTS=1 -DUSDHYDRA_EXPORTS=1 -DUSDIMAGINGGL_EXPORTS=1 -DUSDIMAGING_EXPORTS=1 -DUSDLUX_EXPORTS=1 -DUSDMEDIA_EXPORTS=1 -DUSDRENDER_EXPORTS=1 -DUSDRIIMAGING_EXPORTS=1 -DUSDRI_EXPORTS=1 -DUSDSHADERS_EXPORTS=1 -DUSDSHADE_EXPORTS=1 -DUSDSKELIMAGING_EXPORTS=1 -DUSDSKEL_EXPORTS=1 -DUSDUI_EXPORTS=1 -DUSDUTILS_EXPORTS=1 -DUSDVIEWQ_EXPORTS=1 -DUSDVOLIMAGING_EXPORTS=1 -DUSDVOL_EXPORTS=1 -DUSD_EXPORTS=1 -DVT_EXPORTS=1 -DWORK_EXPORTS=1 -Ipxr/base/trace -I/build/usd21/src/USD/pxr/base/trace -Iinclude -isystem /usr/include/python2.7 -Wall -pthread -Wno-deprecated -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-command-line-argument -D_FORTIFY_SOURCE=2 -march=native -mtune=native -O2 -pipe -fstack-protector-strong -fno-plt -O3 -DNDEBUG -fPIC -std=c++14 -MD -MT pxr/base/trace/CMakeFiles/trace.dir/eventTreeBuilder.cpp.o -MF pxr/base/trace/CMakeFiles/trace.dir/eventTreeBuilder.cpp.o.d -o pxr/base/trace/CMakeFiles/trace.dir/eventTreeBuilder.cpp.o -c /build/usd21/src/USD/pxr/base/trace/eventTreeBuilder.cpp
/build/usd21/src/USD/pxr/base/trace/eventTreeBuilder.cpp:51:14: error: no member named 'sort' in namespace 'std'
        std::sort(item.second.begin(), item.second.end());
        ~~~~~^
/build/usd21/src/USD/pxr/base/trace/eventTreeBuilder.cpp:283:10: error: no member named 'reverse' in namespace 'std'
    std::reverse(children.begin(), children.end());
    ~~~~~^
/build/usd21/src/USD/pxr/base/trace/eventTreeBuilder.cpp:284:10: error: no member named 'reverse' in namespace 'std'
    std::reverse(attributes.begin(), attributes.end());
    ~~~~~^

System Information (OS, Hardware)

  • ArchLinux x64.

Package Versions

  • usd:21.05
  • gcc:11.1.0
  • clang:11.1.0
  • gcc10:10.2.0
  • python:2.7
  • boost:1.75

Build Flags

  • -DCMAKE_INSTALL_PREFIX:PATH=/usr
  • -DCMAKE_C_COMPILER=clang
  • -DCMAKE_CXX_COMPILER=clang++
  • -DPXR_BUILD_TESTS:BOOL=OFF
  • -DPXR_BUILD_MONOLITHIC:BOOL=ON
  • -DBoost_NO_BOOST_CMAKE=ON
  • -DPXR_SET_INTERNAL_NAMESPACE=usdBlender
  • -DBUILD_SHARED_LIBS=ON

Disclaimer: Everyting seems to build fain against gcc:10.2.0

@jilliene
Copy link

Filed as internal issue #USD-6764

buddly27 added a commit to wdas/unf that referenced this issue Jan 13, 2023
USD 20.11 does not build on ubuntu 22.04 due to the following issues:
- PixarAnimationStudios/OpenUSD#1546
- PixarAnimationStudios/OpenUSD#1592

Lock the platform version to Ubuntu 20.04 to test it.

USD 22.05 is also affected by the second issue, so we just bump up to
the latest version, which is 22.11, so we can keep the "ubuntu-latest"
platform.
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