For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

modular building of opencascade-7.2.0

Fabio Rossi's picture

I am trying to build in a modular way opencascade-7.2.0. In the sources directory the file adm/MODULES lists all the available modules with their first level dependencies, it is possible to selectively build a module by specifying -DBUILD_MODULE_<MODULE_NAME>=ON on the cmake command line. The build systems finds all the module dependencies automatically. Up to here everything is fine.

With a similar concept there there is the file adm/TOOLS with a list of different tools to be built. In this case it is not possible to selectively define the tools to build but all of them can be built by defining -DBUILD_Inspector on the command line. This is not a problem right now. Also in this case the build system should automatically detect the dependencies and build the appropriate required modules to get the tools. In practice instead I get an error when I try to build the tools after having disabled all the modules using this command line:

cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DOC_Overview=no -DBUILD_Inspector=yes -DBUILD_WITH_DEBUG=no  -DCMAKE_INSTALL_PREFIX=/usr/lib64/opencascade-7.2.0/ros/lin -DINSTALL_DIR_CMAKE=/usr/lib64/cmake/opencascade-7.2.0 -DINSTALL_DIR_DATA=share/data -DINSTALL_DIR_DOC=/usr/share/doc/opencascade-7.2.0 -DINSTALL_DIR_INCLUDE=inc -DINSTALL_DIR_LIB=lib64 -DINSTALL_DIR_RESOURCE=share/resources -DINSTALL_DIR_SAMPLES=share/samples -DINSTALL_DIR_TESTS=share/tests -DINSTALL_SAMPLES=yes -DINSTALL_TEST_CASES=no -DUSE_FFMPEG=no -DUSE_FREEIMAGE=no -DUSE_FREETYPE=no -DUSE_TCL=no -DUSE_GL2PS=no -DUSE_TBB=yes -DUSE_VTK=no -D3RDPARTY_QT_DIR:PATH=/usr -DBUILD_MODULE_ApplicationFramework=OFF -DBUILD_MODULE_DataExchange=OFF -DBUILD_MODULE_Draw=OFF -DBUILD_MODULE_FoundationClasses=OFF -DBUILD_MODULE_ModelingData=OFF -DBUILD_MODULE_ModelingAlgorithms=OFF -DBUILD_MODULE_Visualization=OFF -DCMAKE_BUILD_TYPE=Gentoo

I expect that the build system finds all the required toolkits to be built to get the final tools. Here is the error I get:

[  2%] Building CXX object tools/TKView/CMakeFiles/TKView.dir/__/View/View_Displayer.cxx.o
cd /var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0_build/tools/TKView && /usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_QT -DOCC_CONVERT_SIGNALS -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DTKView_EXPORTS -DView_EXPORTS -I/var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0_build/tools/TKView/TKView_autogen/include -I/var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0_build/inc -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -I/var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0_build/inc/tools   -DNDEBUG -std=c++0x -march=core2 -O2 -pipe -ggdb -fpermissive -fexceptions -fPIC -Wall -Wextra -fPIC   -fPIC -std=gnu++11 -o CMakeFiles/TKView.dir/__/View/View_Displayer.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0/tools/View/View_Displayer.cxx
In file included from /var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0_build/inc/inspector/View_Displayer.hxx:1:0,
                 from /var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0/tools/View/View_Displayer.cxx:16:
/var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0/tools/View/View_Displayer.hxx:19:37: fatal error: AIS_ListOfInteractive.hxx: No such file or directory

Any idea?

Kirill Gavrilov's picture

-DBUILD_Inspector=yes
-DBUILD_MODULE_Visualization=OFF
/var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0/tools/View/View_Displayer.hxx:19:37: fatal error: AIS_ListOfInteractive.hxx: No such file or directory

Inspector depends on Visualization module - this is why you are gettng this build failure.
You may register a bug on OCCT Bugtracker that CMake building scripts do not check such inconsistency on configuration step.

Fabio Rossi's picture

opened an issue at https://tracker.dev.opencascade.org/view.php?id=29272

Is it a dep on the full Visualization module or just a few toolkits? Is then a missing dep in the EXTERNLIB file of a specific tool?

I have tried again adding -DBUILD_MODULE_Visualization=ON but I get another error:

[ 10%] Linking CXX shared library ../../lin64/gcc/lib/libTKTInspectorAPI.so
cd /var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0_build/tools/TKTInspectorAPI && /usr/bin/cmake -E cmake_link_script CMakeFiles/TKTInsp
ectorAPI.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-g++ -fPIC -std=c++0x -march=core2 -O2 -pipe -ggdb -fpermissive -fexceptions -fPIC -Wall -Wextra -lm -Wl,-O1 -Wl,--as-needed -s
hared -Wl,-soname,libTKTInspectorAPI.so.7 -o ../../lin64/gcc/lib/libTKTInspectorAPI.so.7.2.0 @CMakeFiles/TKTInspectorAPI.dir/objects1.rsp -Wl,-rpath,/var/t
mp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0_build/lin64/gcc/lib: ../../lin64/gcc/lib/libTKernel.so.7.2.0 -lTKLCAF /usr/lib64/libQt5Widgets
.so.5.7.1 -lpthread -lrt -lstdc++ -ltbb -ltbbmalloc -ldl /usr/lib64/libQt5Gui.so.5.7.1 /usr/lib64/libQt5Core.so.5.7.1
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lTKLCAF
collect2: error: ld returned 1 exit status
make[2]: *** [tools/TKTInspectorAPI/CMakeFiles/TKTInspectorAPI.dir/build.make:154: lin64/gcc/lib/libTKTInspectorAPI.so.7.2.0] Error 1
make[2]: Leaving directory '/var/tmp/portage/sci-libs/opencascade-7.2.0/work/opencascade-7.2.0_build'
make[1]: *** [CMakeFiles/Makefile2:1398: tools/TKTInspectorAPI/CMakeFiles/TKTInspectorAPI.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

The dependency file of TKTInspectorAPI lists TKLCAF, I am trying to build in parallel mode (-j8 option to make) so this smells like a race condition.

Kirill Gavrilov's picture

cannot find -lTKLCAF
-DBUILD_MODULE_ApplicationFramework=OFF

TKLCAF is in ApplicationFramework.

I am trying to build in parallel mode (-j8 option to make) so this smells like a race condition.

It is unlikely - OCCT is also built in parallel mode within regular certification process (e.g. several time per day).

Fabio Rossi's picture

Also Draw is needed, I have successfully built with -DBUILD_MODULE_ApplicationFramework=ON -DBUILD_MODULE_DataExchange=OFF -DBUILD_MODULE_Draw=ON -DBUILD_MODULE_FoundationClasses=OFF -DBUILD_MODULE_ModelingData=OFF -DBUILD_MODULE_ModelingAlgorithms=OFF -DBUILD_MODULE_Visualization=ON

Instead of requiring the full modules, maybe it would be possible to modify the build system to select only the needed toolkits which are already specified in the EXTERNLIB file in each tool directory.

Andrey BETENEV's picture

You can build only necessary toolkits (including dependencies) with CMake option BUILD_ADDITIONAL_TOOLKITS (instead of using BUILD_MODULE_...).
See https://dev.opencascade.org/doc/overview/html/occt_dev_guides__building_... :

BUILD_ADDITIONAL_TOOLKITS

Semicolon-separated individual toolkits to include into build process. If you want to build some particular libraries (toolkits) only, then you may uncheck all modules in the corresponding BUILD_MODUE_<MODULE> options and provide the list of necessary libraries here. Of course, all dependencies will be resolved automatically

Fabio Rossi's picture

I meant that the build system should automatically select only the needed toolkits, if possible, when using

-DBUILD_Inspector=yes -DBUILD_MODULE_ApplicationFramework=OFF -DBUILD_MODULE_DataExchange=OFF -DBUILD_MODULE_Draw=OFF -DBUILD_MODULE_FoundationClasses=OFF -DBUILD_MODULE_ModelingData=OFF -DBUILD_MODULE_ModelingAlgorithms=OFF -DBUILD_MODULE_Visualization=OFF

Now it's necessary to build with

-DBUILD_Inspector=yes -DBUILD_MODULE_ApplicationFramework=Yes -DBUILD_MODULE_Draw=Yes -DBUILD_MODULE_Visualization=Yes

and I was wondering if only a subset of all the toolkits included with the three modules can be built to satisfy the BUILD_Inspector dependencies.