isl-org / isl-org/Open3D

enable ENABLE_HEADLESS_RENDERING=ON cause undefined reference to `open3d::visualization::gui::Application::GetInstance

Open
#5,943 4 comments 0 reactions 0 assignees View on GitHub
build/install
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### Steps to reproduce the issue

#### I first cloned Open3D by:
```
```
I build C++ open3d lib from source , version: 0.16.0;
it worked well when the ENABLE_HEADLESS_RENDERING option is OFF, but when I open the Option like below and build out the lib, the bin directory in the install location is disappear:
![image](https://user-images.githubusercontent.com/9452272/220617444-dd204b66-27ab-4377-b841-bf1289d2d860.png)

when I build the demo (https://github.com/isl-org/Open3D/blob/master/examples/cpp/OffscreenRendering.cpp, the cpp in the example seems build with BUILD_GUI on ?) using the open3d lib(ENABLE_HEADLESS_RENDERING=ON) , it will be failed during linking to Open3D::Open3D with many undefined errors;

thanks for help

#### I build Open3D (on Ubuntu 18.04) with:
```
mkdir build
cd build
cmake -DCMAKE_FIND_ROOT_PATH=/usr/lib/aarch64-linux-gnu \
-DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc \
-DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++ \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_INSTALL_PREFIX=/opt/aarch64/open3d_0.16 \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_PYTHON_MODULE=OFF \
-DBUILD_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DGLIBCXX_USE_CXX11_ABI=ON \
-DENABLE_HEADLESS_RENDERING=ON \
..
make -j$(nproc)
```
![image](https://user-images.githubusercontent.com/9452272/220620248-f7a199b4-7791-4764-972f-3a4805b7fe2f.png)

when build open3d lib warning occure and the bin directory disappear when install :
the bin directory in the install location is disappear:
![image](https://user-images.githubusercontent.com/9452272/220617444-dd204b66-27ab-4377-b841-bf1289d2d860.png)
![image](https://user-images.githubusercontent.com/9452272/220625162-b77db4db-3270-48b5-8ee4-0f9d6283e648.png)

when build example , error occure:

![image](https://user-images.githubusercontent.com/9452272/220615070-7e7863c3-1343-4980-aed1-0638720d77cf.png)

### Error message

```shell
/usr/bin/ld: warning: //usr/lib/aarch64-linux-gnu/libLLVM-10.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
/usr/bin/ld: warning: //usr/lib/aarch64-linux-gnu/libLLVM-10.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
/usr/bin/ld: warning: //usr/lib/aarch64-linux-gnu/libLLVM-10.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
/usr/bin/ld: warning: //usr/lib/aarch64-linux-gnu/libLLVM-10.so.1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
CMakeFiles/easyedge_pointcloud_demo.dir/demo.cpp.o: In function `save_pointcloud2png_without_screen(int, char const**, std::shared_ptr, std::__cxx11::basic_string, std::allocator >)':
demo.cpp:(.text+0xaec): undefined reference to `open3d::visualization::gui::Application::GetInstance()'
demo.cpp:(.text+0xb00): undefined reference to `open3d::visualization::gui::Application::Initialize(int, char const**)'
demo.cpp:(.text+0xb04): undefined reference to `open3d::visualization::rendering::EngineInstance::EnableHeadless()'
demo.cpp:(.text+0xb08): undefined reference to `open3d::visualization::rendering::EngineInstance::GetInstance()'
demo.cpp:(.text+0xb10): undefined reference to `open3d::visualization::rendering::EngineInstance::GetResourceManager()'
demo.cpp:(.text+0xb38): undefined reference to `open3d::visualization::rendering::FilamentRenderer::FilamentRenderer(filament::Engine&, int, int, open3d::visualization::rendering::FilamentResourceManager&)'
demo.cpp:(.text+0xb58): undefined reference to `open3d::visualization::rendering::Open3DScene::Open3DScene(open3d::visualization::rendering::Renderer&)'
demo.cpp:(.text+0xba8): undefined reference to `open3d::visualization::rendering::Open3DScene::AddGeometry(std::__cxx11::basic_string, std::allocator > const&, open3d::geometry::Geometry3D const*, open3d::visualization::rendering::MaterialRecord const&, bool)'
demo.cpp:(.text+0xbc4): undefined reference to `open3d::visualization::rendering::Open3DScene::ShowAxes(bool)'
demo.cpp:(.text+0xbcc): undefined reference to `open3d::visualization::rendering::Open3DScene::GetCamera() const'
demo.cpp:(.text+0xc1c): undefined reference to `open3d::visualization::rendering::Open3DScene::GetCamera() const'
demo.cpp:(.text+0xcc8): undefined reference to `open3d::visualization::rendering::Open3DScene::GetView() const'
demo.cpp:(.text+0xcd4): undefined reference to `open3d::visualization::rendering::Open3DScene::GetScene() const'
demo.cpp:(.text+0xcfc): undefined reference to `open3d::visualization::gui::Application::RenderToImage(open3d::visualization::rendering::Renderer&, open3d::visualization::rendering::View*, open3d::visualization::rendering::Scene*, int, int)'
demo.cpp:(.text+0xd84): undefined reference to `open3d::visualization::rendering::Open3DScene::~Open3DScene()'
demo.cpp:(.text+0xdbc): undefined reference to `open3d::visualization::gui::Application::OnTerminate()'
collect2: error: ld returned 1 exit status
```

### Open3D, Python and System information

```markdown
- Operating system: Ubuntu 18.04
- System architecture: x86 / arm64
- build from source
- Compiler version (if built from source): gcc 7.5 / clang 7.0
```

### Additional information

And we can see there is no EnableHeadless in libOpen3D.so build with ENABLE_HEADLESS_RENDERING=ON
![image](https://user-images.githubusercontent.com/9452272/220644264-090f0f60-de2c-466f-8be4-d204cd1cfdb8.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.