This guide covers Therion installation on OS X from source.

We will need

  • Xcode - install from AppStore
  • Command Line Tools - install using Install button in Xcode → Preferences → Downloads → Command Line Tools
  • Terminal - part of OS X installation
  • Some therion dependecies will be installed using Homebrew package manager.

Homebrew is package manager for OS X - Wikipedia

In comparison to other package managers like Fink or MacPorts Homebrew works hard to avoid package duplication - Homebrew compiles its packages against libraries built into OS X.

Install Homebrew - see instructions on http://mxcl.github.com/homebrew/

Install MacTeX package from http://www.tug.org/mactex/

Run following commands in Terminal:

brew update
brew doctor

follow (if any) instructions in results of “doctor” command

brew install lcdf-typetools
brew install wxmac
brew install freetype
brew install vtk
brew install --overwrite imagemagick
brew doctor 

“–overwrite” parameter you may use if problems with linking (there is another installation, not the brew's). ImageMagick is such case, it is installed by MacOSX Xcode installation, but evidently not all necessary files.

In case you want to use Survex for loop-closure or if you want to compile samples install Survex:

brew tap survex/survex https://git.survex.com/homebrew-survex
brew install survex

Once you've installed as above, you can upgrade your homebrew packages (including Survex) like so:

brew update
brew upgrade

Download therion source code from http://therion.speleo.sk/download.php

Extract tarball to ~/Downloads or another prefered place.

In Terminal run:

cd ~/Downloads/therion
make config-macosx
cd loch
cd ..
make install

This will compile and create sample files and compile Thbook – the refence guide.

make samples

In Terminal run:

sudo mkdir /usr/X11/include
sudo ln -s /System/Library/Frameworks/OpenGL.framework/Headers /usr/X11/include/GL

Now we need to customize several files

Edit ~/Downloads/therion/Makefile

replace line 65:

POBJECTS = extern/getopt.o extern/getopt1.o extern/getline.o


POBJECTS = extern/getopt.o extern/getopt1.o

Edit ~/Downloads/therion/loch/lxFile.cxx

replace section starting on line 12:

#if defined LXWIN32 || defined LXMACOSX || defined THWIN32 || defined THMACOSX
#include "getline.h"


#if defined LXWIN32 || defined THWIN32
#include "getline.h"

Edit ~/Downloads/therion/loch/Makefile

replace section starting on line 9 with:

#VTKVERSION = $(shell tclsh getvtkver.tcl version)
VTKPATH = /usr/local/include/vtk-$(VTKVERSION)
#VTKPATH = $(shell tclsh getvtkver.tcl incpath)
VTKLIBPATH = /usr/local/lib/vtk-$(VTKVERSION)
#VTKLIBPATH = $(shell tclsh getvtkver.tcl libpath)
VTKLIBS = -lvtkHybrid -lvtkImaging -lvtkIO -lvtkGraphics -lvtkFiltering -lvtkCommon -lvtkjpeg -lvtkpng -lvtkzlib -lvtksys -lfreetype

replace section starting on line 54 with:

CXX = c++
CC = cc
CXXPFLAGS = -W -Wall -DLXMACOSX $(shell wx-config --cxxflags) -I$(VTKPATH) -Wno-deprecated -I/usr/X11R6/include $(shell freetype-config --cflags)
CCPFLAGS = -W -Wall -DLXMACOSX $(shell wx-config --cflags) -I/usr/X11R6/include
PLIBS = -lz -L/usr/X11R6/lib $(shell wx-config --libs --gl-libs) -L$(VTKLIBPATH) $(VTKLIBS)
POSTMAKE = cp -f ./loch ./loch.app/Contents/MacOS

Edit ~/Downloads/therion/loch/lxOGLFT.cxx

Replace line 474:

bbox = measure( s.GetChar( 0 ) );


bbox = measure((const wxChar) s.GetChar( 0 ) );

Replace line 478:

BBox char_bbox = measure( s.GetChar( i ) );


BBox char_bbox = measure((const wxChar) s.GetChar( i ) );

Replace line 657:

compile( s.GetChar( i ) );


compile((const wxChar) s.GetChar( i ) );

Replace line 780:

draw( s.GetChar( i ) );


draw((const wxChar) s.GetChar( i ) );

Edit ~/Downloads/therion/loch/lxSTree.cxx

Replace line 55:

: wxMiniFrame(parent, wxID_ANY, _(" Selection"),wxDefaultPosition, wxDefaultSize, (wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxRESIZE_BOX | wxRESIZE_BORDER) & (~(wxMINIMIZE_BOX | wxMAXIMIZE_BOX)))


: wxMiniFrame(parent, wxID_ANY, _(" Selection"),wxDefaultPosition, wxDefaultSize, (wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxRESIZE_BORDER) & (~(wxMINIMIZE_BOX | wxMAXIMIZE_BOX)))
  • os-tips/osx10.8.txt
  • Last modified: 4 years ago
  • by sluka