Installation of open cascade with draco

Hello guys,

I want to install open cascade with draco using cmake on ubantu,
Could anyone please guide me on it?
How to install draco and how to enable it during installation of open cascade?

Dmitrii Pasukhin's picture

Hello, both projects uses CMake. For build Draco you need follow:

draco/BUILDING.md at main · google/draco (github.com)

And for OpenCascade You need to specify installation folder of installation folder of darco into 3RDPARTY_DRACO_DIR.

Best regards, Dmitrii.

Swapnil Vikhe's picture

"Does the term 'Installation folder' refer to the directory where I've executed the 'git pull' command for the Draco repository, or does it indicate the 'build' folder located within the same directory?
In my scenario, I've created a folder named 'draco' and performed the 'git pull' of the Draco repository inside it. Would the command resemble the one below?"

sudo cmake -G "Unix Makefiles" -D USE_RAPIDJSON:BOOL="ON" -D USE_OPENGL:BOOL="ON" -D USE_FREEIMAGE:BOOL="ON" -DUSE_DRACO=ON -D3RDPARTY_DRACO_LIBRARY_DIR=/home/pts/downloads/draco ../source/opencascade-7.7.0
?

Dmitrii Pasukhin's picture

dir means folder where you perform "cmake install" of draco. Needs already compiled result

Best reagards, Dmitrii.

Swapnil Vikhe's picture

I have installed Open Cascade using the following command and performed the subsequent actions. Please refer to the images where I have captured the contents of the bin and include folders.

following command I have used for installing open cascade
1.sudo cmake -G "Unix Makefiles" -DUSE_RAPIDJSON:BOOL="ON" -DUSE_OPENGL:BOOL="ON" -DUSE_FREEIMAGE:BOOL="ON" -DUSE_DRACO=ON -D3RDPARTY_DRACO_LIBRARY_DIR=/usr/local/bin -D3RDPARTY_DRACO_INCLUDE_DIR=/usr/local/include ../source/opencascade-7.7.0 (Command I have used for installing open cascade)
2.sudo make
3.sudo make install
4.sudo ldconfig

Now, I am trying to build an existing project,
but it is giving the following issues: (Please refer the image as well)

/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::Encoder::SetSpeedOptions(int, int)'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `vtable for draco::Mesh'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::Encoder::SetAttributeQuantization(draco::GeometryAttribute::Type, int)'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::PointAttribute::PointAttribute()'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::Mesh::Mesh()'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::DecoderBuffer::BitDecoder::~BitDecoder()'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::EncoderBuffer::EncoderBuffer()'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::PointCloud::AddAttribute(draco::GeometryAttribute const&, bool, unsigned int)'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::DecoderBuffer::Init(char const*, unsigned long)'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::DecoderBuffer::DecoderBuffer()'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::PointAttribute::Init(draco::GeometryAttribute::Type, signed char, draco::DataType, bool, unsigned long)'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `vtable for draco::PointCloud'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::Decoder::DecodeMeshFromBuffer(draco::DecoderBuffer*)'
/usr/bin/ld: /usr/local/lib/libTKRWMesh.so.7.7.0: undefined reference to `draco::Encoder::Encoder()'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/GLTFConverter.dir/build.make:224: GLTFConverter] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/GLTFConverter.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
18:41:28: The process "/usr/bin/cmake" exited with code 2.
Error while building/deploying project GLTFConverter (kit: Desktop)
When executing step "Build"

Dmitrii Pasukhin's picture

Oh, you install draco into default folder. But we need lib folder not bin in Linux. We need .so and .lib files. OCCT don't use executable files of Draco.

Usually, I just install draco into my 3rd-party folder as a subfolder. It is easy to control and will be automatically detected.

Best regards, Dmitrii.