Trouble on macOS, headers for compile not found

Having trouble installing or compiling FreeCAD? Get help here.
Posts: 1
Joined: Wed Nov 07, 2018 4:26 pm
Location: Munich

Trouble on macOS, headers for compile not found

Postby mmaenz » Wed Nov 07, 2018 5:46 pm


At first, many thanks to the authors of this great piece of software! Thanks for the effort you put in and this great community!

I recently tried to compile freecad as suggested in the CompileOnMac wiki page, which btw. seems pretty outdated.

I first tried to get it done with macports, installed all that is needed but cmake never produced a makefile. For those who are interested, this is what I did.
I got a list of dependencies from this post and from the homebrew formulae in github-repo:

Code: Select all

sudo port -N install gcc8 clang-7.0 llvm-5.0 cmake jpeg libpng tiff freetype fontconfig gmp isl mpfr libmpc gdbm swig freeimage eigen3 python27 hdf5 pkgconfig qt5 qt5-qtwebkit opencascade py-matplotlib xercesc3 py-pyside2 boost boost+python27+icu vtk openmpi openmpi-devel netgen coin
Only libmed(C) is not available on macports (needs to be installed via homebrew) and llvm-7.0 is unusable due to missing llvm-mcmarkup-mp-7.0

After the confusion with macports I went on with homebrew and got it managed (removed /opt/local/... from PATH and added

Code: Select all

as cmake argument).

The guide recommends running

Code: Select all

brew tap homebrew/science
which doesn't exist anymore. All has been migrated to homebrew/core.

Also I had to run

Code: Select all

brew install --only-dependencies freecad --with-packaging-utils
twice as mentioned by some topics in the forum as it tends to forget to install additional dependencies (weird?!).

cmake also depends on

Code: Select all

-DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")  \
-DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")  \
as it can't find pythonLib by itself.

Here are 2 guides I used to get a little further as the wiki wasn't helpful enough:
Building FreeCAD on MacOS X
Compiling and Installing FreeCAD

However, after 2 days of struggling I got cmake to produce a Makefile!

Only problem is that specific header files are not in the right directories:

Code: Select all

iMac:build mmaenz$ make
[  0%] Built target Driver
[  1%] Built target SMDS
[  1%] Built target DriverDAT
[  1%] Built target MEFISTO2
[  1%] Built target SMESHDS
[  1%] Built target DriverSTL
[  2%] Built target DriverUNV
[  4%] Built target SMESH
[  6%] Built target StdMeshers
[  6%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/NETGENPlugin.dir/src/NETGENPlugin/NETGENPlugin_Mesher.cpp.o
/Users/mmaenz/Projects/FreeCAD/FreeCAD-git/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp:80:10: fatal error: 'occgeom.hpp' file not
#include <occgeom.hpp>
1 error generated.
make[2]: *** [src/3rdParty/salomesmesh/CMakeFiles/NETGENPlugin.dir/src/NETGENPlugin/NETGENPlugin_Mesher.cpp.o] Error 1
make[1]: *** [src/3rdParty/salomesmesh/CMakeFiles/NETGENPlugin.dir/all] Error 2
make: *** [all] Error 2
The required header files are in /usr/local/include/netgen/include but are expected to be in /usr/local/include.
Copying header files by hand is not a proper solution. Changing header files in source is neither a solution as it wouldn't run on other systems where is seems to be pretty fine the way it is.

Here are my specs: macOS 10.12.6, running gcc8/clang-7.0/llvm-5.0 along with xcode 8.3.2 (clang-802.0.42).

My original intent was to debug and repair the UnitCalculator:
UnitsCalc.png (24.7 KiB) Viewed 151 times
It is really messed up, changes units on each valueChanged all the time and produces a mess as a result of stupid string concat operations! I like to use the UnitCalculator, I try to redo old drawings from paper, which are in imperial units to decimal units. Maybe make it dockable to the UI like other components?

Any help is really appreciated! Thanks...