[Solved] Compilation fails on Debian.

Having trouble installing or compiling FreeCAD? Get help here.
fcaduser
Posts: 191
Joined: Wed Feb 19, 2014 6:53 pm

[Solved] Compilation fails on Debian.

Postby fcaduser » Tue Aug 20, 2019 2:31 pm

Hi FC people.

I've just pulled the last code (which file holds the exact code version ?)
And so it fails.

My system : Linux station1 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u5 (2019-08-11) x86_64 GNU/Linux

make output :
[ 0%] Built target Driver
[ 1%] Built target SMDS
[ 1%] Built target SMESHDS
[ 1%] Built target DriverUNV
[ 2%] Built target DriverDAT
[ 2%] Built target DriverSTL
[ 4%] Built target SMESH
[ 4%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/MEFISTO2.dir/src/MEFISTO2/aptrte.cpp.o
In file included from /home/mainuser/softwares/freecad_source/src/3rdParty/salomesmesh/src/MEFISTO2/aptrte.cpp:27:0:
/home/mainuser/softwares/freecad_source/src/3rdParty/salomesmesh/inc/Rn.h:183:10: error: ‘istream’ does not name a type
friend istream& operator >>(istream& f, R4 & P)
^~~~~~~
/home/mainuser/softwares/freecad_source/src/3rdParty/salomesmesh/inc/Rn.h:188:10: error: ‘istream’ does not name a type
friend istream& operator >>(istream& f, R4 * P)
^~~~~~~
src/3rdParty/salomesmesh/CMakeFiles/MEFISTO2.dir/build.make:62 : la recette pour la cible « src/3rdParty/salomesmesh/CMakeFiles/MEFISTO2.dir/src/MEFISTO2/aptrte.cpp.o » a échouée
make[2]: *** [src/3rdParty/salomesmesh/CMakeFiles/MEFISTO2.dir/src/MEFISTO2/aptrte.cpp.o] Erreur 1
CMakeFiles/Makefile2:610 : la recette pour la cible « src/3rdParty/salomesmesh/CMakeFiles/MEFISTO2.dir/all » a échouée
make[1]: *** [src/3rdParty/salomesmesh/CMakeFiles/MEFISTO2.dir/all] Erreur 2
Makefile:127 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2
Thank you.
Last edited by fcaduser on Thu Aug 22, 2019 7:20 pm, edited 1 time in total.
wmayer
Site Admin
Posts: 14614
Joined: Thu Feb 19, 2009 10:32 am

Re: Compilation fails on Debian.

Postby wmayer » Tue Aug 20, 2019 2:51 pm

I see. I think the problem is that istream lacks of the std:: prefix while the use of the ostream class has the needed prefix.
So can you just open the file in an editor and add std:: before istream in the lines 183 and 188?

Let me know if this fixes the failure so we can push the change to the repository.
fcaduser
Posts: 191
Joined: Wed Feb 19, 2014 6:53 pm

Re: Compilation fails on Debian.

Postby fcaduser » Tue Aug 20, 2019 3:09 pm

grep istream /home/mainuser/softwares/freecad_source/src/3rdParty/salomesmesh/inc/Rn.h

friend std::istream& operator >> (std::istream& f, R2 & P)
friend std::istream& operator >> (std::istream& f, R2 * P)
friend std::istream& operator >> (std::istream& f, R3 & P)
friend std::istream& operator >> (std::istream& f, R3 * P)
friend istream& operator >>(istream& f, R4 & P)
friend istream& operator >>(istream& f, R4 * P)
Just edit and specify the exact namespace of istream in the header (of the two last lines) ? That's all ?
fcaduser
Posts: 191
Joined: Wed Feb 19, 2014 6:53 pm

Re: Compilation fails on Debian.

Postby fcaduser » Tue Aug 20, 2019 3:16 pm

Did it, I try again and will report.
fcaduser
Posts: 191
Joined: Wed Feb 19, 2014 6:53 pm

Re: Compilation fails on Debian.

Postby fcaduser » Tue Aug 20, 2019 5:25 pm

1) The compilation has been further, you can modify "src/3rdParty/salomesmesh/inc/Rn.h".

2) But a second problem appeared.
[ 0%] Built target Driver
[ 1%] Built target SMDS
[ 1%] Built target SMESHDS
[ 1%] Built target DriverUNV
[ 2%] Built target DriverDAT
[ 2%] Built target DriverSTL
[ 4%] Built target SMESH
[ 4%] Built target MEFISTO2
[ 6%] Built target StdMeshers
[ 9%] Built target FreeCADBase
[ 9%] Generating version_check
git
/home/mainuser/softwares/freecad_source/build_2019-08-20/src/Build/Version.h.out written
[ 9%] Generating Version.h
[ 9%] Built target fc_version
[ 12%] Built target FreeCADApp
[ 27%] Built target FreeCADGui
[ 27%] Built target FreeCADMain
[ 27%] Built target FreeCADGuiPy
[ 27%] Built target FreeCADMainCmd
[ 27%] Built target FreeCADMainPy
[ 27%] Built target Points
[ 28%] Built target PointsGui
[ 28%] Built target Complete
[ 28%] Built target CompleteGui
[ 29%] Built target Test
[ 29%] Built target QtUnitGui
[ 29%] Built target ImageScripts
[ 29%] Built target Image
[ 30%] Built target ImageGui
[ 30%] Built target MeshScripts
[ 34%] Built target Mesh
[ 35%] Built target MeshGui
[ 36%] Built target PartScripts
[ 36%] Building CXX object src/Mod/Part/App/CMakeFiles/Part.dir/PropertyTopoShape.cpp.o
/home/mainuser/softwares/freecad_source/src/Mod/Part/App/PropertyTopoShape.cpp: In function ‘Standard_Boolean BRepTools_Write(const TopoDS_Shape&, Standard_CString)’:
/home/mainuser/softwares/freecad_source/src/Mod/Part/App/PropertyTopoShape.cpp:285:3: error: ‘ofstream’ was not declared in this scope
ofstream os;
^~~~~~~~
/home/mainuser/softwares/freecad_source/src/Mod/Part/App/PropertyTopoShape.cpp:285:3: note: suggested alternatives:
In file included from /usr/include/c++/6/ios:38:0,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/sstream:38,
from /home/mainuser/softwares/freecad_source/src/Mod/Part/App/PropertyTopoShape.cpp:27:
/usr/include/c++/6/iosfwd:165:34: note: ‘std::ofstream’
typedef basic_ofstream<char> ofstream;
^~~~~~~~
/usr/include/c++/6/iosfwd:165:34: note: ‘std::ofstream’
In file included from /home/mainuser/softwares/freecad_source/src/Base/Console.h:33:0,
from /home/mainuser/softwares/freecad_source/src/Mod/Part/App/PropertyTopoShape.cpp:52:
/home/mainuser/softwares/freecad_source/src/Base/Stream.h:306:7: note: ‘Base::ofstream’
class ofstream : public std::ofstream
^~~~~~~~
/home/mainuser/softwares/freecad_source/src/Mod/Part/App/PropertyTopoShape.cpp:287:18: error: ‘os’ was not declared in this scope
OSD_OpenStream(os, File, ios::out);
^~
/home/mainuser/softwares/freecad_source/src/Mod/Part/App/PropertyTopoShape.cpp:287:28: error: ‘ios’ has not been declared
OSD_OpenStream(os, File, ios::out);
^~~
src/Mod/Part/App/CMakeFiles/Part.dir/build.make:1445 : la recette pour la cible « src/Mod/Part/App/CMakeFiles/Part.dir/PropertyTopoShape.cpp.o » a échouée
make[2]: *** [src/Mod/Part/App/CMakeFiles/Part.dir/PropertyTopoShape.cpp.o] Erreur 1
CMakeFiles/Makefile2:1877 : la recette pour la cible « src/Mod/Part/App/CMakeFiles/Part.dir/all » a échouée
make[1]: *** [src/Mod/Part/App/CMakeFiles/Part.dir/all] Erreur 2
Makefile:127 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2
user1234
Posts: 181
Joined: Mon Jul 11, 2016 5:08 pm

Re: Compilation fails on Debian.

Postby user1234 » Tue Aug 20, 2019 5:42 pm

For me Debain 10 compiles fine. Here my script:

Code: Select all

cmake \
-DCMAKE_CXX_COMPILER="/usr/bin/mpic++" \
-DCMAKE_CXX_FLAGS="-I/usr/include/hdf5/openmpi -I/usr/include/mpi" \
-DBUILD_ENABLE_CXX_STD=C++17 \
-DBUILD_FEM=1 \
-DBUILD_FEM_NETGEN=0 \
-DBUILD_FLAT_MESH=1 \
-DBUILD_QT5=1 \
-DBUILD_SHIP=0 \
-DBUILD_START=0 \
-DBUILD_WEB=0 \
-DCMAKE_BUILD_TYPE=DebWithRelInfo \
-DFREECAD_BUILD_DEBIAN=1 \
-DFREECAD_USE_OCC_VARIANT="Official Version" \
-DFREECAD_USE_PYBIND11=1 \
-DFREECAD_USE_QTFILEDIALOG=1 \
-DPYTHON_BASENAME=".cpython-37m-x86_64-linux-gnu" \
-DPYTHON_CONFIG_SUFFIX=".cpython-37m-x86_64-linux-gnu" \
-DPYTHON_EXECUTABLE="/usr/bin/python3.7" \
-DPYTHON_INCLUDE_DIR="/usr/include/python3.7m" \
-DPYTHON_LIBARY="/usr/lib/x86_64-linux-gnu/libpython3.7m.so" \
sourcecodefolder
As far as i know the DCMAKE_CXX_COMPILER and DCMAKE_CXX_FLAGS have an impact on salomemesh. Correct me if i am wrong.

Greetings
user
fcaduser
Posts: 191
Joined: Wed Feb 19, 2014 6:53 pm

Re: Compilation fails on Debian.

Postby fcaduser » Tue Aug 20, 2019 5:50 pm

@user 1234

Thank you. Are you using Stretch or Buster ? I'm still on Stretch but I'm planing to switch to Buster during september.
user1234
Posts: 181
Joined: Mon Jul 11, 2016 5:08 pm

Re: Compilation fails on Debian.

Postby user1234 » Tue Aug 20, 2019 6:11 pm

Debian 10 (i think that is Buster). But the procedure should be the same. Maybe you have a other Qt or Python version. But this should not impact on salomemesh. But you need pyside2 id you built it with Qt5 and Python 3.x . I do not know if Debian 9 have this.

fyi: I use Debian 10 a very long time. I do not have any problem with that.

Greetings
user
reox
Posts: 628
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Compilation fails on Debian.

Postby reox » Tue Aug 20, 2019 6:17 pm

AFAIK the build dependencies are not met in stretch. You need at least buster or backport the dependencies yourself.
I builded on buster sucessful, and bullseye and sid are working even better. There is only the "issue" that gcc9 in sid produces thousands more warnings when compiling. I use this to compile: https://github.com/reox/FreeCAD_gitpack ... bian/rules
fcaduser
Posts: 191
Joined: Wed Feb 19, 2014 6:53 pm

Re: Compilation fails on Debian.

Postby fcaduser » Tue Aug 20, 2019 6:20 pm

Can you type "uname -a" in a command line, please ?

Yes, I hope it will entail only little adjustment.