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

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

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

Postby nyholku » Wed Dec 28, 2016 4:30 pm

I'm trying to compile FreeCAD on Mac following the instructions here:

http://www.freecadweb.org/wiki/?title=CompileOnMac

I've got a pretty virgin homebrew installation so I expected this to go smoothly but run into several issues installing the prerequisites.

Concentrating only on one problem at a time, let's take 'nglib', I try install it see full transcript below, and it is found in multiple taps, I try to untap one or the other but something else fails, so I'm stuck in a loop.

Any help/pointers would be appreciated.

wbr Kusti

Code: Select all

nyholku$ brew install --with-oce nglib
Error: Formulae found in multiple taps: 
 * freecad/freecad/nglib
 * homebrew/science/nglib

Please use the fully-qualified name e.g. freecad/freecad/nglib to refer the formula.
nyholkus-MBP-5:~ nyholku$ brew install homebrew/boneyard/pyside
==> Installing pyside from homebrew/boneyard
Error: Formulae found in multiple taps: 
 * freecad/freecad/shiboken
 * homebrew/boneyard/shiboken

Please use the fully-qualified name e.g. freecad/freecad/shiboken to refer the formula.
nyholkus-MBP-5:~ nyholku$ untap homebrew/science
-bash: untap: command not found
nyholkus-MBP-5:~ nyholku$ brew untap homebrew/science
Untapping homebrew/science... (679 files, 1.8M)
Untapped 643 formulae
nyholkus-MBP-5:~ nyholku$ brew install --with-oce nglib
Updating Homebrew...
==> Installing nglib from freecad/freecad
Error: No available formula with the name "oce" (dependency of freecad/freecad/nglib)
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
These formulae were found in taps:
homebrew/science/oce                           Caskroom/cask/raw-photo-processor
Caskroom/cask/docear                           Caskroom/cask/rhinoceros
Caskroom/cask/ldoce5-viewer                    Caskroom/versions/processing2
Caskroom/cask/ocenaudio                        Caskroom/versions/rhinoceroswip
Caskroom/cask/processing
To install one of them, run (for example):
  brew install homebrew/science/oce
nyholkus-MBP-5:~ nyholku$ 
nyholkus-MBP-5:~ nyholku$ brew install homebrew/science/oce
==> Tapping homebrew/science
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-science'...
remote: Counting objects: 660, done.
remote: Compressing objects: 100% (655/655), done.
remote: Total 660 (delta 0), reused 62 (delta 0), pack-reused 0
Receiving objects: 100% (660/660), 589.85 KiB | 655.00 KiB/s, done.
Checking connectivity... done.
Tapped 643 formulae (678 files, 1.8M)
Warning: homebrew/science/oce-0.17.2_1 already installed
nyholkus-MBP-5:~ nyholku$ brew install --with-oce nglib
Error: Formulae found in multiple taps: 
 * freecad/freecad/nglib
 * homebrew/science/nglib
Jee-Bee
Posts: 2011
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

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

Postby Jee-Bee » Wed Dec 28, 2016 5:10 pm

Don't know fore sure... but could it be this problem?
see: https://github.com/Homebrew/homebrew-sc ... ssues/3624
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

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

Postby nyholku » Wed Dec 28, 2016 11:29 pm

Thanks, not sure, as my failure is earlier, ie. because it is found in two taps it cannot be installed and with only one tap get an other installation issue and all this is before the installer actually does anything. But there were some clues there so I will have a deeper look. Thanks again!
peterl94
Posts: 1000
Joined: Thu May 23, 2013 7:31 pm
Location: United States

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

Postby peterl94 » Thu Dec 29, 2016 1:43 am

You should be able to do what it says: "Please use the fully-qualified name e.g. freecad/freecad/nglib to refer the formula." Have a look at the recipe to see how the deps are specified: https://github.com/FreeCAD/homebrew-fre ... freecad.rb.

But really, the wiki hasn't been updated in awhile. These are the commands you should use to install the dependencies:

Code: Select all

brew tap homebrew/science
brew tap freecad/freecad
brew install --only-dependencies freecad --with-freecad-bottles
However, what version of mac os are you using? If you are using Sierra, qt and nglib are not going to compile. I'm in the process of finding out how to make it work.
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

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

Postby nyholku » Thu Dec 29, 2016 3:18 pm

Hi peterl94,

thanks for the tip.

I've tried that like half a dozen time but failed.

But I decided to let this have a one more go from the start.

First I wiped every possible remains of the Macports, have not used it
for years and thought I had it all removed but somehow CMake was
able to detect it.

So start from the scratch with homebrew as per instructed here:

http://www.freecadweb.org/wiki/index.ph ... mpileOnMac

Many packages were in multiple taps (should this situtation not be corrected
as there now seems to be a freecad specific tap?) but I was able to install
everything.

Trying to run CMake ti complained about missing VTK, which is not mentioned
in the instructions for FreeCAD via homebrew. No problem installed it with

Code: Select all

brew instal VTK
trying to run CMake g to run CMake fails with:

Code: Select all

nyholkus-MBP-5:build nyholku$ cmake -DBUILD_ROBOT="0" -DFREECAD_USE_EXTERNAL_PIVY="1" -DBUILD_FEM_NETGEN="1"  -DFREECAD_CREATE_MAC_APP="1" ../FreeCAD-git
-- prefix: /usr/local
-- datadir: data
-- docdir: doc
-- includedir: include
-- libdir: /usr/local/lib
CMake Warning at CMakeLists.txt:266 (message):
  BUILD_PATH requires BUILD_PART;BUILD_ROBOT each be ON, but BUILD_ROBOT is
  "0"
Call Stack (most recent call first):
  CMakeLists.txt:288 (REQUIRES_MODS)


-- Detected Homebrew install at /usr/local
CMake Error at CMakeLists.txt:451 (message):
  Only found the stock Python, that's probably bad.


CMake Warning at /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version 106300
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:529 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version 106300
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:529 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version 106300
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:529 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version 106300
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:529 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version 106300
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:529 (find_package)


CMake Warning at /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version 106300
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:529 (find_package)


-- Boost version: 1.63.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   regex
--   signals
--   system
--   thread
-- Found Xerces-C: /usr/local/lib/libxerces-c.dylib
-- PyCXX found:
--   Headers:  /Users/nyholku/FreeCAD/FreeCAD-git/src
--   Sources:  /Users/nyholku/FreeCAD/FreeCAD-git/src/CXX
-- -- OpenCASCADE Community Edition has been found.
-- -- Found OCE/OpenCASCADE version: 6.8.0
-- -- OCE/OpenCASCADE include directory: /usr/local/Cellar/oce/0.17.2_1/OCE.framework/Versions/0.17/Resources/../../../../include/oce
-- -- OCE/OpenCASCADE shared libraries directory: 
-- VTK components: not found or used
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /usr/local/lib/libhdf5.dylib;/usr/local/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib (found version "1.8.18")  
-- Check for medfile (libmed and libmedc) ...
CMake Error at /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find MEDFile (missing: MEDFILE_INCLUDE_DIRS MEDFILE_LIBRARIES)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.7.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cMake/FindMEDFile.cmake:54 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:632 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/nyholku/FreeCAD/build/CMakeFiles/CMakeOutput.log".
See also "/Users/nyholku/FreeCAD/build/CMakeFiles/CMakeError.log".
nyholkus-MBP-5:build nyholku$ cmake -DBUILD_ROBOT="0" -DFREECAD_USE_EXTERNAL_PIVY="1" -DBUILD_FEM_NETGEN="1"  -DFREECAD_CREATE_MAC_APP="1" ../FreeCAD-git
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

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

Postby nyholku » Thu Dec 29, 2016 3:37 pm

I saw this thread

https://github.com/sgrogan/FreeCAD/rele ... 7-med-test

which seems to be related.

It mentions disabling MESH_PART but does not say how and
also refers to some release:

https://github.com/sgrogan/FreeCAD/rele ... 7-med-test

but again a bit vague how to go about this or if indeed this is the way to go.

As I'm just dipping my toes into the water at this point all I want is to be able
to compile the stuff to see if I can contribute something to the project.

I've got +35 years programming experience in asm/C/C++/Java and the
usual suspect, some parametric CAD user experience (ProE / Onshape) and
some 2D CAD development background so I should be well placed contribute
something little.

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

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

Postby nyholku » Fri Dec 30, 2016 11:31 am

For posterity:

The instructions are missing a prerequisite:

You need to install 'med-file' like this:

Code: Select all

 brew install freecad/freecad/med-file
peterl94
Posts: 1000
Joined: Thu May 23, 2013 7:31 pm
Location: United States

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

Postby peterl94 » Fri Dec 30, 2016 4:46 pm

It would be really useful if you could tell me what version of mac os you are using. Where does this stand now? Have you gotten it to compile? By the way, you don't need to disable the robot workbench if you install orocos-kdl. The cmake options used for the official builds is as follows (see the osx section of https://github.com/FreeCAD/FreeCAD/blob ... travis.yml)

Code: Select all

-DFREECAD_USE_EXTERNAL_KDL=ON -DFREECAD_USE_EXTERNAL_PIVY=ON -DFREECAD_CREATE_MAC_APP=ON
Sorry for the wiki instructions being so outdated.
nyholku wrote:I've tried that like half a dozen time but failed.
Are you saying you ran "brew install --only-dependencies freecad --with-freecad-bottles" and it failed? Can you post the exact output of running that command?
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

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

Postby nyholku » Fri Dec 30, 2016 5:35 pm

Hi peterl94,

thanks for the reply

As indicated in an other one of my posts (I put it separately cause I thought it was a separate issue):

viewtopic.php?f=4&t=19535

I've been able to run the Cmake to completion but the compilation chokes on first link step because of a missing XCode related file.

I'm on Macos 10.10.5 (Yosemite) with newly installed XCode 7.2.1 (the last one to support Yosemite) and I've manually copied the MacOSX10.10.sdk into the /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/ as indicated is necessary in some posts about similar issues.

Ok, I was not aware those bottles you indicated, I will try them next.

Code: Select all

brew tap homebrew/science
brew tap freecad/freecad
brew install --only-dependencies freecad --with-freecad-bottles
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

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

Postby nyholku » Fri Dec 30, 2016 5:54 pm

I tried

Code: Select all

brew install --only-dependencies freecad --with-freecad-bottles
Error: Formulae found in multiple taps: 
 * freecad/freecad/freecad
 * sanelson/freecad/freecad
So I untapped 'sanelson/freecad'

And tried again and got

Code: Select all

Error: Cannot install homebrew/science/opencascade because conflicting formulae are installed.
  oce: because OCE is a fork for patches/improvements/experiments over OpenCascade

Please `brew unlink oce` before continuing.
So I

Code: Select all

brew unlink oce
brew install --only-dependencies freecad --with-freecad-bottles
And the pour was succesfull so I then cleaned my build directory and did:

Code: Select all

cmake -DBUILD_ROBOT="0" -DFREECAD_USE_EXTERNAL_PIVY="1" -DBUILD_FEM_NETGEN="1"  -DFREECAD_CREATE_MAC_APP="1" ../FreeCAD-git
Which run to completion without error messages:

Code: Select all

-- Generating done
-- Build files have been written to: /Users/nyholku/FreeCAD/build
So did

Code: Select all

make
And it fails again like in my other post:

Code: Select all

Scanning dependencies of target Driver
[  0%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/Driver.dir/src/Driver/Driver_Document.cpp.o
[  0%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/Driver.dir/src/Driver/Driver_Mesh.cpp.o
[  0%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/Driver.dir/src/Driver/Driver_SMDS_Mesh.cpp.o
[  0%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/Driver.dir/src/Driver/Driver_SMESHDS_Mesh.cpp.o
[  0%] Linking CXX shared library ../../../lib/libDriver.dylib
ld: file not found: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libDriver.dylib] Error 1
make[1]: *** [src/3rdParty/salomesmesh/CMakeFiles/Driver.dir/all] Error 2
make: *** [all] Error 2