isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.22k stars 2.28k forks source link

build open3d failed with BUILD_FILAMENT_FROM_SOURCE #6005

Open lichangW opened 1 year ago

lichangW commented 1 year ago

Checklist

Steps to reproduce the issue

I first cloned Open3D by:

git clone https://github.com/isl-org/Open3D.git
cd Open3D

Then, I build Open3D (on Ubuntu 20.04, with CUDA 11.5) with:

mkdir build
cd build
cmake -DCMAKE_FIND_ROOT_PATH=/usr/lib/x86_64-linux-gnu       -DCMAKE_C_COMPILER=/usr/bin/x86_64-linux-gnu-gcc       -DCMAKE_CXX_COMPILER=/usr/bin/x86_64-linux-gnu-g++       -DCMAKE_INSTALL_PREFIX=/opt/x86_64/open3d_0.16       -DBUILD_SHARED_LIBS=ON       -DBUILD_PYTHON_MODULE=OFF       -DBUILD_EXAMPLES=OFF       -DCMAKE_BUILD_TYPE=Release       -DGLIBCXX_USE_CXX11_ABI=ON    -DBUILD_FILAMENT_FROM_SOURCE=ON    ..
make -j$(nproc)

Error message

/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament/src/ext_filament/filament/backend/src/opengl/PlatformEGLHeadless.cpp:58:5: error: unknown type name 'PFNEGLGETDISPLAYPROC'; did you mean 'PFNGLGETDOUBLEVPROC'?
    PFNEGLGETDISPLAYPROC getDisplay;
    ^~~~~~~~~~~~~~~~~~~~
    PFNGLGETDOUBLEVPROC
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament/src/ext_filament/libs/bluegl/include/GL/glcorearb.h:127:25: note: 'PFNGLGETDOUBLEVPROC' declared here
typedef void (APIENTRYP PFNGLGETDOUBLEVPROC) (GLenum pname, GLdouble *data);
                        ^
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament/src/ext_filament/filament/backend/src/opengl/PlatformEGLHeadless.cpp:59:5: error: unknown type name 'PFNEGLINITIALIZEPROC'
    PFNEGLINITIALIZEPROC initialize;
    ^
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament/src/ext_filament/filament/backend/src/opengl/PlatformEGLHeadless.cpp:60:5: error: unknown type name 'PFNEGLQUERYSTRINGPROC'; did you mean 'PFNGLGETSTRINGPROC'?
    PFNEGLQUERYSTRINGPROC queryString;
    ^~~~~~~~~~~~~~~~~~~~~
    PFNGLGETSTRINGPROC
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament/src/ext_filament/libs/bluegl/include/GL/glcorearb.h:131:35: note: 'PFNGLGETSTRINGPROC' declared here
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                                  ^
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament/src/ext_filament/filament/backend/src/opengl/PlatformEGLHeadless.cpp:61:5: error: unknown type name 'PFNEGLCHOOSECONFIGPROC'

Open3D, Python and System information

- Operating system: Ubuntu 16.04
- Python version: Python 3.5 
- Compiler version (if built from source): gcc 5.4 / clang 7.0

Additional information

it can be built successfully form https://github.com/isl-org/filament with any tag on my machine cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DCCACHE_PROGRAM=OFF -DFILAMENT_ENABLE_JAVA=OFF -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache -DCMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache -DCMAKE_CXX_FLAGS=-fno-builtin -DCMAKE_INSTALL_PREFIX=my-libs -DUSE_STATIC_CRT=OFF -DUSE_STATIC_LIBCXX=ON -DFILAMENT_SUPPORTS_VULKAN=OFF -DFILAMENT_SKIP_SAMPLES=ON -DFILAMENT_OPENGL_HANDLE_ARENA_SIZE_IN_MB=20 ..

lichangW commented 1 year ago

I replaced the filament with other version like below, the above error gone and filament built successfully in the process. image

but subsequent error occurs, I think it's because the filament version is not suitable

test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament-binaries/include/backend/DriverEnums.h:765:36: error: declaration of 'using CullingMode = enum class filament::backend::CullingMode' [-fpermissive]
     using CullingMode = CullingMode;
                                    ^
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament-binaries/include/backend/DriverEnums.h:292:12: error: changes meaning of 'CullingMode' from 'enum class filament::backend::CullingMode' [-fpermissive]
 enum class CullingMode : uint8_t {
            ^~~~~~~~~~~
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament-binaries/include/backend/DriverEnums.h:767:40: error: declaration of 'using BlendEquation = enum class filament::backend::BlendEquation' [-fpermissive]
     using BlendEquation = BlendEquation;
                                        ^
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament-binaries/include/backend/DriverEnums.h:713:12: error: changes meaning of 'BlendEquation' from 'enum class filament::backend::BlendEquation' [-fpermissive]
 enum class BlendEquation : uint8_t {
            ^~~~~~~~~~~~~
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament-binaries/include/backend/DriverEnums.h:768:40: error: declaration of 'using BlendFunction = enum class filament::backend::BlendFunction' [-fpermissive]
     using BlendFunction = BlendFunction;
                                        ^
/test/3d/Open3D_with_deps/Open3D-0.16.0/build/filament-binaries/include/backend/DriverEnums.h:722:12: error: changes meaning of 'BlendFunction' from 'enum class filament::backend::BlendFunction' [-fpermissive]
 enum class BlendFunction : uint8_t {
            ^~~~~~~~~~~~~