The following steps describe the whole procedure to build and install CBICATk.
Before building the CBICA Toolkit (CBICATk), the following software libraries are required to be installed. Please note that to build in Windows, CMake needs to be used an appropriate compiler (Win32 or Win64 version of Visual Studio is recommended). The selected solution platform is needed to match with dependent libraries.
Package | Version | Description |
Archiver | (7-zip for Windows, gzip for Linux) | |
C++ compiler | (MSVC/11.x, MSVC/12.x, GCC/4.8.1, GCC/4.9.2) | |
CMake | 2.8.4 or higher | To compile and build CBICATk and its dependencies |
ITK | 4.7 or higher | Build VTK before proceeding to compile ITK. Instructions to compile ITK are given here. During CMake configuration, enable the Module_ITKVtkGlue flag |
OpenCV | 3.0 or higher | All machine learning algorithms. This generally comes pre-compiled; if not found for your system, steps similar to those done for VTK and ITK can be done. |
Doxygen | [OPTIONAL] For documentation only |
Ensure all dependencies are met before proceeding.
Please follow commands below in a shell/terminal (e.g., Bash). They will configure and build CBICATk using GNU Make. The main CMake configuration file (CMakeLists.txt) is located in the root directory of the package.
tar xzf CBICATk-${version}-source.tar.gz mkdir CBICATk-${version}-build cd CBICATk-${version}-build
[Note: In Windows, an appropriate compression program (e.g., 7-zip) might be used to extract the files.]
cmake ../CBICATk-${version}-source
Use the CMake variable CMAKE_INSTALL_PREFIX to specify the installation directory, as in:
cmake -DCMAKE_INSTALL_PREFIX=/opt/software/geodesic ../CBICATk-${version}-source
For Windows, open CMake-GUI and select CBICATk-${version}-source
as the "source" directory and select CBICATk-${version}-build
as the "build" directory. Click on "Configure" and select the appropriate C++ compiler. If there weren't any configuration errors, click "Generate".
CMake should be able to find the dependencies if they are specified in the $PATH
variable in your environment. If you have custom installation directories, then ensure that they have been added to the $PATH
variable or point the variable(s) ${Dependency}_DIR to the appropriate build paths where ${Dependency}Config.cmake
is/are present (for example, in the case of ITK, point ITK_DIR
to the directory where ITKConfig.cmake
is present) - this should be either the build directory or the installation directory. If you are using a bash shell, it can be done using the following command:
cmake -DITKDIR=${path_to_custom_ITK_build_dir} -DOpenCV_DIR=${path_to_custom_OpenCV_build_dir} CBICATk-${version}-source
This step will generate platform-specific project files (for example, Make file for GCC and Visual Studio solution file for MSVC).
Some of the options that can be set are:
BUILD_DOCUMENTATION | Builds the documentation from scratch |
BUILD_TESTING | Enables unit testing |
CMAKE_INSTALL_PREFIX | Path where the project will be installed |
make
For Windows, you should launch the generated solution file of Visual Studio (by default, only Release
version of the code will be compiled - if this needs to be changed, it can be done so by editing the variable CMAKE_CONFIGURATION_TYPE
during the CMake configuration step), and then build solution.
To build the documentation from scratch, the BUILD_DOCUMENTATION
option in the CMake configuration needs to be enabled.
make doc
For Windows, build the doc project in the loaded solution.
To perform tests, the BUILD_TESTING
option in the CMake configuration needs to be enabled.
make test
For Windows, you should build the RUN_TESTS project.
In case of failing tests, re-run the tests, but this time by executing CTest directly with the '-V' option to enable verbose output and redirect the output to a text file, as in the example below (works for both Windows and Linux on the command line or shell):
ctest -V >& CBICATk-test.log
And send the file CBICATk-test.log as attachment of the issue report to softw. are@ cbica .upe nn.ed u
make install
For Windows, you should build the INSTALL project.
Upon the success of the above compilation and build process, CBICATk is installed into the directory specified by the CMAKE_INSTALL_PREFIX
, which was set during step 2.2 above.