Out-of-source build

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
HarryvL
Veteran
Posts: 1337
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Out-of-source build

Post by HarryvL »

Hi, I am trying an out-of-source build and am hitting the following error. Can somebody push me in the right direction, please? Thanks, Harry

Code: Select all

[ 28%] Built target FreeCADGui
[ 28%] Linking CXX executable ../../bin/FreeCAD
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_generate@UUID_1.0'
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_unparse_lower@UUID_1.0'
collect2: error: ld returned 1 exit status
src/Main/CMakeFiles/FreeCADMain.dir/build.make:128: recipe for target 'bin/FreeCAD' failed
make[2]: *** [bin/FreeCAD] Error 1
CMakeFiles/Makefile2:839: recipe for target 'src/Main/CMakeFiles/FreeCADMain.dir/all' failed
make[1]: *** [src/Main/CMakeFiles/FreeCADMain.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Out-of-source build

Post by triplus »

HarryvL wrote: Mon Jun 11, 2018 2:03 am Hi, I am trying an out-of-source build and am hitting the following error.
How are you doing that? Something like:

Code: Select all

mkdir build
cd build
cmake ..
Can somebody push me in the right direction, please?
When you do the cmake .. step are any warnings noticed in the output?
User avatar
HarryvL
Veteran
Posts: 1337
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Out-of-source build

Post by HarryvL »

Indeed, the source code is in FC>FreeCAD and the executable in FC>build. So I do the following:

Code: Select all

cd build
cmake ../FreeCAD -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Release .
make
I get plenty warnings from cmake. It looks like dependent files and directories cannot be found? Do I need set explicit paths to them somewhere?

Code: Select all

-- -- OCE/OpenCASCADE shared libraries directory: /opt/local/FreeCAD-0.17/lib
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

-- VTK components: vtkCommonCore;vtkCommonDataModel;vtkFiltersVerdict;vtkIOXML;vtkFiltersCore;vtkFiltersGeneral;vtkIOLegacy;vtkFiltersExtraction;vtkFiltersSources;vtkFiltersGeometry;vtkIOMPIParallel;vtkParallelMPI;vtkhdf5
-- Check for medfile (libmed and libmedc) ...
-- Found NETGEN version 5.3, calculated: 328448
CMake Warning at CMakeLists.txt:793 (message):
  Disable module flatmesh because it requires minimum Eigen3 version 3.3.1
  but version 3.2.92 was found


-- Checking for module 'Coin'
--   No package 'Coin' found
-- libshiboken built for Release
-- Found PySide Tools: /usr/bin/pyside-uic, /usr/bin/pyside-rcc
-- -- matplotlib-1.5.1 has been found.
-- Platform is 64-bit, set -D_OCC64
-- Build type: Release
git
/home/harry/Documents/build_FreeCAD/freecad/build/src/Build/Version.h written
-- setting gcc options: -Wall -Werror -Wno-deprecated -pedantic-errors
-- Could NOT find Boost
-- Could NOT find Boost
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   python
-- found Boost: 1_58
-- boost-incude dirs are: /usr/include
-- boost-python lib is: /usr/lib/x86_64-linux-gnu/libboost_python.so
-- boost_LIBRARY_DIRS is: /usr/lib/x86_64-linux-gnu
-- Boost_LIBRARIES is: /usr/lib/x86_64-linux-gnu/libboost_python.so
-- area module (for Path Workbench) will be installed to: /opt/local/FreeCAD-0.17/lib
-- Coin3D doc is not installed
User avatar
HarryvL
Veteran
Posts: 1337
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Out-of-source build

Post by HarryvL »

User avatar
HarryvL
Veteran
Posts: 1337
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Out-of-source build

Post by HarryvL »

I went back to latest FreeCAD/FreeCAD master, deleted Anaconda3 and tried an In-Source build using the script on the FreeCAD Wiki. Now I get:

Code: Select all

[  9%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/__/zipios++/zipoutputstream.cpp.o
make[2]: *** No rule to make target '/home/harry/anaconda3/lib/libz.so', needed by 'lib/libFreeCADBase.so'.  Stop.
CMakeFiles/Makefile2:674: recipe for target 'src/Base/CMakeFiles/FreeCADBase.dir/all' failed
make[1]: *** [src/Base/CMakeFiles/FreeCADBase.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
How is it possible that the FreeCAD build process looks for an Anaconda3 dependency?
User avatar
HarryvL
Veteran
Posts: 1337
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Out-of-source build

Post by HarryvL »

Is there a way to reset paths for all dependent libs? Clearly something went wrong along the way.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Out-of-source build

Post by Kunda1 »

I wonder if you need to do a make clean ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
HarryvL
Veteran
Posts: 1337
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Out-of-source build

Post by HarryvL »

@Kunda1 I am new at this. Is "make clean" a simple command?
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Out-of-source build

Post by triplus »

Hi @HarryvL.

Indeed some of the clues provided from your feedback indicated your build environment could be a bit borked. Not knowing the details it is hard to suggest something. What would likely work is a fresh install of operating system + installing FreeCAD build dependencies and trying to compile FreeCAD after. If you want to fix your current build environment you would likely need to think about the things you changed in the past and revert some of that.
User avatar
HarryvL
Veteran
Posts: 1337
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Out-of-source build

Post by HarryvL »

Thanks @triplus I indeed jumped to that conclusion and am currently reinstalling my virtual machine with Ubuntu 16.04. I had so many versions of FreeCAD on my machine that it was bound to go wrong at some point :shock: :oops: :(
Post Reply