Used to compile perfectly now it FAILS!

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Used to compile perfectly now it FAILS!

Post by hhassey »

I used to compile about once a week, just to have the latest, life was good with only "make -j 9 " but since about a week my system has failed to compile with the following error...
any ideas?

/opt/free-cad-code/src/Mod/Part/App/TopoShapePyImp.cpp:2653:50: error: no ‘PyObject* Part::TopoShapePy::defeaturing(PyObject*)’ member function declared in class ‘Part::TopoShapePy’
PyObject* TopoShapePy::defeaturing(PyObject *args)
^
[ 53%] Building CXX object src/Mod/Part/App/CMakeFiles/Part.dir/Geometry.cpp.o




CMakeFiles/Makefile2:1730: recipe for target 'src/Mod/Part/App/CMakeFiles/Part.dir/all' failed
make[1]: *** [src/Mod/Part/App/CMakeFiles/Part.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 58%] Building CXX object src/Mod/Spreadsheet/Gui/CMakeFiles/SpreadsheetGui.dir/PropertiesDialog.cpp.o
[ 58%] Linking CXX shared library ../../../../Mod/Start/StartGui.so
[ 59%] Built target StartGui
[ 59%] Linking CXX shared library ../../../../Mod/Spreadsheet/SpreadsheetGui.so
[ 59%] Built target SpreadsheetGui
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Used to compile perfectly now it FAILS!

Post by wmayer »

I used to compile about once a week, just to have the latest, life was good with only "make -j 9 " but since about a week my system has failed to compile with the following error...
any ideas?
Most likely this happens when you once did an in-source build and later switched to an out-of-source build. The compiler first takes a generated and not updated file from the source tree instead of the new one of the build tree.
Long story short: Go to the directory Mod/Part/App of your source tree and delete the files TopoShapePy.cpp and TopoShapePy.h. However, your source tree will contain many more generated files and it's best to use git status to get all of them, they are marked as untracked files.
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: Used to compile perfectly now it FAILS!

Post by hhassey »

Thanks @wmayer did you mean delete TopoShapePyImp.cpp instead of TopoShapePy.cpp And I don't seem to have a TopoShapePy.h

Thanks in advance
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Used to compile perfectly now it FAILS!

Post by wmayer »

Don't delete TopoShapePyImp.cpp, it's a manually written file. TopoShapePy.cpp and TopoShapePy.h are generated files in if they are inside the source tree delete them.
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: Used to compile perfectly now it FAILS!

Post by hhassey »

Ok @wmayer thanks so much, deleting those two files took the compilation process way further, but still crashes with this errors now:

https://pastebin.com/du2tYVSR

Thanks in advance.

Is it possible to delete the whole build directory, git status does not give me the list you said instead only shows my /buid-directory as not tracked...
User avatar
kkremitzki
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Used to compile perfectly now it FAILS!

Post by kkremitzki »

hhassey wrote: Thu Aug 16, 2018 5:14 pm Ok @wmayer thanks so much, deleting those two files took the compilation process way further, but still crashes with this errors now:

https://pastebin.com/du2tYVSR

Thanks in advance.

Is it possible to delete the whole build directory, git status does not give me the list you said instead only shows my /buid-directory as not tracked...
Check out git-clean. I usually do something like:

Code: Select all

git clean -fd
which (-f) force-cleans (-d) untracked directories as well as files.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: Used to compile perfectly now it FAILS!

Post by hhassey »

@Wmayer thank you so much!! I ended up deleting everything but the .git folder and starting from scratch, 12 minutes later I have my 14340 Revision Working!!!

I love FreeCAD!

and I love this community. thanks for the help :)
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: Used to compile perfectly now it FAILS!

Post by hhassey »

By the way, the wiki https://www.freecadweb.org/wiki/CompileOnUnix for building needs to be updated:

There are 4 ways to compile:
1 In Source
1.1 Debug
1.2 Release

2 Out of Source
2.1 Debug
2.2 Release

The command
cmake -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Debug .

Needs to end In .. Not in . for an out of source build, but it is not explicit in the wiki.



Also at the beginning it states to clone the repo to use:
git clone https://github.com/FreeCAD/FreeCAD.git free-cad-code

So all the repo is in a folder called free-cad-code not freecad
in the Out of source specific instructions it reads:

mkdir freecad-build
cd freecad-build
cmake ../freecad (or whatever the path is to your FreeCAD source folder) #WHY NOT PUT free-cad-code TO BE CONSISTENT?
# Note: to speed up build use all CPU cores: make -j$(nproc)
make


Just what I encountered right now building FreeCAD
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Used to compile perfectly now it FAILS!

Post by wmayer »

I have found the reason of the failure. It happened due to a regression caused by a PR https://github.com/FreeCAD/FreeCAD/pull/1522
When changing one of the involved Python scripts or the XML file then the generated .cpp files were not updated. This should now be fixed again in git commit fc6e6a55e
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Used to compile perfectly now it FAILS!

Post by NormandC »

wmayer wrote: Sun Aug 19, 2018 11:34 am It happened due to a regression caused by a PR https://github.com/FreeCAD/FreeCAD/pull/1522
Since this PR was also applied to the releases/FreeCAD-0-17 branch, shouldn't your fix be applied to it as well?
Post Reply