System Spec:
MacOS Big Sur 11.2.3
MacBook Pro 16", 2019
2,3 GHz 8-Core Intel Core i9
32 GB 2667 MHz DDR4
According to the the documentation https://wiki.freecadweb.org/Compile_on_MacOS I started to install the dependencies. I had homebrew already installed so I could easily follow the steps from the documentation page.
I cloned the github repo to ~/FreeCAD/source.
My settings to run CMake are as follows:
Code: Select all
export PREFIX_PATH="/usr/local/Cellar/qt5152/5.15.2/lib/cmake;/usr/local/opt/qt/lib/cmake/;/usr/local/Cellar/nglib/v6.2.2007/Contents/Resources;/usr/local/Cellar/vtk@8.2.0/8.2.0_1/lib/cmake/vtk-8.2;/usr/local/opt/boost-python3@1.75.0/lib/cmake"
cd ./build
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_QT5=1 \
-DWITH_PYTHON3=1 \
-DCMAKE_PREFIX_PATH="$PREFIX_PATH" \
-DPYTHON_EXECUTABLE="/usr/local/bin/python3" \
-DFREECAD_USE_EXTERNAL_KDL=1 \
-DCMAKE_CXX_FLAGS='-std=c++14' \
-DBUILD_FEM_NETGEN=1 \
-DFREECAD_CREATE_MAC_APP=1 \
-DCMAKE_INSTALL_PREFIX="./.." \
../source/
Code: Select all
brew install coin3d
Code: Select all
CMake Error in src/Gui/CMakeLists.txt:
Imported target "Shiboken2::libshiboken" includes non-existent path
"/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9
"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
Now I can start the build process by running
Code: Select all
make -j6 install
Compilation stops with several errors, all like this:
Code: Select all
src/Mod/TechDraw/Gui/CMakeFiles/TechDrawGui.dir/flags.make:8: *** missing separator. Stop.
Code: Select all
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.20
# compile CXX with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
CXX_DEFINES = -DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PP_VARIADICS=1 -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DGL_SILENCE_DEPRECATION -DHAVE_CONFIG_H -DHAVE_FREEIMAGE -DHAVE_LIMITS_H -DHAVE_RAPIDJSON -DHAVE_TBB -DMOD_TECHDRAW_HANDLE_FACES=1 -DNDEBUG -DOCC_CONVERT_SIGNALS -DPYSIDE_QML_SUPPORT=1 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WIDGETS_LIB -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DTechDrawGui_EXPORTS -D_OCC64
CXX_INCLUDES = -I/Users/mario/FreeCAD/build -I/Users/mario/FreeCAD/build/src -I/Users/mario/FreeCAD/source/src -I/Users/mario/FreeCAD/build/src/Mod/TechDraw/Gui -I/Users/mario/FreeCAD/source/src/Mod/TechDraw/Gui -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -I/usr/local/include/opencascade -isystem /usr/local/include -iframework /usr/local/Cellar/qt5152/5.15.2/lib -isystem /usr/local/Cellar/qt5152/5.15.2/lib/QtXmlPatterns.framework/Headers -isystem /usr/local/Cellar/qt5152/5.15.2/lib/QtNetwork.framework/Headers -isystem /usr/local/Cellar/qt5152/5.15.2/lib/QtCore.framework/Headers -isystem /usr/local/Cellar/qt5152/5.15.2/./mkspecs/macx-clang -isystem /usr/local/Cellar/qt5152/5.15.2/lib/QtXml.framework/Headers -isystem /usr/local/Cellar/qt5152/5.15.2/lib/QtWidgets.framework/Headers -isystem /usr/local/Cellar/qt5152/5.15.2/lib/QtGui.framework/Headers -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenGL.framework/Headers -isystem /usr/local/Cellar/qt5152/5.15.2/lib/QtOpenGL.framework/Headers -isystem /usr/local/Cellar/qt5152/5.15.2/lib/QtPrintSupport.framework/Headers -isystem /usr/local/Cellar/qt5152/5.15.2/lib/QtSvg.framework/Headers -isystem /usr/local/Cellar/qt5152/5.15.2/include -isystem /usr/local/Cellar/qt5152/5.15.2/include/QtUiTools -isystem /usr/local/include/shiboken2 -isystem /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9
-isystem /usr/local/include/PySide2
CXX_FLAGS = -Wall -Wextra -Wpedantic -Wno-write-strings -std=c++14 -Wno-undefined-var-template -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fPIC -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -I/usr/local/Cellar/open-mpi/4.1.0/include -fPIC -std=gnu++17
This is the case for ALL flags.make files in the
Code: Select all
src/Mod/**/Gui/CMakeFiles/*Gui.dir/
I have fixed all these files by removing the newline character. First time by hand, then I have writte a small ruby script to automate this.
Now the compilation finishes without errors but when building the MacOS app bundle in the final step it says:
Code: Select all
CMake Error at src/MacAppBundle/cmake_install.cmake:74 (file):
file INSTALL cannot find
"/Users/mario/FreeCAD/source/src/MacAppBundle/import site": No such file or
directory.
Call Stack (most recent call first):
src/cmake_install.cmake:51 (include)
cmake_install.cmake:68 (include)
make: *** [install] Error 1
The FreeCAD.app file is created anyway but crashes immediately on start without any further message.
However, I can successfully start FreeCAD from the command line by launching
Code: Select all
./build/bin/FreeCAD
Does anyone has any helpful hints how to fix the CMake errors and the creation of the flags.make files?
Thank you and sorry for the long post.