Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

OSX build instructions

Jean-Christophe Houde edited this page Oct 16, 2015 · 8 revisions

Use these instructions to build the Fibernavigator on OSX (10.6 and later).

NOTE: we always recommend using the prebuilt versions available on the Releases page. Use those instructions if prebuilt versions do not work for you or if you want to develop new features.

CMake

You will need to install CMake, which is a cross-platform open-source build system.

MacPorts

MacPorts is a utility to configure, compile and install tools and programs designed for the X11 system on a Mac. This can be used to install programs which you are used to, but are normally only available on Linux. You can get MacPorts. You should always take the time to check if the library or program you want has not been compiled natively on the Mac, because you can sometimes encounter problems when using MacPorts.

You will need to install MacPorts to install and correctly compile glew. Once MacPorts is installed, you can get it by issuing the following command

sudo port install glew +universal

Here, the "+universal" part is important if you want to compile both 32- and 64-bits builds. With the current situation of the Fibernavigator (which can only be compiled in 32 bits), the dual structure of glew is needed.

wxWidgets 3.0.x for OSX

wxWidgets 3.0.x is now needed for the FiberNavigator.

Although it has not been tested recently, we recommend using MacPorts to install it, by using

sudo port install wxWidgets-3.0 +universal

If, later on in the compiling process, this version does not work (for example, architecture mismatch), it is always possible to compile it by hand. To do so, follow the instructions in the following section.

If everything works as expected, proceed to the last section.

Configuring and compiling wxWidgets

It was previously needed to download the OSX 10.6 SDK, but it doesn't seem needed anymore. Flag an issue if that seems to create some problems for you.

If you need to manually compile wxWidgets, you need

  1. Get the source code for wxWidgets. Use version 3.0.2
  2. Unpack the source in a directory of your choice.
  3. In the source folder, create a subdirectory called something like build-release-i386.
  4. Cd to this directory.
  5. Create a variable to hold the architecture type to use with the compiler using
arch_flags="-arch i386"
6.3 If on OSX 10.9, configure the build using:
../configure --with-opengl --prefix="$(pwd)" CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" --with-macosx-version-min=10.6
  1. Note that the "--prefix=" part is important for this setup. You should set it to the exact path where the libraries will be built. In the tested configuration, the libs stayed in the "Documents" folder of the user, since he didn't want to use them for all the system. It should also be possible to set it to "/usr/local/lib/" and do a "make install", but it hasn't been tested.
  2. Issue the "make" command. This can take between 5 and 10 minutes, depending on the machine.
  3. Once the librairies have been built, do a quick check using
otool -D libwx_baseu-3.1.0.0.0.dylib

in the build-release/lib directory. If the path written is the full path of the lib, you are ok.

Configure and build the Fibernavigator

With the wxWidgets librairies built, we can now configure and build the Fibernavigator. To do so, you must

  • Clone the source repo (see the Code page).
  • Create the make file or Xcode project using CMake. You can either call the ccmake command line tool, or use the CMake gui. The source directory should be set to the "src" subdirectory of your code, and the build directory should be set to the "build" subdirectory of your code.
  • When running ccmake or the CMake gui, you must make sure that
    • CMAKE_OSX_ARCHITECTURES is set to i386
    • wxWidgets_CONFIG_EXECUTABLE is set to the 'wx-config' program you generated when building wxWidgets. Normally, it should be in the "build-release" folder. If it was installed through MacPorts, it should be somewhere in /opt/lib...
  • Once the variables have correctly been set, and the makefile or Xcode project has been generated, you can build the Fibernavigator as usual. It should then execute normally.