macOS build failure

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
velociraptux
Posts: 15
Joined: Sun Jan 29, 2017 2:58 am

Re: macOS build failure

Post by velociraptux »

Thanks
dsaiko
Posts: 17
Joined: Mon Jan 16, 2017 10:54 pm

Re: macOS build failure

Post by dsaiko »

On Linux, my small development tests were quite ok.
Now trying to build on macos using macports (not really willing to uninstall all I have set up and migrate to homebrew),
stuck on

cmake -DFREECAD_USE_EXTERNAL_PIVY="1" -DBUILD_FEM_NETGEN="1" -DCMAKE_BUILD_TYPE="Release" -DFREECAD_CREATE_MAC_APP="1" ../FreeCAD

"Could NOT find MEDFile (missing: MEDFILE_INCLUDE_DIRS MEDFILE_LIBRARIES)"

have not found libmed or something similar at macports or internet to be able to download and compile.
also tried to use -DFREECAD_USE_EXTERNAL_SMESH="1" but have not found external SMESH installation.

Any help appreciated. Thanks.

UPDATE1:
cat CMakeFiles/CMakeError.log
Determining if the include file GL/gl.h exists failed with the following output:

Run Build Command:"/usr/bin/make" "cmTC_11521/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_11521.dir/build.make CMakeFiles/cmTC_11521.dir/build
Building C object CMakeFiles/cmTC_11521.dir/CheckIncludeFile.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -o CMakeFiles/cmTC_11521.dir/CheckIncludeFile.c.o -c /Users/dsaiko/development/FreeCAD-Build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/dsaiko/development/FreeCAD-Build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
^
1 error generated.
make[1]: *** [CMakeFiles/cmTC_11521.dir/CheckIncludeFile.c.o] Error 1
make: *** [cmTC_11521/fast] Error 2
Let's 3D print a whole new world.
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: macOS build failure

Post by blacey »

dsaiko wrote:On Linux, my small development tests were quite ok.
Now trying to build on macos using macports (not really willing to uninstall all I have set up and migrate to homebrew),
stuck on

Any help appreciated. Thanks.
You might want to examine the med-file home-brew formula here - https://github.com/FreeCAD/homebrew-fre ... 7c12850f84 as a reference for building and installing in the macports prefix. Med-file is pretty easy to download and install on macOS.

I was a MacPorts guy before working with FreeCAD but MacPorts has languished while Homebrew thrives and our investment in Homebrew for FreeCAD has made it very easy to install all the dependencies for FreeCAD. See https://www.freecadweb.org/wiki/CompileOnMac/en. We also use Homebrew for continuous integration builds on Travis.

The other option of course, is to simply download the latest macOS build from GitHub - https://github.com/bblacey/FreeCAD-MacOS-CI/releases unless you are trying to build it for development purposes. The macOS builds are uploaded for every successful commit to master.
dsaiko
Posts: 17
Joined: Mon Jan 16, 2017 10:54 pm

Re: macOS build failure

Post by dsaiko »

blacey wrote: You might want to examine the med-file home-brew formula here - https://github.com/FreeCAD/homebrew-fre ... 7c12850f84 as a reference for building and installing in the macports prefix. Med-file is pretty easy to download and install on macOS.

I was a MacPorts guy before working with FreeCAD but MacPorts has languished while Homebrew thrives and our investment in Homebrew for FreeCAD has made it very easy to install all the dependencies for FreeCAD. See https://www.freecadweb.org/wiki/CompileOnMac/en. We also use Homebrew for continuous integration builds on Travis.

The other option of course, is to simply download the latest macOS build from GitHub - https://github.com/bblacey/FreeCAD-MacOS-CI/releases unless you are trying to build it for development purposes. The macOS builds are uploaded for every successful commit to master.
Thanks, I plan to use the source code for development.
I was still having some issues, migrated to homebrew, now it compiles fine.
Let's 3D print a whole new world.
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: macOS build failure

Post by blacey »

dsaiko wrote: Thanks, I plan to use the source code for development.
I was still having some issues, migrated to homebrew, now it compiles fine.
@dsaiko, excellent - it would be awesome to have another FreeCAD developer, especially on macOS. :D :D :D Which areas do you plan to pursue?
dsaiko
Posts: 17
Joined: Mon Jan 16, 2017 10:54 pm

Re: macOS build failure

Post by dsaiko »

blacey wrote:
dsaiko wrote: Thanks, I plan to use the source code for development.
I was still having some issues, migrated to homebrew, now it compiles fine.
@dsaiko, excellent - it would be awesome to have another FreeCAD developer, especially on macOS. :D :D :D Which areas do you plan to pursue?
see my introduction here: viewtopic.php?f=8&p=156654

What I would start with is probably some small bugfixes there and there to get into the source code and try to improve stability,
may be some unit tests etc.
Later I would like to focus on areas close to 3D modelling for 3D printing. Which means I am not much interested in stuff like Assembly Workbench, rather Part Design or Part workbench.
What I would also like to inspect later on is the performance, as when I create some more complicated curved sketches or import svg and extrude it and then apply fillets, FreeCAD is really slow.

But in general I still spend most time on getting familiar with 3D design, I am new to this.
Before trying to suggest some real improvements, I think I should learn some commercial 3D CAD software to be aware of how things are done elsewhere.

Anyway, hope to start bugfixing soon.
Let's 3D print a whole new world.
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: macOS build failure

Post by blacey »

dsaiko wrote: See my introduction here: viewtopic.php?f=8&p=156654
Sounds great! In terms of learning curve, we could really use some help wringing out Qt 5. nuances (we're moving from Qt 4.x) on macOS. The current status is that we have a Qt56 branch on FreeCAD/homebrew-freecad that enables installing Qt 5.6 and the dependencies (e.g. pyside-tools, pyside, shiboken). Thanks to the hard work of others like @f3nix and @wmayer, Qt5 compatibility is built-in to FreeCAD and so we are really just faced with tracking down the edge cases and fixing them. To switch your dependencies over to Qt 5 and build FreeCAD under Qt 5, do the following:

One time setup to use Qt 5.6 and required dependencies

Code: Select all

# Uninstall the Qt4 dependencies
brew uninstall --ignore-dependencies cartr/qt4/shiboken cartr/qt4/pyside cartr/qt4/pyside-tools cartr/qt4/qt FreeCAD/freecad/coin
brew untap cartr/qt4

# Configure FreeCAD/freecad tap for Qt5
pushd $(brew --prefix)/HomeBrew/Library/Taps/freecad/homebrew-freecad
git checkout -b qt56 origin/qt56
pope
export HOMEBREW_DEVELOPER="1"

# Re-run FreeCAD formula to install Qt5 dependencies
brew install --verbose --only-dependencies freecad --with-freecad-bottles --with-packaging-utils
brew install --verbose --only-dependencies freecad --with-freecad-bottles --with-packaging-utils  #Sometimes you have to run it twice due to a Home-brew issue

# Qt5: Update and patch the Qt 5 symlinks
brew link --force qt@5.6
sudo ln -f -s /usr/local/Cellar/qt\@5.*/*/mkspecs /usr/local/mkspecs
sudo ln -f -s /usr/local/Cellar/qt\@5.*/*/plugins /usr/local/plugins
After the one-time setup above, whenever you want to rebuild FreeCAD with Qt5 do the following.

Code: Select all

mkdir build && cd build
cmake -DBUILD_FEM_NETGEN=ON -DFREECAD_USE_EXTERNAL_KDL=ON -DFREECAD_CREATE_MAC_APP=ON -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_QT5=ON ..
This weekend, I hope to enable Qt 5 macOS builds on Travis. Currently they are only available on my fork but to move this track along faster, we want to enable them on the main repo.

Also, given you plan to do some development, you should install ccache because FreeCAD is configured to leverage ccache for quicker compile/test iterations. You can install ccache with brew install ccache.

Finally, there is a FreeCAD Gitter channel open and attended by many ready and willing contributors.

Cheers,
Bruce
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: macOS build failure

Post by ian.rees »

+1 to what Bruce said - would be great to have more folks using/developing on MacOS! -Ian-
dsaiko
Posts: 17
Joined: Mon Jan 16, 2017 10:54 pm

Re: macOS build failure

Post by dsaiko »

ian.rees wrote:+1 to what Bruce said - would be great to have more folks using/developing on MacOS! -Ian-
On vacation right now, will get back in a week, then will try to start being helpful :-)
Let's 3D print a whole new world.
Post Reply