Installation

Requisites and dependencies

NeuroSTR uses CMake as a general build tool. It requires CMake 3.2.0 or superior.

The library uses some of the C++14 standard features, so it needs a compiler with C++14 support.

Compiler Version Tested
g++ >5 Tested: 5.4.1
clang >3.4 No
Microsoft Visual Studio >2015 No

NeuroSTR also uses the following software depèndencies, some of them are header libraries bundled in the package:

Library Version License Bundled What for?
Boost >1.62.0 BSL-1 No Everything...
Eigen3 3.X MPL-2 No Singular value decomposition and quaternion calculation
tree.hh 3.1 GPL2/3 Yes Neurite tree structure container
rapidJSON 1.1.0 MIT Yes JSON file read/write
spdlog 0.11.0 MIT Yes Logging
base-n 1.0 MIT Yes Write binary data (image) as base64 string
(optional) UnitTest++ 1.6.1 MIT No Unit tests

Specifically, these are the boost libraries used in NeuroSTR:

Compile and Install

Library

  1. Create a directory called build in the NeuroSTR source directory
  2. Change to build directory and run the cmake .. command to configure your build and generate the Makefile. On Windows you can do the same with the cmake-gui app.
  3. Run make neurostr from the build directory to compile the library.

If the build is successful, you will fin the library binary libneurostr in the lib folder and the header files in the include folder.

Note: To speed up the compilation process you can parallelize it using the -j flag in the make command. For example, to use 8 parallel threads the command will be make -j 8 neurostr

Tools

  1. Create a directory called build in the NeuroSTR source directory
  2. Change to build directory and run the cmake .. command to configure your build and generate the Makefile. On Windows you can do the same with the cmake-gui app.
  3. Run make tools from the build directory to compile the library. If you haven't compiled the library yet, it will do it.

If the build is successful, you will fin the library binary libneurostr in the lib folder , the header files in the include folder and the executable binaries, the tools, in the bin folder.

To build specific tools, just use their name as target. For example, make Validator will only build the Validator executable.

Note: To speed up the compilation process you can parallelize it using the -j flag in the make command. For example, to use 8 parallel threads the command will be make -j 8 tools

Install

The make install command will copy the library headers, binaries and their bundled dependencies to the following directories in the install directory:

  • lib/neurostr/ for the library binary
  • bin/ for the executables
  • include/neurostr for the library headers
  • include/ for the bundled headers

There are several variables that you can set while running the cmake command to change the default install directory (/usr/local) or to avoid installing the bundled libraries or the executables:

Flag Default value What it does...
CMAKE_INSTALL_PREFIX /usr/local Default install directory
NO_INSTALL_BUNDLED false If true, bundled headers are not installed
NO_INSTALL_RAPIDJSON false If true, rapidjson headers are not installed
NO_INSTALL_SPDLOG false If true, spdlog headers are not installed
NO_INSTALL_TREE false If true, tree.hh header is not installed
NO_INSTALL_BASEN false If true, basen.hhp header is not installed
NO_INSTALL_TOOLS false If true, executables are not installed

For example, this will install the library but not the tools at /home/cig/local:

cmake -DCMAKE_INSTALL_PREFIX="/home/cig/local" -DNO_INSTALL_TOOLS=true ..

Warning: You will probably need super user privileges to install the library in the default install directory.

Testing

  1. Got to the Library section and compile the library.
  2. Still in the build directory, run make neurostr_test to compile the tests. This will generate a executable called neurostr_test in the test folder
  3. Run make run_test to execute the tests. Don't worry about the warning and errors messages in the console as they are the expected output in some error test cases.
  4. In case all tests pass, the line Success: 415 tests passed. should appear on the console.

Warning: In case that CMake wasn't able to find the UnitTest++ library, the neurostr_test will not exist.

Note: Only core and io (partially) modules are covered by unit tests.