Hey, I am stuck on compiling FreeCAD on macOS Big Sur. I tried two different ways, but just failed. Can someone point me in the right direction or provide a current working setup?
(I am on macOS 11.4 Big Sur running the latest homebrew setup and using the currently latest FreeCAD Master at #c401e3e from 30-06-2021.)
1. Try as per the Wiki documentation
Compile_on_MacOS
I first needed to modify the $PREFIX_PATH as QT5 and vtk have slightly different install paths:
export PREFIX_PATH="/usr/local/Cellar/qt@5/5.15.2/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"
But then cmake errors as it can’t find Coin3d:
CMake Error at cMake/FreeCAD_Helpers/SetupCoin3D.cmake:6 (message):
=================
Coin3D not found.
=================
Call Stack (most recent call first):
CMakeLists.txt:73 (SetupCoin3D)
-- Configuring incomplete, errors occurred!
But there is a coin library installed, which was done during the setup process with installing the dependencies with:
brew tap freecad/freecad
brew install eigen
brew install --only-dependencies freecad --with-packaging-utils
The coin3d library can be found at /usr/local/opt/coin@4.0.0
2. Try with using the Conda environment described in BUILD_OSX.md
Here it finds Coin3D but somehow breaks on Shiboken2Config:
-- Coin3D libraries found
-- Shiboken2Config: Using default python: .cpython-38-darwin
CMake Error at /Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/lib/cmake/Shiboken2-5.13.2/shiboken_helpers.cmake:462 (message):
The detected Python minor version is not compatible with the Python minor
version which was used when Shiboken was built. Consider building shiboken
with FORCE_LIMITED_API set to '1', so that only the Python major version
matters.
Built with: '3.8' Detected: '3.9'
Call Stack (most recent call first):
/Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/lib/cmake/Shiboken2-5.13.2/Shiboken2Config.cpython-38-darwin.cmake:45 (shiboken_check_if_built_and_target_python_are_compatible)
/Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/lib/cmake/Shiboken2-5.13.2/Shiboken2Config.cmake:5 (include)
cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake:13 (find_package)
CMakeLists.txt:75 (SetupShibokenAndPyside)
-- Configuring incomplete, errors occurred!
Any hints appreciated.
environment-osx.yml requires a fixed version of netgen, which relies on python 3.8:
and rebuild the conda environment. This way, I got FreeCAD to compile and link successfully on my MacBook, but when I launch build/bin/FreeCAD no GUI comes up. No error messages are shown in terminal. Does anyone know how to debug this?
Thank you, this helped to build FreeCad. The problem with no visible GUI is the same for me.
If I start the binary under freecad-source/build/bin/FreeCAD from the command line, it opens another terminal with a FreeCad process visible in the activity monitor. But this process is frozen and does nothing.
I read through multiple repos and forum posts and I’m no wiser.
If I start the build FreeCAD binary with the help option as listed on https://wiki.freecadweb.org/Start_up_and_Configuration, a new terminal opens and Freecad instantly freezes.
It would be nice to have a simple onboarding dev-tutorial, which introduces simple steps for a typical FreeCAD code/build/test cycle and works for Linux/Mac/Win (preferably Mac )
Some steps along this lines:
- download FreeCAD source and build a local app
- prefered build method -> conda or homebrew?
- alternative method
- build within a separate /build directory not under /source (as the current conda process does within the source repo)
- change some simple test functionality in the start workbench, maybe add a simple part
- install and setup QT Designer/Creator and configure for use with FreeCAD source
- either with the QT Online installer
- alternatively with the stand-alone-offline installer -> https://www.qt.io/offline-installers
- add some simple GUI element, maybe a toolbar with a single button which creates a Part with a cube
I would be willing to write such a step-by-step for the wiki, but I have no clue how the compile and package cycle currently works.
Maybe one of the package maintainers can outline, how the current build and package process works for the weekly builds? That would help in trying to understand, which steps should be done.
Could one of the forum moderators move this thread to the Compile/Package subforum? I think it better fits there.
Still no success. FreeCad build but the binary starts, opens a new process without a GUI, which freezes instantly.
I changed and activated the link to the local Xcode.app and the underlying Frameworks as states as "osx hacks" in https://github.com/FreeCAD/FreeCAD/blob ... ild.sh#L27
if [[ ${HOST} =~ "Darwin" ]]; then
# add hacks for osx here!
echo "adding hacks for osx"
#ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
to the following:
if [[ ${HOST} =~ "Darwin" ]]; then
# add hacks for osx here!
echo "adding hacks for osx"
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
which should use the current MacOSX sdk's.
But I still get some build errors. The log under /freecad-build/CMakeFiles/CMakeError.log states, that a file is missing:
Determining if the include file GL/gl.h exists failed with the following output:
Change Dir: /Users/dirkolbrich/Freecad/freecad-build/CMakeFiles/CMakeTmp
Run Build Command(s):/Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/bin/ninja cmTC_71ac6 && [1/2] Building C object CMakeFiles/cmTC_71ac6.dir/CheckIncludeFile.c.o
FAILED: CMakeFiles/cmTC_71ac6.dir/CheckIncludeFile.c.o
/Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -MD -MT CMakeFiles/cmTC_71ac6.dir/CheckIncludeFile.c.o -MF CMakeFiles/cmTC_71ac6.dir/CheckIncludeFile.c.o.d -o CMakeFiles/cmTC_71ac6.dir/CheckIncludeFile.c.o -c CheckIncludeFile.c
CheckIncludeFile.c:1:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
^~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
Yet this gl.h file is on the system as it is provided by the Command Line Tools under /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h
This is like a dark forrest.
CMake Error at src/MacAppBundle/cmake_install.cmake:55 (file):
file INSTALL cannot find
"/Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/lib/cmake/Qt5Core/../../../libexec/Assistant.app/Contents/MacOS/Assistant":
No such file or directory.
Call Stack (most recent call first):
src/cmake_install.cmake:51 (include)
cmake_install.cmake:68 (include)
FAILED: CMakeFiles/install.util
cd /Users/dirkolbrich/Freecad/freecad-build && /Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
./conda/build.sh: line 87: m: command not found
mv: rename /Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/bin/FreeCAD to /Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/bin/freecad: No such file or directory
mv: rename /Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/bin/FreeCADCmd to /Users/dirkolbrich/Coding/miniconda3/envs/freecad_dev/bin/freecadcmd: No such file or directory
but a FreeCAD.app executable is added under the miniconda3/envs/freecad_dev folder, which is damaged nonetheless. There seems to be an issue with QT5Core.
During build there are some warnings regarding missing links to older Xcode frameworks. I do not have Xcode 12 installed and I could not find any reference in freecad-source to these old MacOSX sdk's. Maybe some issue within Conda? I don't know.
[2338/3767] Linking CXX shared library Mod/MeshPart/flatmesh.so
ld: warning: directory not found for option '-F/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks'
[2412/3767] Linking CXX shared library Mod/Fem/Fem.so
ld: warning: directory not found for option '-F/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks'
[2474/3767] Linking CXX shared library Mod/MeshPart/MeshPart.so
ld: warning: directory not found for option '-F/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks'
[2490/3767] Linking CXX shared library Mod/Import/Import.so
ld: warning: directory not found for option '-F/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks'
[3536/3767] Linking CXX shared library Mod/MeshPart/MeshPartGui.so
ld: warning: directory not found for option '-F/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks'
[3665/3767] Linking CXX shared library Mod/Import/ImportGui.so
ld: warning: directory not found for option '-F/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks'
[3667/3767] Linking CXX shared library Mod/TechDraw/TechDrawGui.so
ld: warning: directory not found for option '-F/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks'
[3611/3767] Linking CXX shared library Mod/Fem/FemGui.so
ld: warning: directory not found for option '-F/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks'
This will find gl.h, but you need to have Xcode installed for the OpenGL framework.
I also fixed the paths in MacAppBundle/CmakeLists.txt to remove the install errors. But all of these steps are useless as long as the GUI does not come up.
zisoft wrote: ↑Fri Jul 02, 2021 4:57 pm
I also fixed the paths in MacAppBundle/CmakeLists.txt to remove the install errors.
Please explain what you changed. There is just one line referencing Xcode at https://github.com/FreeCAD/FreeCAD/blob ... ts.txt#L59 and this should link to the currently installed Xcode, not to some old frameworks.