Compiling on Mac ... problem with the prerequisites with homebrew

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: Compiling on Mac ... problem with the prerequisites with homebrew

Post by blacey »

easyw-fc wrote: I finally managed to build FC on Sierra.
My Sierra is a clean installation and to build FC I followed the steps here, cleaning up all my previous attempts, brew included
I just had installed XQuartz: https://www.xquartz.org/
and Xcode
and Homebrew https://brew.sh/
You should not need XQuartz - FreeCAD uses Qt that abstracts a common UI framework to the platform-specific implementation. On Linux, it uses native X11 but on MacOS it uses the Cocoa frameworks, wherever possible (i.e. not X11)
easyw-fc wrote: here the steps I did:

Code: Select all

# Remove Homebrew
cd /usr
sudo rm -rf local

# Reinstall Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

#  Brew FreeCAD dependencies
brew tap homebrew/science
brew tap freecad/freecad

brew install --only-dependencies freecad --with-freecad-bottles
brew install --only-dependencies freecad --with-freecad-bottles  #run a second time to ensure all dependencies are installed
--with-freecad-bottles is deprecated and no longer needed. It will not affect your install so this is just an FYI.
easyw-fc wrote:

Code: Select all

#  get FreeCAD src
git clone https://github.com/FreeCAD.git
cd FreeCAD
mkdir build && cd build
after a incomplete configure attempt I did also

Code: Select all

#  Brew FreeCAD dependencies
brew install eigen
brew install libspnav
brew install doxygen
brew install graphviz
The freecad formula should have installed all the dependencies you need for a successful configure. If you still have the logs from the brew install --only-dependencies freecad/freecad/freecad step, please provide them because I would like to see why it failed to install dependencies such as eigen.
easyw-fc wrote: # made a symlink for OpenGL
ln -s /opt/X11/include/GL /usr/local/include/GL[/code]
I haven't had to symlink openGL this in the past. Are you sure this step was needed?
easyw-fc wrote: and finally I did

Code: Select all

cmake -DBUILD_FEM_NETGEN="1" -DFREECAD_CREATE_MAC_APP="1" -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt@5.6/5.6.2/lib/cmake -CMAKE_BUILD_TYPE="Release" -DBUILD_QT5="1"  ../FreeCAD-git
make
then I went to drink a real bear waiting for the gem to be released! ;)

and finally I got my FC branch built! yeah! :D
Glad you got it working Maurice and were rewarded with a real beer :)
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Compiling on Mac ... problem with the prerequisites with homebrew

Post by easyw-fc »

blacey wrote: You should not need XQuartz - FreeCAD uses Qt that abstracts a common UI framework to the platform-specific implementation. On Linux, it uses native X11 but on MacOS it uses the Cocoa frameworks, wherever possible (i.e. not X11)
I needed XQuartz because I had to build also xrdp after FC ... good to know anyway
blacey wrote:--with-freecad-bottles is deprecated and no longer needed. It will not affect your install so this is just an FYI.
perfect
blacey wrote: The freecad formula should have installed all the dependencies you need for a successful configure. If you still have the logs from the brew install --only-dependencies freecad/freecad/freecad step, please provide them because I would like to see why it failed to install dependencies such as eigen.
I cannot find any logs related to freecad at ~/Library/Logs/Homebrew/
blacey wrote:I haven't had to symlink openGL this in the past. Are you sure this step was needed?
yes, I had to ask Google to go further in compilation...
the error was

Code: Select all

fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
similar to the one at FC forum here
https://forum.freecadweb.org/viewtopic. ... 32#p143434

Cheers
Maurice
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: Compiling on Mac ... problem with the prerequisites with homebrew

Post by microartisan »

error 1
error 2?
  • location China, when I install qtwebkit from brew freecad/freecad, it take years.
    is it required for freecad compiling?
    is it possible i can compile freecad whitout qtwebkit

the problem solved by following:
rename /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk , then I can compile the source codes
Post Reply