-
Notifications
You must be signed in to change notification settings - Fork 24
Build Instructions: macOS‐specific
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.
Make sure you have Git installed Open terminal and type: git --version
CMake is a program that helps build software packages. It generates makefiles, which are used to build executable programs from source code.
- Download CMake. Here is what CMake looks like when it is opened:
Figure 1.
Qt (pronounced “cute”) is a software to develop GUIs (like that of IBIS) and multi-platform applications.
- Xcode must be installed before downloading Qt.
- Download Qt.
- To download Qt, you will need to make an account. Do this when prompted by the installer.
- Follow the Qt Setup installer
- Download Qt 5.12.9, unless more recent versions have been successfully tested with IBIS. Selecting components:
Figure 2.
6. This process installs Qt in /Users/username/Qt (unless otherwise specified).
-
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).
-
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
-
Make a directory for the build (mkdir build).
-
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:
Figure 3.
- 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.
- 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).
Figure 4.
- 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.
Figure 5.
- 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.
Figure 6.
- 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.
Figure 7.
Figure 8.
- Next, press Generate (beside Configure) to generate a makefile. The makefile will appear in the build folder.
Figure 9.
Figure 10.
- 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.
Figure 12.
You may look at the Getting Started guide.
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/).
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.