geometry-central manages its dependenices via a mix of git submodules, configure-time downloading, and system libraries. However, the build system is explicitly set up such that cloning and building should immediately work on any vaguely reasonable machine, without chasing down dependencies.
Remember, clone with:
git clone --recurse-submodules https://github.com/nmwsharp/geometry-central.git
to ensure you resolve git submodules. If you cloned without submodules, you can get them afterwards with:
git submodule update --init --recursive
Eigen is used for linear algebra within geometry-central. Eigen presents a bit of a special challenge as a dependency because many programmers already have Eigen in the project or system, and intermingling multiple copies of Eigen can be problematic.
As such, the build system uses the following strategies in order to resolve Eigen:
- The target
Eigen3::Eigenis already defined somewhere. Use the predefined target over any hints from the user
- Using Eigen in any directory passed via the
GC_EIGEN_LOCATIONCMake variable (empty by default)
- Using Eigen from your system libraries, as resolved via
- Downloading a copy of Eigen in to the
For instance, if your project already has a copy of Eigen in its source tree, you can use with (2) by setting
GC_EIGEN_LOCATION. If not, many programmers have installed Eigen, which will be found in (3). Finally, as a last resort the build system will download a copy of Eigen as in (4).
geometry-central is known to work with version 3.3 of Eigen; other versions have not been tested (but recent versions probably work).
Note: once upon a time, Eigen was a submodule of geometry-central. If updating from an old version, you may need to manually delete
Suitesparse is an optional dependency which improves the performance and robustness of geometry-central’s sparse linear solver routines. If Suitesparse is detected at configure time, linear solves will automatically use Suitesparse under the hood, and otherwise they will default to Eigen’s solvers. The output of the CMake script will indicate whether or not Suitesparse was found.
At any time, setting the
SUITESPARSE CMake variable to false will stop the build system from using Suitesparse, even if it is availble.
Installing suitesparse is up to the user. If using homebrew on OSX,
brew install suitesparse should be sufficient. On Ubuntu, try
apt-get install libsuitesparse-dev. Suitesparse is notoriously difficult to install on Windows—if you find a good method, let us know!