Skip to content

Build Instructions: macOS‐specific

Étienne Léger edited this page Jun 10, 2024 · 1 revision

Follow the general instructions first to install dependencies.

The build process shown here was done on macOS Catalina version 10.15.7. Required steps should however be near-identical on newer versions of macOS.

Git

Make sure you have Git installed Open terminal and type: git --version

CMake

CMake is a program that helps build software packages. It generates makefiles, which are used to build executable programs from source code.

  1. Download CMake. Here is what CMake looks like when it is opened:

image
Figure 1.

Qt

Qt (pronounced “cute”) is a software to develop GUIs (like that of IBIS) and multi-platform applications.

  1. Xcode must be installed before downloading Qt.
  2. Download Qt.
  3. To download Qt, you will need to make an account. Do this when prompted by the installer.
  4. Follow the Qt Setup installer
  5. Download Qt 5.12.9, unless more recent versions have been successfully tested with IBIS. Selecting components:

image
Figure 2. 6. This process installs Qt in /Users/username/Qt (unless otherwise specified).

Building IBIS

  1. Make a directory to keep the source code (and builds). This directory is referred to below as basedir. In terminal, navigate to the desired folder (cd folder_name). Create a new directory (mkdir basedir).

  2. In directory basedir, clone the Ibis repository into a directory named “src” (git clone https://github.com/IbisNeuronav/Ibis.git src) You should work from a forked repository

Configure: fork

Fetch upstream

Useful link (fetch upstream + git push origin master): example

  1. Make a directory for the build (mkdir build).

  2. So far, the IBIS source code is downloaded in src and a directory for the build is created. The basedir directory (called “ibis” here) should look like this:

image
Figure 3.

  1. Now, it’s time to build IBIS! For the first time building IBIS, it is easiest to use the SuperBuild mechanism (see basedir/src/IbisSuperBuild). The SuperBuild mechanism builds the dependencies IBIS requires, for example VTK and ITK. In future builds, these dependencies can be accessed so another SuperBuild is not required.
  2. To build IBIS, CMake is used to create a makefile from the source code. The makefile contains instructions to build programs. Open CMake. In the “source code” field, enter the path to IbisSuperBuild (basedir/src/IbisSuperBuild). In the “build binaries” field, enter the path to build (basedir/build). Next, press Configure (red box in the figure below).

image
Figure 4.

  1. There will most likely be an error. This happens because CMake cannot find Qt. No problem! Replace Qt5_DIR-NOTFOUND (the blue box in the figure below) with the path to Qt5. This should be /Users/username/Qt/5.12.9/clang_64/lib/cmake/Qt5, unless the path to Qt is different.

image
Figure 5.

  1. Press Configure again. Now, CMake should look something like the figure below. You have the option to build Elastix and OpenCV. These may be required to use some IBIS plug-ins, but are not required for basic functionality. Check the boxes if you want them built. Press Configure again.

image
Figure 6.

  1. Now, there should no longer be any red values. The configuration we just did is stored in the build folder (CMakeCache.txt). You will notice that this folder is now populated.

image
Figure 7.

image
Figure 8.

  1. Next, press Generate (beside Configure) to generate a makefile. The makefile will appear in the build folder.

image
Figure 9.

image
Figure 10.

  1. Now, in Terminal, navigate to the build folder (cd basedir/build). Once there, use the “make” Linux/Unix command by simply typing “make” (make -j# will be faster, # is number of jobs to run simultaneously – eg. make -j3). This will begin the SuperBuild process. In the Terminal window, you should see a constant stream of downloads and installs.

Once the SuperBuild finishes, IBIS is built! You will notice the dependencies are also built in basedir/build/IbisDeps. The IBIS application is located in basedir/build/Ibis/Ibis.

image
Figure 12.

You may look at the Getting Started guide.

Qt Creator

When installing Qt5.12, the IDE Qt Creator was also installed. IBIS can be open, built and run from Qt Creator.

Open Qt Creator (found in /Users/username/Qt/).

image
Figure 13.

In the projects tab, open the CMakeLists.txt file (basedir/src/CMakeLists.txt). After this, you can import the existing build ((basedir/build/Ibis). From here, you can edit and debug the code.