Skip to content

SetupTasksOsxMountainLion

Sebastian Schmieschek edited this page Aug 12, 2015 · 5 revisions

HemeLB setup on OS X

This is on Mountain Lion (OS 10.8).

It's probably easiest to first install Homebrew and then Canopy.

General

Homebrew

Go to http://brew.sh and follow the instructions.

Canopy

You want the Academic, 64 bit version. Go to https://enthought.com/products/canopy/academic/ and register with an academic email address. Then download the installer.

Note that you may prefer to do a system-wide install rather than in your home directory only. See: http://docs.enthought.com/canopy/configure/canopy-cli.html

Mercurial

Not included in OS X by default.

brew install mercurial

CMake

See [CMake] for details.

brew install cmake

Tools

If using Canopy, ensure that you use the Canopy package manager to install quantities.

Setup Tool

Fix Canopy VTK CMake configuration

This is fixed in Canopy 1.4.1 (and may have been fixed in an earlier version), so check if you can skip this.

cd /usr/local/Canopy_64bit/User/lib/vtk-5.6/
$EDITOR VTKConfig.cmake

search for VTK_INCLUDE_DIRS If the final item in the list is /Library/Frameworks/EPD64.framework/Versions/1.4.2/Headers, replace it with the appropriate path to the Canopy Python headers (/Applications/Canopy.app/Contents/include/python2.7 at the time of writing)

Edit VTKLibraryDepends.cmake. Search for EPD64. If you find lots of strings like /Library/Frameworks/EPD64.framework/Versions/1.4.2/Python search and replace them for Canopy Python shared library (/Applications/Canopy.app/Contents/Python)

Install ITK

No special instructions.

CGAL

Install via homebrew

brew install cgal

Install VMTK

In addition to the generic notes, when configuring with ccmake:

  • Set CMAKE_OSX_ARCHITECTURES to x86_64, as Canopy Python is only built for 64 bit

  • Add the Canopy Python headers to the search path by setting CMAKE_CXX_FLAGS to -I/Applications/Canopy.app/Contents/include/python2.7

  • Correct ITK bugs. GCC used to accept some unqualified lookup of dependent base classes for templates that it, according to the standard, shouldn't. Clang does not (see http://clang.llvm.org/compatibility.html#dep_lookup_bases for details). To find them, try to make vmtk and watch for errors like:

    /Users/rupert/sw/include/InsightToolkit/Algorithms/itkGeodesicActiveContourLevelSetFunction.h:117:12: error: use of undeclared identifier 'PropagationSpeed' return PropagationSpeed( neighborhood, offset, gd ); < a bunch of note lines> /Users/rupert/sw/include/InsightToolkit/Common/itkSegmentationLevelSetFunction.h:156:27: note: must qualify identifier to find this declaration in dependent base class virtual ScalarValueType PropagationSpeed(const NeighborhoodType &, Edit the line of the error, replacing PropagationSpeed with this->PropagationSpeed.

VMTK has really dodgy linking of its shared libraries. Run the script

hemelb/Scripts/SortVmtkOsxLinking --itk /path/to/lib/InsightToolkit --vmtk CMAKE_INSTALL_PREFIX/lib/vmtk

HemeLB

Install MPI

OS X no longer comes with an MPI

brew install open-mpi

Optional dependencies

The HemeLB master CMake file is able to install these but it may be easier to use brew.

brew install ctemplate
brew install cppunit
brew install tinyxml
brew install boost

If you want to install ParMETIS this way, then you must "tap" the science Homebrew repo first, if you haven't already:

brew tap homebrew/science
brew install parmetis

== Setup tool on Mac OS X Mountain Lion ==

Install homebrew: http://mxcl.github.io/homebrew/

Jens@RSDT created a formula that should install all the dependencies at once. While his pull request gets merged:

brew tap jenshnielsen/homebrew-science
brew install jenshnielsen/science/vmtk

Add the following line to your ~/.profile

export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

so that your python picks up packages installed by homebrew (I have tested this against a system Python but not against !Enthought/Canopy...).

Install wxPython via homebrew

brew install wxmac --python --devel

Install cgal via homebrew

brew install cgal

When compiling the setup tool, my Python installation was trying to generate a universal binary (i386 + x86_64) and returning the following warning

ld: warning: ignoring file /usr/local/lib/libcgal.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/lib/libcgal.dylib

due to no 32 bit installation of CGAL available. You can safely ignore this, as long as you have 64 bit versions of CGAL, VTK, ITK, VMTK, etc.

Clone this wiki locally