effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Post by Jee-Bee »

I have a compiled version of FreeCAD on my ubuntu VM
now i want create another version while checking the cmake.txt i saw this function -DCMAKE_INSTALL_PREFIX
when compiling multiple versions of FreeCAD what would happens with the existing FreeCAD if my new build breaks anything?
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Post by sgrogan »

Jee-Bee wrote:I have a compiled version of FreeCAD on my ubuntu VM
now i want create another version while checking the cmake.txt i saw this function -DCMAKE_INSTALL_PREFIX
when compiling multiple versions of FreeCAD what would happens with the existing FreeCAD if my new build breaks anything?
This switch only is relevant if you run "make install" or "sudo make install"
If you don't build the install project, and run FreeCAD from the bin directory of the build folder, all the builds are independent. They only share the common system libraries of the dependencies.
If you are building the install project you will want to change the install prefix so the new build doesn't overwrite the old one.
"fight the good fight"
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Post by kkremitzki »

If you're testing builds, you don't necessarily need to run make install, unless you're specifically testing that port of the build process. Once you've done a cmake and make, you will have a FreeCAD binary at bin/FreeCAD inside your build folder. Unless you proceed to run make install the build results will never get copied anywhere and won't affect your existing FC installation. If you did run make install and didn't change your install prefix, it would overwrite the existing installation at that path.
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.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Post by Jee-Bee »

oke summery for me
if i just use cmake and make i can use it locally(place of compiling)
and if i use cmake and make install i create some binary in usr/local/... etc (or wherever i want)
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Post by Jee-Bee »

Crashed...:

Code: Select all

[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/QuantitySpinBox.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/SpinBox.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/Splashscreen.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/WidgetFactory.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/Widgets.cpp.o
In file included from /home/jee-bee/FCdev/FreeCAD/src/Gui/WidgetFactory.cpp:61:0:
/usr/include/shiboken/conversions.h: In static member function ‘static T Shiboken::ValueTypeConverter<T>::toCpp(PyObject*)’:
/usr/include/shiboken/conversions.h:191:22: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
                 std::auto_ptr<T> cptr_auto_ptr(cptr);
                      ^
In file included from /usr/include/c++/5/memory:81:0,
                 from /usr/include/shiboken/conversions.h:28,
                 from /home/jee-bee/FCdev/FreeCAD/src/Gui/WidgetFactory.cpp:61:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/Window.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/MDIView.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/GraphvizView.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/ActiveObjectList.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/DockWindowManager.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/MenuManager.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/PythonWorkbenchPyImp.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/ToolBarManager.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/ToolBoxManager.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/Workbench.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/WorkbenchFactory.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/WorkbenchManager.cpp.o
[ 63%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/WorkbenchPyImp.cpp.o
[ 64%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/SelectionObjectPyImp.cpp.o
[ 64%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/SelectionObject.cpp.o
[ 64%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/Selection.cpp.o
[ 64%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/SelectionFilter.cpp.o
[ 64%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/PreCompiled.cpp.o
In file included from /home/jee-bee/FCdev/FreeCAD/src/Gui/SelectionFilter.cpp:355:0:
lex.SelectionFilter.c: In function ‘int SelectionParser::yy_get_next_buffer()’:
lex.SelectionFilter.c:1114:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
[ 64%] Linking CXX shared library ../../lib/libFreeCADGui.so
[ 64%] Built target FreeCADGui
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
It looks that something has to do with the gui but i didn't change anything about that...
This was the cmake tekst

Code: Select all

cmake ../FreeCAD -DCMAKE_INSTALL_PREFIX:PATH=/opt/local/FreeCAD-0.17 -DBUILD_FEM_NETGEN=1  -DCMAKE_CXX_FLAGS="-DNETGEN_V5"  -DNETGEN_ROOT=/opt/local/FreeCAD-0.17  -DFREECAD_USE_OCC_VARIANT="Official Version"  -DOCC_INCLUDE_DIR=/opt/local/FreeCAD-0.17/include/opencascade  -DOCC_LIBRARY=/opt/local/FreeCAD-0.17/lib/libTKernel.so -DBUILD_VR=OFF -DBUILD_TECHDRAW=OFF -DBUILD_SPREADSHEET=OFF -DBUILD_SHIP=OFF -DBUILD_ROBOT=OFF -DBUILD_REVERSEENGINEERING=OFF -DBUILD_RAYTRACING=OFF -DBUILD_POINTS=OFF -DBUILD_PATH=OFF -DBUILD_OPENSCAD=OFF -DBUILD_IMAGE=OFF -DBUILD_ARCH=OFF
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Post by Jee-Bee »

oke run it another time and again two error but know on different locations

Code: Select all

[ 62%] Linking CXX shared library ../../../../Mod/Inspection/Inspection.so
[ 62%] Building CXX object src/Mod/Web/Gui/CMakeFiles/WebGui.dir/Workbench.cpp.o
/usr/bin/ld: cannot find -lPoints
collect2: error: ld returned 1 exit status
src/Mod/Inspection/App/CMakeFiles/Inspection.dir/build.make:170: recipe for target 'Mod/Inspection/Inspection.so' failed
make[2]: *** [Mod/Inspection/Inspection.so] Error 1
CMakeFiles/Makefile2:3003: recipe for target 'src/Mod/Inspection/App/CMakeFiles/Inspection.dir/all' failed
make[1]: *** [src/Mod/Inspection/App/CMakeFiles/Inspection.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 62%] Building CXX object src/Mod/Web/Gui/CMakeFiles/WebGui.dir/BrowserView.cpp.o
[ 62%] Building CXX object src/Mod/Web/Gui/CMakeFiles/WebGui.dir/CookieJar.cpp.o
[ 62%] Linking CXX shared library ../../../../Mod/Web/WebGui.so
[ 62%] Built target WebGui
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
have anybody an idea?
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Post by wmayer »

Your build logs only show that there is an error but none of the show the right location where the actual problem occurred. You should just run make without any further parameters (especially not -j) so that it hopefully stops where the build fails.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Post by Jee-Bee »

alse without -j i got some errors

Code: Select all

[ 74%] Building CXX object src/Mod/Drawing/App/CMakeFiles/Drawing.dir/DrawingExport.cpp.o
[ 74%] Building CXX object src/Mod/Drawing/App/CMakeFiles/Drawing.dir/ProjectionAlgos.cpp.o
[ 74%] Linking CXX shared library ../../../../Mod/Drawing/Drawing.so
/usr/bin/ld: cannot find -lSpreadsheet
collect2: error: ld returned 1 exit status
src/Mod/Drawing/App/CMakeFiles/Drawing.dir/build.make:531: recipe for target 'Mod/Drawing/Drawing.so' failed
make[2]: *** [Mod/Drawing/Drawing.so] Error 1
CMakeFiles/Makefile2:1930: recipe for target 'src/Mod/Drawing/App/CMakeFiles/Drawing.dir/all' failed
make[1]: *** [src/Mod/Drawing/App/CMakeFiles/Drawing.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Again on a different place... however i don need drawing at all... so i can remove it from compiling but i think it crash somewhere else
Edit i compile without spreadsheet... Are there more workbenches that need spreadsheet?
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: effect -DCMAKE_INSTALL_PREFIX on existing FC builds

Post by Jee-Bee »

fixed It was a reference to an workbench i didn't had...
Post Reply