compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Having trouble installing or compiling FreeCAD? Get help here.
CharlieMAC
Posts: 211
Joined: Fri Apr 25, 2014 1:59 am

Re: compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Postby CharlieMAC » Mon Feb 06, 2017 7:44 pm

It doesn't compile. It gives the following error:

Code: Select all

[ 22%] Linking CXX shared library ../../../lib/libSMESH.so
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Intracomm::Intracomm()':
DriverMED_Family.cpp:(.text._ZN3MPI9IntracommC2Ev[_ZN3MPI9IntracommC5Ev]+0x14): undefined reference to `MPI::Comm::Comm()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Intracomm::Intracomm(ompi_communicator_t*)':
DriverMED_Family.cpp:(.text._ZN3MPI9IntracommC2EP19ompi_communicator_t[_ZN3MPI9IntracommC5EP19ompi_communicator_t]+0x19): undefined reference to `MPI::Comm::Comm()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
DriverMED_Family.cpp:(.text._ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb[_ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb]+0x26): undefined reference to `ompi_mpi_cxx_op_intercept'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()'
collect2: error: ld returned 1 exit status
src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/build.make:1146: recipe for target 'lib/libSMESH.so' failed
make[2]: *** [lib/libSMESH.so] Error 1
CMakeFiles/Makefile2:574: recipe for target 'src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/all' failed
make[1]: *** [src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 22%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Part.cpp.o
[ 22%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Origin.cpp.o
[ 22%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Path.cpp.o
[ 22%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/InventorObject.cpp.o
[ 22%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/MeasureDistance.cpp.o
[ 22%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Placement.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/OriginFeature.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Range.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Transactions.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/TransactionalObject.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/VRMLObject.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/MaterialObject.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/MergeDocuments.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/DynamicProperty.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/ObjectIdentifier.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Property.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PropertyContainer.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PropertyContainerPyImp.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PropertyFile.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PropertyGeo.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PropertyLinks.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PropertyPythonObject.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PropertyStandard.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PropertyUnits.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PropertyExpressionEngine.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Application.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/ApplicationPy.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Branding.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/ColorModel.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/ComplexGeoData.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/ComplexGeoDataPyImp.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Enumeration.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Material.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/MaterialPyImp.cpp.o
[ 23%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/PreCompiled.cpp.o
[ 23%] Linking CXX shared library ../../lib/libFreeCADApp.so
[ 23%] Built target FreeCADApp
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
[  1%] Built target SMDS
[  1%] Built target Driver
[  1%] Built target DriverDAT
[  1%] Built target SMESHDS
[  1%] Built target DriverUNV
[  1%] Built target MEFISTO2
[  2%] Built target DriverSTL
[  2%] Linking CXX shared library ../../../lib/libSMESH.so
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Intracomm::Intracomm()':
DriverMED_Family.cpp:(.text._ZN3MPI9IntracommC2Ev[_ZN3MPI9IntracommC5Ev]+0x14): undefined reference to `MPI::Comm::Comm()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Intracomm::Intracomm(ompi_communicator_t*)':
DriverMED_Family.cpp:(.text._ZN3MPI9IntracommC2EP19ompi_communicator_t[_ZN3MPI9IntracommC5EP19ompi_communicator_t]+0x19): undefined reference to `MPI::Comm::Comm()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o: In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
DriverMED_Family.cpp:(.text._ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb[_ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb]+0x26): undefined reference to `ompi_mpi_cxx_op_intercept'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
CMakeFiles/SMESH.dir/src/SMESH/DriverMED_Family.cpp.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()'
collect2: error: ld returned 1 exit status
src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/build.make:1146: recipe for target 'lib/libSMESH.so' failed
make[2]: *** [lib/libSMESH.so] Error 1
CMakeFiles/Makefile2:574: recipe for target 'src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/all' failed
make[1]: *** [src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2


Am I doing something wrong here?
CharlieMAC
Posts: 211
Joined: Fri Apr 25, 2014 1:59 am

Re: compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Postby CharlieMAC » Tue Feb 07, 2017 3:23 pm

I just remembered that I'm using Debian Testing. That is why.
User avatar
red_bobcat
Posts: 4
Joined: Sun Feb 12, 2017 2:14 pm

Re: compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Postby red_bobcat » Wed Feb 15, 2017 12:54 pm

Hello! Can someone help me?
Error in installation by this script, "cmake" for netgen runs well, but when it goes to "make", it gives this

Code: Select all

make  all-recursive
make[1]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1'
Making all in libsrc
make[2]: Entering directory '/home/usernameDocuments/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc'
Making all in general
make[3]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/general'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/general'
Making all in gprim
make[3]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/gprim'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/gprim'
Making all in linalg
make[3]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/linalg'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/linalg'
Making all in include
make[3]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/include'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/include'
Making all in meshing
make[3]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/meshing'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/meshing'
Making all in interface
make[3]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/interface'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/interface'
Making all in csg
make[3]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/csg'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/csg'
Making all in geom2d
make[3]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/geom2d'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/geom2d'
Making all in occ
make[3]: Entering directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/occ'
/bin/bash ../../libtool --tag=CXX   --mode=link g++  -DNGLIB_EXPORTS -std=gnu++11 -fopenmp   -o libocc.la -rpath /opt/local/FreeCAD-0.17/lib Partition_Inter2d.lo Partition_Inter3d.lo Partition_Loop.lo Partition_Loop2d.lo Partition_Loop3d.lo Partition_Spliter.lo occconstruction.lo occgenmesh.lo occgeom.lo occmeshsurf.lo -L/opt/local/FreeCAD-0.17/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o  .libs/Partition_Inter2d.o .libs/Partition_Inter3d.o .libs/Partition_Loop.o .libs/Partition_Loop2d.o .libs/Partition_Loop3d.o .libs/Partition_Spliter.o .libs/occconstruction.o .libs/occgenmesh.o .libs/occgeom.o .libs/occmeshsurf.o   -L/opt/local/FreeCAD-0.17/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lstdc++ -lm -lgomp -lpthread -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/5/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o  -fopenmp   -fopenmp -Wl,-soname -Wl,libocc.so.0 -o .libs/libocc.so.0.0.0
/usr/bin/ld: cannot find -lFWOSPlugin
collect2: error: ld returned 1 exit status
Makefile:368: recipe for target 'libocc.la' failed
make[3]: *** [libocc.la] Error 1
make[3]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc/occ'
Makefile:311: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1/libsrc'
Makefile:354: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/username/Documents/build_FreeCAD/netgen/Netgen/netgen-5.3.1'
Makefile:285: recipe for target 'all' failed
make: *** [all] Error 2


As I can see, ls can not find FWOSPlugin, and I have no idea, why it is, were it must be, and how to fix it. OCC compiling gives no errors, (was little problem with permissions, but it fixed by chmod).
User avatar
red_bobcat
Posts: 4
Joined: Sun Feb 12, 2017 2:14 pm

Re: compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Postby red_bobcat » Wed Feb 15, 2017 1:04 pm

That what I find, but have no idea, how to fix my problem.

we had the problem with netgen nglib trying to link against FWOSPlugin. OCCT 7.0 deprecated the plugin and OCCT7.1 removed it so tyring link against it fails. Here is the [required change] (https://github.com/FreeCAD/homebrew-fre ... b6297d9dc9), albeit codified in the nglib home brew formula. Basically, you need to [patch configure](https://github.com/FreeCAD/homebrew-fre ... b#L87-L101) to remove the library reference.
User avatar
Chris_G
Posts: 354
Joined: Tue Dec 31, 2013 4:10 pm
Location: France

Re: compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Postby Chris_G » Wed Mar 01, 2017 5:09 pm

Hi,
I gave a try at compiling OCC 7.1 and FreeCAD on Kubuntu 17.04 Beta, using the script, to see how far it goes ...
I am stopped by the exact same error as red_bobcat above.

Code: Select all

/usr/bin/ld: cannot find -lFWOSPlugin

For information, I had to install also :

Code: Select all

mesa-common-dev
python2.7-dev

and to change the libboost version at the beginning of the script, from 1.58 to 1.63
Does anyone have a clue ?
Thanks,
Chris
User avatar
sgrogan
Posts: 2999
Joined: Wed Oct 22, 2014 5:02 pm

Re: compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Postby sgrogan » Wed Mar 01, 2017 5:26 pm

User avatar
bernd
Posts: 3876
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Postby bernd » Sun Mar 05, 2017 8:07 am

sgrogan wrote:I didn't try but I think just apply bblacey's patch to the netgen sources here
https://github.com/berndhahnebach/Netgen/blob/master/netgen-5.3.1/configure#L15352
do you mean this?
https://github.com/berndhahnebach/Netge ... diff=split ? It did not do the trick for me :(
User avatar
sgrogan
Posts: 2999
Joined: Wed Oct 22, 2014 5:02 pm

Re: compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Postby sgrogan » Sun Mar 05, 2017 3:31 pm

bernd wrote:do you mean this?

Yup.
bernd wrote:It did not do the trick for me :(

Hopefully we can find the culprit as part of the PPA upgrade.