Could not find libraries of used third-party products: 3RDPARTY_TBB_LIBRARY_DIR 3RDPARTY_TBBMALLOC_LIBRARY_DIR

Hello Guys,
When I try to configure cmake, I always got this error:

CMake Error at CMakeLists.txt:885 (message):
Could not find libraries of used third-party products:
3RDPARTY_TBB_LIBRARY_DIR 3RDPARTY_TBBMALLOC_LIBRARY_DIR

I definitely define directories to libraries:
3RDPARTY_TBBMALLOC_LIBRARY /usr/lib/x86_64-linux-gnu/libtbbmalloc.so
3RDPARTY_TBBMALLOC_LIBRARY_DIR /usr/lib/x86_64-linux-gnu/
3RDPARTY_TBB_INCLUDE_DIR /usr/include
3RDPARTY_TBB_LIBRARY /usr/lib/x86_64-linux-gnu/libtbb.so
3RDPARTY_TBB_LIBRARY_DIR /usr/lib/x86_64-linux-gnu

I also try to use the newest TBB's library TBB 4.x or 5.x (https://github.com/oneapi-src/oneTBB) but still output the same error...

What could be a problem? (Linux/Ubuntu22.04) (OCCT_7.8.0)

Thanks.
With respects, Dunja.

Dmitrii Pasukhin's picture

Hello, tbb is an optional 3rd-party. It will be planned to be erased on next release. You can turn off USE_TBB variable

Now you can use 2021.5+ versions.

The tbb dir should be going to folder containded CMake config.

Best regards, Dmitrii.

李强 李's picture

Hello, Have your problem been resolved?I have encountered a problem similar to yours,thank you!

Dmitrii Pasukhin's picture

In my case path to tbb should be "C:\work\3rdparty\tbb2021.5-install-vc140-x64\lib\cmake\TBB"

It is folder contains "TBBConfig.cmake" file. But you are free to turn off TBB usage, multithreading will be work the same with C++ threads.

Best regards, Dmitrii.

怡茜 王's picture

I turn off the Use_TBB, it can be work.
But when I use make command in the build dir, there are two errors with openvr.

[ 37%] Building CXX object src/TKService/CMakeFiles/TKService.dir/__/Aspect/Aspect_OpenVRSession.cxx.o
/home/parallels/AOI/OCCT-7_8_0/src/Aspect/Aspect_OpenVRSession.cxx:171:35: error: expected unqualified-id before ‘)’ token
171 | Aspect_OpenVRSession::VRContext() : System (NULL)
| ^
/home/parallels/AOI/OCCT-7_8_0/src/Aspect/Aspect_OpenVRSession.cxx: In member function ‘virtual void Aspect_OpenVRSession::ProcessEvents()’:
/home/parallels/AOI/OCCT-7_8_0/src/Aspect/Aspect_OpenVRSession.cxx:1037:14: warning: enumeration value ‘Aspect_XRActionType_InputSkeletal’ not handled in switch [-Wswitch]
1037 | switch (anAction->Type())
| ^
/home/parallels/AOI/OCCT-7_8_0/src/Aspect/Aspect_OpenVRSession.cxx:1037:14: warning: enumeration value ‘Aspect_XRActionType_OutputHaptic’ not handled in switch [-Wswitch]
make[2]: *** [src/TKService/CMakeFiles/TKService.dir/build.make:174: src/TKService/CMakeFiles/TKService.dir/__/Aspect/Aspect_OpenVRSession.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1939: src/TKService/CMakeFiles/TKService.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

What could be a problem? (Linux/Ubuntu22.04)

Thanks.
With respects, Dunja.

Dmitrii Pasukhin's picture

Please turn off "USE_OPENVR". Probably you have incorrect version.

Best regards, Dmitrii.

怡茜 王's picture

There are new problems...
I google for this error, it about the FFmpeg.
this is my FFmpeg version
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
configuration:
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100

error:
/usr/bin/ld: /usr/local/lib/libswscale.a(swscale.o): warning: relocation against `ff_M24B' in read-only section `.text'
/usr/bin/ld: /usr/local/lib/libswscale.a(swscale.o): relocation R_X86_64_PC32 against symbol `ff_M24A' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [src/TKService/CMakeFiles/TKService.dir/build.make:1722: lin64/gcc/lib/libTKService.so.7.8.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:1939: src/TKService/CMakeFiles/TKService.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

How to solve the problem?
Thanks.
Best regards, Dunja.

Dmitrii Pasukhin's picture

If you don't use Media playing functionality - turn off this CMake setting. Looks like you have different parameters for OCCT and FFmpeg. It will be need to re-build FFmpeg with the same setting as OCCT, in case if you need this functionality.

Best regards, Dmitrii.

Ciel Avenir's picture

Hello, for TBB I fixed in https://github.com/Open-Cascade-SAS/OCCT/pull/39 .

for FFMPEG, OCCT uses v4 API. Please migrate to v5 API.

(for now, in my company project, I set USE_FFMPEG=OFF)