Thu, 05/04/2023 - 15:58
I am trying to build OCCT version 7.7.1 from this link https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=ffce0d66bbaafe3a95984d0e61804c201b9995d2;sf=zip which was given in a comment from this page https://dev.opencascade.org/content/open-cascade-technology-771-maintenance-release#comments.
I am building static libraries with all USE variables (in cmake-gui) disabled and building all the modules except Visualization and Draw.
The build fails because of undefined reference errors when building the ExpToCasExe target (running make
after having configured and generated with cmake-gui):
[100%] Linking CXX executable ../../lin64/gcc/bin/ExpToCasExe
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express.cxx.o): in function `Express::WriteFileStamp(std::ostream&)':
Express.cxx:(.text+0xb4): undefined reference to `OSD_Process::OSD_Process()'
/usr/bin/ld: Express.cxx:(.text+0xbc): undefined reference to `OSD_Process::SystemDate()'
/usr/bin/ld: Express.cxx:(.text+0xe5): undefined reference to `OSD_Environment::OSD_Environment(TCollection_AsciiString const&)'
/usr/bin/ld: Express.cxx:(.text+0xfd): undefined reference to `OSD_Environment::Value()'
/usr/bin/ld: Express.cxx:(.text+0x19f): undefined reference to `OSD_Process::UserName()'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Entity.cxx.o): in function `Express_Entity::writeIncludes(std::ostream&) const':
Express_Entity.cxx:(.text+0x1ebd): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0x1ec8): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Entity.cxx.o): in function `Express_Entity::GenerateClass() const':
Express_Entity.cxx:(.text+0x9b67): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0x9b72): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0xb62e): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0xb63e): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0xc3b6): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0xc3d3): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Enum.cxx.o): in function `Express_Enum::GenerateClass() const':
Express_Enum.cxx:(.text+0x4f4): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Enum.cxx:(.text+0x4ff): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Select.cxx.o): in function `Express_Select::generateSelectMember(opencascade::handle<TColStd_HSequenceOfInteger> const&) const':
Express_Select.cxx:(.text+0x33c): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Select.cxx:(.text+0x347): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Select.cxx.o): in function `Express_Select::GenerateClass() const':
Express_Select.cxx:(.text+0x193e): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Select.cxx:(.text+0x1949): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/ExpToCasExe/CMakeFiles/ExpToCasExe.dir/build.make:132: lin64/gcc/bin/ExpToCasExe-7.7.1] Error 1
make[1]: *** [CMakeFiles/Makefile2:2299: src/ExpToCasExe/CMakeFiles/ExpToCasExe.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
I specifically downloaded this version because here: https://dev.opencascade.org/content/open-cascade-technology-771-maintenance-release it is stated this problem was fixed: 33235: Configuration - Solving the problem with static building of ExpToCasExe
Any tips or help is appreciated.
PS: I can see some symbols like OSD_Process
are defined in libTKernel.a
but maybe for some reason ExpToCasExe target does not link to it? Anyway I do NOT need this executable. Just all the .a
files.
Thu, 05/04/2023 - 16:31
Hello,
I am very sorry for your negative experience. I recommend you to change the file "occt/adm/MODULES" by removing the projects "TKExpress" and "ExpToCasExe" from "DataExchange".
In the 7.7.2 release we will fix this problem and put these projects in a separate module. This is in case you don't need these modules. They are external and our other projects do not depend on them. Otherwise, let me know and I'll fix the problem shortly.
But can you share a your gcc version for accurate reproduction.
Best regards, Dmitrii.
Thu, 05/04/2023 - 23:01
Thanks, I appreciate the swift answer.
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
I am testing it on this simple Dockerfile (
ubuntu:latest
gives me anlsb_release -a
output of 22.04)Edit: your suggestion worked. Thanks.
Sun, 07/16/2023 - 16:26
Hi, I am just noting that this is still an issue on 7.8.0 - I removed
TKExpress
fromocct/adm/MODULES
, but I cannot findDataExchange
from whereExpToCasExe
has to be removed. Could you specify further? Thanks.Sun, 07/16/2023 - 17:25
Hello, on 7.8.0 dev you need to disable "BUILD_MODULE_DETools"
Best regards, Dmitrii.
Fri, 09/27/2024 - 21:15
I just had the same issue and found this comment very helpful. Note, though, that capitalization matters, and it's really how Dmitrii said:
BUILD_MODULE_DETools
notBUILD_MODULE_DETOOLS
.Tue, 10/08/2024 - 11:58
I was trying on GCC and Clang and msvc with static build on latest master. Everything is build correct.
Could you share your CMake parameters or compiler version?
Best regards, Dmitrii.
Sat, 09/28/2024 - 12:50
My apologies about that issue. I will plan that for the ongoing release. Static build is crucial for webassem.
Additionally, I will check and option for case insensitive names.
Best regards, Dmitrii.