Compile on Linux with gcc-c++ 8.0.1

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Linux with gcc-c++ 8.0.1

Post by sgrogan »

hobbes1069 wrote: Fri Nov 02, 2018 1:41 am I either need the bundled smesh fixed to work with GCC 8 or somewhere else to get smesh
Late to the party, but there is this fork of SMESH https://github.com/LaughlinResearch/SMESH
This is what we are using for our Conda based builds. Not sure if it works with older oce, it does work for occt 7.2 and 7.3. The good thing is it doesn't depend on the whole Salome stack.

Thanks for your work to support FreeCAD :)
"fight the good fight"
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: Compile on Linux with gcc-c++ 8.0.1

Post by freman »

wmayer wrote: Fri Nov 02, 2018 5:59 pm
I can confirm that the header fix works as well, at least on Fedora Rawhide w/ GCC 8.2.x...
Thanks for the confirmation. I have added the fix: git commit 5ff383b46
I have what may be a related Fedora build issue. I just upgraded to Fedora 29 which uses gcc version 8.2.1 20181105 .

I got FreeCAD-master on the 15th Nov.

I posted a full description here, but now found this forum may have been more suitable. ( sorry, noob around here ).

https://forum.freecadweb.org/viewtopic.php?f=10&t=32473

Bottom line is it can't find boost_python, which is in the same path as the other boost stuff:

Code: Select all

 Boost version: 1.66.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_python

Thanks to those who are more familiar in untangling the Gordian cMake knot. ;)
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Compile on Linux with gcc-c++ 8.0.1

Post by wmayer »

Bottom line is it can't find boost_python, which is in the same path as the other boost stuff:
With recent boost versions the component name of boost_python has changed and now also requires the Python version number. So, the component now is called e.g. boost_python27
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Compile on Linux with gcc-c++ 8.0.1

Post by PrzemoF »

It's boost-python2 or boost-python27? I use boost-python2 and boost-python3 like here [1].

[1] https://github.com/FreeCAD/FreeCAD/blob ... d.spec#L33
User avatar
hobbes1069
Posts: 291
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: Compile on Linux with gcc-c++ 8.0.1

Post by hobbes1069 »

For Fedora 29 and up it is boost-python2-devel
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: Compile on Linux with gcc-c++ 8.0.1

Post by freman »

Thanks for the help.

I had wondered about a name change , I added the following packages and it got past the boost_python problem and built to 77% :

dnf install boost-python3 boost-python2 boost-python3-devel boost-python2-devel \
python3-matplotlib python-pivy python-pyside python-pyside-devel smesh smesh-devel

Code: Select all

-- Checking for module 'Coin'
--   Found Coin, version 3.1.3
-- Could NOT find Spnav (missing: SPNAV_LIBRARY SPNAV_INCLUDE_DIR) 
-- Using default python: -python2.7

.....

Code: Select all

[ 77%] Building CXX object src/Mod/Fem/App/CMakeFiles/Fem.dir/AppFemPy.cpp.o
/svn/FreeCAD-master/src/Mod/Fem/App/AppFemPy.cpp: In member function ‘Py::Object Fem::Module::insert(const Py::Tuple&)’:
/svn/FreeCAD-master/src/Mod/Fem/App/AppFemPy.cpp:201:23: error: ‘Base::Exception::Exception(const Base::Exception&)’ is protected within this context
                 throw e;
                       ^
In file included from /svn/FreeCAD-master/src/Base/PyObjectBase.h:53,
                 from /svn/FreeCAD-master/src/Base/VectorPy.h:7,
                 from /svn/FreeCAD-master/src/Mod/Fem/App/AppFemPy.cpp:35:
/svn/FreeCAD-master/src/Base/Exception.h:128:3: note: declared protected here
   Exception(const Exception &inst);
   ^~~~~~~~~
make[2]: *** [src/Mod/Fem/App/CMakeFiles/Fem.dir/build.make:536: src/Mod/Fem/App/CMakeFiles/Fem.dir/AppFemPy.cpp.o] Error 1
Is that compiler differences again?

thx.
User avatar
hobbes1069
Posts: 291
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: Compile on Linux with gcc-c++ 8.0.1

Post by hobbes1069 »

Could be... Might be best to start a new thread though, technically we're on gcc 8.2.1...

Thanks,
Richard
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Compile on Linux with gcc-c++ 8.0.1

Post by PrzemoF »

Can you post results of 'git show HEAD'? I think I saw that error a few days ago and it had nothing to do with compiler.
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: Compile on Linux with gcc-c++ 8.0.1

Post by freman »

I installed from zip, not git. Should I just get a fresh copy?
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Compile on Linux with gcc-c++ 8.0.1

Post by PrzemoF »

I think so. I found the error in COPR builds [1]. The link will be valid for a limited time, so the error for future generations ;)

Code: Select all

[ 95%] Building CXX object src/Mod/Fem/App/CMakeFiles/Fem.dir/FemMeshPyImp.cpp.o
cd /builddir/build/BUILD/FreeCAD-master/build/src/Mod/Fem/App && /usr/bin/c++  -DFC_USE_VTK -DFem_EXPORTS -DHAVE_CONFIG_H -DHAVE_LIMITS_H -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WEBKIT_LIB -DQT_XML_LIB -D_OCC64 -I/builddir/build/BUILD/FreeCAD-master/build -isystem /usr/include/QtOpenGL -isystem /usr/include/QtSvg -isystem /usr/include/QtUiTools -isystem /usr/include/QtWebKit -isystem /usr/include/QtGui -isystem /usr/include/QtXml -isystem /usr/include/QtNetwork -isystem /usr/include/QtCore -I/builddir/build/BUILD/FreeCAD-master/build/src -I/builddir/build/BUILD/FreeCAD-master/src -I/builddir/build/BUILD/FreeCAD-master/build/src/Mod/Fem/App -I/usr/lib64/oce-0.18/../../include/oce -I/usr/include/python2.7 -I/builddir/build/BUILD/FreeCAD-master/src/3rdParty/salomesmesh/inc -I/usr/include/vtk -I/usr/include/freetype2  -Wall -Wextra -Wno-write-strings -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -std=c++11 -D_OCC64 -Wno-overloaded-virtual -fPIC   -o CMakeFiles/Fem.dir/FemMeshPyImp.cpp.o -c /builddir/build/BUILD/FreeCAD-master/src/Mod/Fem/App/FemMeshPyImp.cpp
/builddir/build/BUILD/FreeCAD-master/src/Mod/Fem/App/AppFemPy.cpp: In member function 'Py::Object Fem::Module::insert(const Py::Tuple&)':
/builddir/build/BUILD/FreeCAD-master/src/Mod/Fem/App/AppFemPy.cpp:201:23: error: 'Base::Exception::Exception(const Base::Exception&)' is protected within this context
                 throw e;
                       ^
In file included from /builddir/build/BUILD/FreeCAD-master/src/Base/PyObjectBase.h:53:0,
                 from /builddir/build/BUILD/FreeCAD-master/build/src/Base/VectorPy.h:7,
                 from /builddir/build/BUILD/FreeCAD-master/src/Mod/Fem/App/AppFemPy.cpp:35:
/builddir/build/BUILD/FreeCAD-master/src/Base/Exception.h:128:3: note: declared protected here
   Exception(const Exception &inst);
   ^~~~~~~~~
make[2]: *** [src/Mod/Fem/App/CMakeFiles/Fem.dir/build.make:539: src/Mod/Fem/App/CMakeFiles/Fem.dir/AppFemPy.cpp.o] Error 1
[..]
[1] https://copr-be.cloud.fedoraproject.org ... r-live.log
Post Reply