The remaining dependencies are already installed on most systems. See the maintainers' links above for installation instructions. This section is intended to be a quick guide to get started.
On a Macintosh, the simplest way to install CMake and Boost is via a package management system such as MacPorts or Homebrew.
To install CMake:
sudo port install cmake
To install Boost:
sudo port install boost
If using MacPorts, add
/opt/local/bin to the
PATH. For further instructions, see Installing MacPorts.
To install CMake:
brew install cmake
To install Boost:
brew install boost
Visit the CMake and Boost websites for more information about installing these tools.
The source may be obtained via git:
git clone https://software.crsim.utah.edu:8443/James_Research_Group/SpatialOps.git [destination path]
There are three ways to configure SpatialOps for a particular build: using CMake, a command-line build system generator which takes in flags as arguments; using
ccmake, an executable for CMake which opens the Curses Interface for CMake, a GUI which allows editing of flags and options; or, using one of the first two options to initially set up the configuration and then manually modifying the CMake files in the build directory.
If the build of SpatialOps must be used in another project which will require it,
make install must be run to build the necessary CMake configure file.
The following table summarizes the available build options
|Maximum number of active threads in the threadpool (only if |
|The minimum compute capability to tolerate for CUDA devices.|
While not required, it is strongly recommended to build in a directory other than the source code directory. This is recommended because some files are modified for GPU support, and building in the source code directory may break SpatialOps. To avoid this, SpatialOps and Nebo developers may use a build directory which can either be a subdirectory of the source directory or contained in a separate part of the file system.
After SpatialOps has been configured, it must be built by issuing the
make command in the build directory. The
make command can take the name of an executable as an option to build only that executable; but, by default, it builds everything. The
make command can also take a
-j<n> flag where
<n> is the number of threads to be used during the build process. (This option may either speed up or slow down the build time, depending on the system being used.)
Note that SpatialOps relies on heavily templated code and can use substantial memory when compiling. Therefore, parallel builds should be done only on systems with adequate memory resources. 1 GB per parallel build process is more than adequate.
cmake [path to src] -DCMAKE_BUILD_TYPE=Release make -j4 install
cmake [path to src] \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DENABLE_EXAMPLES=ON make install
-DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j8should be eliminated below.
cmake [path to src] \ -G "Eclipse CDT4 - Unix Makefiles" \ -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j8 \ -DCMAKE_BUILD_TYPE=Debug
cmake [path to src] \ -G "Xcode" \ -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j8 \ -DCMAKE_BUILD_TYPE=Debug
cmake [path to src] \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_CUDA=ON \ -DCUDA_ARCHITECTURE=3.0 make -j4
make install, the following directory structure is created:
install_dir |- include | |- spatialops | | |- ... |- lib | |- spatialops | | |- ... |- bin | + spatialops |- share | |- SpatialOpsConfig.cmake
If using CMake for downstream applications:
[install_dir]/sharefolder where SpatialOps was installed to. The
find_packagecommand will define two key variables:
SpatialOps_INCLUDE_DIR– provides the appropriate inclusion path for the compiler. This should be set using
spatialops– the library to link to using
If CMake will not be used for downstream applications:
[install_dir]/lib/spatialopspath and the appropriate library located in that directory.
[install_dir]/include/in the inclusion path.
To build the tests and examples, set
ENABLE_EXAMPLES=ON when configuring SpatialOps (see Configuring SpatialOps).
To run tests, simply use:
or, to run multiple tests concurrently,
N is the level of concurrency.
make install has been run, then the examples are installed into
[install_dir]/bin/spatialops. Otherwise, just run
make; then the examples can be found in the
examples directory in the build directory.