Compiling on Mac OS Yosemite 10.10.5

Having trouble installing or compiling FreeCAD? Get help here.
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Sun Oct 29, 2017 6:10 am

Hi,

slowly recovering from summer ;) and considering getting back to work on FreeCAD and my Navicube.

I don't know if I've lost my memory completely but I was under the impression that I could use FreeCAD under Mac OS Yosemite 10.10.5

Now, looking at the precompiled binaries for 0.17 they work only in 10.11 or later.

UpgradingMac OS is going to be major hassle so not going to do that in a hurry.

Before I see if I can compile 0.17 on 10.10.5 I thought I'd as first are there any known
road blocks i.e. why is it that the pre compiled 0.17 only work on 10.11 or later.

wbr Kusti
peterl94
Posts: 1000
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Compiling on Mac OS Yosemite 10.10.5

Postby peterl94 » Sun Oct 29, 2017 3:54 pm

You remember correctly. I changed it to 10.11 because a lot of homebrew formulas didn't have bottles for 10.10 anymore and it took too long to compile them from source on travis ci. Everything still compiles fine on 10.10, though.
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Sun Oct 29, 2017 4:13 pm

Ok, great, thanks!

wbr Kusti
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Thu Nov 09, 2017 7:54 am

Since my previous successful build environment has rotted in the half year I've been away from this project I decided to start over. Hate bit rot!

I completely erased homebrew including all the taps.

I dowloaded the latest source from github.

I specifically did NOT try to install the FreeCAD dependencies before hand as I wanted to try Qt5.

0.17 support Qt5 right?

So the first CMake failed with:

Code: Select all

 Qt4 libraries not found.
So I installed Qt5 (up to this point there is no Qt in this system):

Code: Select all

brew install qt5
==> Downloading https://download.qt.io/official_releases/qt/5.9/5.9.2/single/qt-everywhere-opensource-src-5.9.2.tar.xz
==> Downloading from http://master.qt.io/archive/qt/5.9/5.9.2/single/qt-everywhere-opensource-src-5.9.2.tar.xz
######################################################################## 100.0%
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/e8fe6567/qt5/restore-pc-files.patch
######################################################################## 100.0%
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/a627e0a/qt5/QTBUG-56814.patch
######################################################################## 100.0%
==> Patching
==> Applying restore-pc-files.patch
patching file qtbase/mkspecs/features/qt_module.prf
Hunk #1 succeeded at 264 (offset 19 lines).
==> Applying QTBUG-56814.patch
patching file qttools/src/macdeployqt/shared/shared.cpp
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 821 with fuzz 2 (offset 18 lines).
==> ./configure -verbose -prefix /usr/local/Cellar/qt/5.9.2 -release -opensource -confirm-license -system-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-pcre -nomake tests -no-r
==> make
==> make install
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.

This formula is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/qt/lib
    CPPFLAGS: -I/usr/local/opt/qt/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/qt/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/qt/5.9.2: 9,021 files, 282.4MB, built in 112 minutes 52 seconds
Gee what waste of CPU cycles and human time building from source is.
(As noted before the world of C/C++ tool chain is broken beyond repair
and this is not FreeCAD's fault. Nobody's fault, it just is).

Above some patch seemed to fail in some way (did understand that and did not investigate).

Should I do something with those LDFLAGS/CPPFLAGS as instructed and what and where is the proper place to do that?


At this point CMake FreeCAD still fails to find Qt (and it looks like it would prefer Qt4):

Code: Select all

cmake -DBUILD_ROBOT="0" -DFREECAD_USE_EXTERNAL_PIVY="1" -DBUILD_FEM_NETGEN="1"  -DFREECAD_CREATE_MAC_APP="1" ../FreeCAD-git
-- Compiler: Clang, version: 7.0.2.7000181
-- Force BOOST_PP_VARIADICS=1 for clang
-- prefix: /usr/local
-- datadir: data
-- docdir: doc
-- includedir: include
-- libdir: /usr/local/lib
CMake Warning at CMakeLists.txt:316 (message):
  BUILD_PATH requires BUILD_PART;BUILD_ROBOT each be ON, but BUILD_ROBOT is
  "0"
Call Stack (most recent call first):
  CMakeLists.txt:335 (REQUIRES_MODS)


-- Detected Homebrew install at /usr/local
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   regex
--   signals
--   system
--   thread
--   chrono
--   date_time
--   atomic
-- Found Xerces-C: /usr/local/lib/libxerces-c.so
-- PyCXX found:
--   Headers:  /Users/nyholku/FreeCAD2/FreeCAD-git/src
--   Sources:  /Users/nyholku/FreeCAD2/FreeCAD-git/src/CXX
-- -- Found OCE/OpenCASCADE version: 7.1.0
-- -- OCE/OpenCASCADE include directory: /usr/local/include/opencascade
-- -- OCE/OpenCASCADE shared libraries directory: /usr/local/lib
-- VTK components: vtkCommonCore;vtkCommonDataModel;vtkFiltersVerdict;vtkIOXML;vtkFiltersCore;vtkFiltersGeneral;vtkIOLegacy;vtkFiltersExtraction;vtkFiltersSources;vtkFiltersGeometry;vtkhdf5
-- Checking for one of the modules 'hdf5-serial'
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Checking for one of the modules 'ompi-cxx'
CMake Warning at CMakeLists.txt:709 (message):
  mpi.h was not found.  Check for error above.


-- Check for medfile (libmed and libmedc) ...
-- Cannot find NETGEN header files.
-- Cannot find NETGEN library.
-- Could NOT find Eigen3 (missing: EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) (Required is at least version "2.91.0")
=================
Eigen3 not found.
=================

-- Found unsuitable Qt version "" from NOTFOUND
Qt QTOPENGL library not found.
Qt QTSVG library not found.
Qt QTUITOOLS library not found.
Qt QTWEBKIT library not found.
Qt QTGUI library not found.
Qt QTXML library not found.
Qt QTNETWORK library not found.
Qt QTCORE library not found.
CMake Error at CMakeLists.txt:781 (MESSAGE):
  ========================

  Qt4 libraries not found.

  ========================



-- Configuring incomplete, errors occurred!

jmaustpc
Posts: 9638
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Compiling on Mac OS Yosemite 10.10.5

Postby jmaustpc » Thu Nov 09, 2017 11:56 pm

Since this topic is about compiling, I moved it from Dev forum to here.
nyholku wrote:
Thu Nov 09, 2017 7:54 am
0.17 support Qt5 right?
Yes, but there are issues, I think the main issue is one of the associated libs is not yet feature complet with its earlier qt4 version, also on OSX there were some qt4 bugs so it's not perfect either.
User avatar
sgrogan
Posts: 5798
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby sgrogan » Fri Nov 10, 2017 1:21 am

nyholku wrote:
Thu Nov 09, 2017 7:54 am
0.17 support Qt5 right?
There is a CMake flag BUILD_QT5, on Win at least it's un-checked by default. If you can use CMake-gui it will help working through these issues.
Also QT5 builds for OSX are available: https://github.com/FreeCAD/FreeCAD/rele ... g/0.17_pre they are .dmg's and are available for every commit to master. There have been some auto build issues lately, that may be fixed already, but if the file is less than 200+ MB there is probably a problem and shouldn't be downloaded.
User avatar
f3nix
Posts: 332
Joined: Sat May 30, 2015 11:58 am

Re: Compiling on Mac OS Yosemite 10.10.5

Postby f3nix » Fri Nov 10, 2017 6:32 am

Hi!
nyholku wrote:
Thu Nov 09, 2017 7:54 am
At this point CMake FreeCAD still fails to find Qt (and it looks like it would prefer Qt4):
You have to use -DBUILD_QT5=1

You should start in a new build folder since adding this flag won't make it work. The CMake cache is "polluted" with Qt4 stuff.

HTH.

Cheers,
Mateusz
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Fri Nov 10, 2017 7:08 am

@sgrogan the pre-built binaries are nice but they don't work with MacOS Yosemite so I can't use them and the final goal, besides learning to use FreeCAD, is to be able to contribute something.

@f3nix,@sgrogan thanks for the -DBUILD_QT5=1 info, I will try that next
peterl94
Posts: 1000
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Compiling on Mac OS Yosemite 10.10.5

Postby peterl94 » Fri Nov 10, 2017 7:19 am

In addition to setting BUILD_QT5, you also have to add the qt5 cmake prefix to the cmake prefix path. It will also save you a bunch of trouble if you use the freecad formula to install the needed libraries. You need to install qt 5.6 instead of the latest 5.9 because pyside2 does not work with qt 5.9 yet. This is basically how it is done on travis:

Code: Select all

brew tap homebrew/science
brew tap freecad/freecad
brew install --only-dependencies freecad
brew install --only-dependencies freecad #Ensure all dependencies are satisfied
cmake -DCMAKE_BUILD_TYPE="Release" \
  -DBUILD_QT5=1 \
  -DCMAKE_PREFIX_PATH="/usr/local/Cellar/qt@5.6/5.6.2/lib/cmake"  \
  -DFREECAD_USE_EXTERNAL_KDL=1  \
  -DBUILD_FEM_NETGEN=1 \
  ../FreeCAD-git
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Compiling on Mac OS Yosemite 10.10.5

Postby nyholku » Fri Nov 10, 2017 10:18 am

@peterl94

thanks, that (almost) did it!

I installed Qt 5.6 like this:

Code: Select all

curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/fdfc724dd532345f5c6cdf47dc43e99654e6a5fd/Formula/qt5.rb
brew install ./qt5.rb
I also had to install eigen which your instructions apparently missed:

Code: Select all

brew install eigen
I then built it using:

Code: Select all

cmake -DBUILD_QT5="1" -DBUILD_ROBOT="0" -DFREECAD_USE_EXTERNAL_PIVY="1" -DBUILD_FEM_NETGEN="1"  -DFREECAD_CREATE_MAC_APP="1" ../FreeCAD-git
Now it builds cleanly and launches without problem!

Great, thank you very much.

Now if I only could locate those nice Onshape like icons that someone had made and could install those... ;)

wbr Kusti




PS Here is usefull SO entry re installing older versions of Qt:

https://stackoverflow.com/questions/401 ... -homebrew