Developer Setup - Mac

1. Install Prerequisites

 

1.0 XCode

XCode is Apple's official Integrated Development Environment (IDE). We prefer Qt Creator but XCode comes with a lot of libraries that are needed elsewhere (e.g. MySQL installation). To install XCode, open the App Store from the Toolbar, search for XCode, and click install. The installation takes a long time and there is no progress bar; it just says "installing" in the App Store. When installation is finished it will say "Installed" in the App Store. When finished, open XCode, agree to the license, and install any updates it asks for.

1.0 XCode Command line tools

Open XCode (type "Xcode" in Spotlight). Agree to the license. Then in the menu go to XCode->Preferences->Downloads. There should be an item called "Command Line Tools". Click on the install button.

1.0 MacPorter

MacPorter is a command-line (Terminal) installer/package-manager for Mac similar to Yum or Install on Linux. Google "MacPorter" and install the latest stable release.

1.1 Qt Creator

Qt Creator is a Integrated Development Environment (IDE) especially created for developing and compiling programs using Qt. Other IDEs such as XCode can also be used but we recommend Qt Creator. Google "Qt Creator" and install the latest stable release.

1.2 CMake

CMake is a cross-platform make tool that is used for GoFigure, VTK, and ITK. CMake takes a cross platform makefile, allows users to change key options, and then generates a platform specific makefile/project file for compiling code on that platform of interest. Google CMake and download the latest stable release.

1.3 Qt

Qt is an open-source C++ based class library for creating graphical user interface (GUI) based applications that can be natively compiled and run on a wide variety of operating systems. The Qt project was bought by Nokia but still maintains a free and open version. Download the LGLPL / Free version (at least 4.5) of the SDK at http://qt-project.org/downloads

1.4 MySQL

MySQL is a open-source database server used by GoFigure for data management. To install MySQL, open a Terminal window (type "Terminal" in Spotlight) and type each of the following lines one at a time

sudo port install mysql55
sudo port install mysql55-server
sudo /opt/local/lib/mysql55/bin/mysql_install_db --user=mysql
sudo /opt/local/share/mysql55/support-files/mysql.server start
/opt/local/lib/mysql55/bin/mysqladmin -u root password 'gofigure'
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql55-server.plist
It should automatically download and install MySQL5.5 with no errors

 

1.4 GitHub

Git is a source control system that keeps track of versions and changes to source code. We use GitHub which is a website and public repository for sharing code. Download the Github for Mac application:

http://mac.github.com/

 


2 Install External Libraries

2.1 FFMPEG

FFMPEG is an open-source library used by GoFigure for making movies. To install, use MacPorts from a Terminal window and type:

sudo port install ffmpeg +gpl +lame +x264 +xvid

2.2 VTK

VTK (The Visualization Toolkit) is an open source C++ class library for visualization used by GoFigure. Follow the instructions on http://www.vtk.org/VTK/resources/software.html

You can get VTK using Git by typing the follow in Terminal

$ git clone git://vtk.org/VTK.git VTK

You should keep your source files and binaries in separate directories. For example if you have a directory called Code, put the VTK files in Code/Source/VTK, and make a separate directory Code/Build/VTK into which the binaries will be built.

$ mkdir -p ~/BUILD/VTK

Open CMake by typing "CMake" in Spotlight. Set the source and binary directories to the 2 directories above. Click Configure. Check the boxes for 
Module_vtkGUISupportQt
Module_vtkGUISupportQtOpenGL
Module_vtkGUISupportQtSQL
Module_vtkIOFFMPEG
x  Module_vtkIOMySQL
Module_vtkRenderingParallel
Module_vtkRenderingQt
VTK_Group_Qt

If you compiled FFMPEG from scratch, don't forget to specify the paths of the created libraries to VTK in cmake. Click the configure button until no more red appears, and the press generate. This will generate an XCode project in the VTK Build directory. Open this XCode project and compile it.

2.3 ITK

ITK (the Insight Segmentation and Registration Toolkit) is an open-source image processing library used by GoFigure. GoFigure works with the latest version of ITK (v4). Similar to VTK, you can get the ITK source code by git. In Terminal, change directory to your Source root and then type:

$ git clone git://itk.org/ITK.git

Make sure you have created a build directory for ITK as described above. Open CMake, set the ITK source and build directories and then click configure. Choose XCode project. Check the box for:

ITK_USE_REVIEW            ON

Click configure and then generate. Open the XCode project and compile ITK.

2.4 Boost

Boost is a C++ class library that extends the basic ANSI C++ standard with a lot of useful classes. The container classes are used in GoFigure. Follow the instructions at https://svn.boost.org/trac/boost/wiki/CMake i.e.

  • Get the latest stable release
  • Configure with cmake
  • build
  • install

3 GoFigure2

  • Get the source
    $ git clone git://github.com/gofigure2/GoFigure2.git
$ mkdir -p ~/BUILD/gofigure2
$ cd ~/BUILD/gofigure2
$ ccmake ~/path/to/GoFigure2/
$ make -j8