Build FreeCAD with OCCT

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
cad1411
Posts: 6
Joined: Tue Nov 15, 2016 12:59 am

Build FreeCAD with OCCT

Post by cad1411 »

How can I build FreeCAD-0.17_pre using a specified OCCT instead of OCE?

I removed all liboce* files building and installing opencascade-6.8.0, then specified OCC_INCLUDE_DIR=/usr/include/oce and OCC_LIBRARY=/usr/include/oce/lin64/gcc/libTKernel.so during "ccmake .." (where /usr/include/oce is the install directory I used for opencascade-6.8.0 that was built).

"ccmake .." then accepts and generates a make file with the subsequent "make -j4" terminating with errors. (make does say something about src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/...etc... in error output. However, I have updated salomesmesh during past attempts and make still fails for a large number of other unrelated reasons.)

I have looked through the "OCE and OCCT on one linux machine" (viewtopic.php?f=4&t=16837#p132978) posting which seems to address the issue not following exactly how to force a given opencascade version during the FreeCAD build.

Ubuntu 14.04.5LTS AMD64
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: Build FreeCAD with OCCT

Post by damian »

good morning @cad1411:
cad1411 wrote:make does say something about src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/...etc...
We could look over some steps ..., but first a comment:
cad1411 wrote:building and installing opencascade-6.8.0
Why do you use opencascade-6.8.0? This OCCT version basically is the same that OCE.
Every body is migrating to opencascade-7.0.0

OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8922 (Git)
Build type: Unknown
Branch: master
Hash: 7f58ad2a4bbf0daad18cf59dddf32befeca1b60a
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0

Please, could you confirm that you installed all dependencies? You could find all packages at https://github.com/FreeCAD/FreeCAD/blob ... travis.yml, lines 62 to 102.

Edit: I normally don't install liboce and oce-draw. I comment this because you can see them at travis.yml
User avatar
wandererfan
Veteran
Posts: 6321
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Build FreeCAD with OCCT

Post by wandererfan »

cad1411 wrote:How can I build FreeCAD-0.17_pre using a specified OCCT instead of OCE?
not at all elegant, but I do this:

FindOpenCasCade.cmake line 26
...
#find_package(OCE QUIET) <<<< comment this line
if(OCE_FOUND)
message(STATUS "-- OpenCASCADE Community Edition has been found.")
...

in CMake config
OCC_DIR to /usr/local/lib/cmake/opencascade
OCC_INCLUDE_DIR to /usr/local/include/opencascade
OCC_LIBRARY to /usr/local/lib/libTKernel.so

This is the only way I've managed to do it. Just have to remember not to accidentally push the modified FindOpenCasCade.cmake.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Build FreeCAD with OCCT

Post by bernd »

see also this topic ( viewtopic.php?f=4&t=16837 ) and the solution https://github.com/berndhahnebach/FreeC ... it/590ea6f But it was never merged into master for some reason ...

but the easiest way it the one from wandererfan.

bernd
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: Build FreeCAD with OCCT

Post by damian »

bernd wrote:but the easiest way it the one from wandererfan
Yes. I didn't say anything about this problem because for some reason I don't have this problem (I didn't modify anything) , but this is the main question of @cad1411.

Later, I think @cad1411 has a second problem relative to dependencies:
cad1411 wrote:make does say something about src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/...etc..
I had this problem due to the lack of some packages.

Thank @bernd for your initiative.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Build FreeCAD with OCCT

Post by bernd »

damian wrote:Yes. I didn't say anything about this problem because for some reason I don't have this problem (I didn't modify anything) , but this is the main question of @cad1411.
There is another even better solution than the one of wandererfan, but it is not smart at all. It is what I have been doing on all my machines. Just remove all oce and only use occt 7.0.0. Than you just need to specify the OCC_INCLUDE_DIR at cmake run nothing else.
cad1411
Posts: 6
Joined: Tue Nov 15, 2016 12:59 am

Re: Build FreeCAD with OCCT

Post by cad1411 »

I have been manually building OCE for OpenMP and OpenCL, the Ubuntu apt-get liboce-* was only using a single core.

It had been suggested in a number of posts I found that OCCT may show some improvement over OCE, however it doesn't seem likely since FreeCAD is obviously built for OCE and will probably just yield a modestly stable build.

Mostly this is out of comparative curiosity and not essential, the latest 0.17 build is working noticeably smoother than the 0.16 stable release and haven't had any real issues.
cad1411
Posts: 6
Joined: Tue Nov 15, 2016 12:59 am

Re: Build FreeCAD with OCCT

Post by cad1411 »

Sorry didn't read your post fully, I was using OCCT 6.8 because I from what I had read in the forums is that FreeCAD is still transitioning to OCCT 7.0 and under heavy development. I'll try rebuilding FreeCAD with OCCT 7.

By the way I do greatly appreciate your help, please keep following my posts.
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: Build FreeCAD with OCCT

Post by damian »

cad1411 wrote:I'll try rebuilding FreeCAD with OCCT 7.
I would parse the OCC directories. You said
cad1411 wrote:then specified OCC_INCLUDE_DIR=/usr/include/oce and OCC_LIBRARY=/usr/include/oce/lin64/gcc/libTKernel.so
This doesn't seem to be a good election. Read slowly which @wandererfan said to you
wandererfan wrote:OCC_DIR to /usr/local/lib/cmake/opencascade
OCC_INCLUDE_DIR to /usr/local/include/opencascade
OCC_LIBRARY to /usr/local/lib/libTKernel.so
Post Reply