Thu, 10/17/2024 - 23:36
Hi, I'm trying to build OCCT 7.8.0 statically (via spack) and am running into errors. Here is some system information:
linux-centos7-zen2
gcc/9.3.0
cmake/3.23.1
I edited the spack package configuration for opencascade (spack/var/spack/repos/builtin/packages/opencascade/package.py) by adding this:
args.append("-DBUILD_LIBRARY_TYPE=STATIC")
args.append(self.define("BUILD_MODULE_DETools", False))
Finally, I build the package using this command:
>> spack install -j 32 opencascade@7.8.0 % gcc@9.3.0
Before adding the BUILD_MODULE_DETools flag it gave this error:
6718 ../../lin64/gcc/lib/libTKExpress.a(Express.cxx.o): In function `Express::WriteFileStamp(std::ostream&)':
>> 6719 Express.cxx:(.text+0x9d): undefined reference to `OSD_Process::OSD_Process()'
>> 6720 Express.cxx:(.text+0xa5): undefined reference to `OSD_Process::SystemDate()'
Now, it gives this error:
../../lin64/gcc/lib/libTKDESTEP.a(STEPControl_ActorRead.cxx.o): In function `STEPControl_ActorRead::STEPControl_ActorRead(opencascade::handle<Interface_InterfaceModel> const&)':
STEPControl_ActorRead.cxx:(.text+0x58d): undefined reference to `Transfer_ActorOfTransientProcess::Transfer_ActorOfTransientProcess()'
../../lin64/gcc/lib/libTKDESTEP.a(STEPControl_ActorRead.cxx.o): In function `opencascade::type_instance<Transfer_ActorOfTransientProcess>::get()':
I'm out of ideas.
Thank you,
Travis
Fri, 10/18/2024 - 01:06
Hello, the issue with ExpToCas fixed in latest master.
Well, the build looks strange. Could you please remove the build cache. Looks like internal complier issue if some build processes was stopped. Could you just 'make clean' then make rebuild?
I'm not familiar with spack. If it not clears the build cache, please do it manually.
Best regards, Dmitrii.
Thu, 11/07/2024 - 16:51
Hello
FYI I am having the exact same error trying to build the 7.8.1 release on Ubuntu-22.04, using cmake 3.22.1 and gcc 11.4.0.
From a clean archive extraction and build directory, the command I'm using to build is:
I have attached a log of the build output and errors.
Do you know how I can fix / workaround these errors with static build?
Thanks!
Thu, 11/07/2024 - 17:41
Hello, I assume the issue on DCMAKE_POSITION_INDEPENDENT_CODE=ON. Could you remove that setting and check?
It is totally not related with the original issue.
Best regards, Dmitrii.
Fri, 11/08/2024 - 04:56
FYI I tried removing -DCMAKE_POSITION_INDEPENDENT_CODE=ON from the cmake command, but still get the same build errors.
I won't attach a new build log file as it is essentially the same, but the errors all occur attempting to link DRAWEXE. If I remove DRAWEXE from
adm/MODULES
then the build completes successfully.Edit: With DRAWEXE excluded it also builds successfully with -DCMAKE_POSITION_INDEPENDENT_CODE=ON enabled.
Fri, 11/08/2024 - 10:14
Thank you. I will tes it more careful. It is first time when I hear about problem with DRAW build.
Best regards, Dmitrii.
Thu, 11/07/2024 - 17:41
Hi,
I modified the spack recipe to this (near line 196) to get it to build correctly:
spack/var/spack/repos/builtin/packages/opencascade/package.py
args = []
args.append("-DBUILD_LIBRARY_TYPE=Static")
args.append("-DBUILD_MODULE_DETools=OFF")
args.append("-DBUILD_MODULE_Draw=OFF")
So, disable DETools and Draw and enable Static is the trick. This also worked using cmake to build statically on MacOS.
Thu, 11/07/2024 - 17:43
Please be careful, using static version of OCCT is limited under LGPL 2.1 license. Please be aware of the license point.
Best regards, Dmitrii.