Default SUITESPARSE to OFF due to GPL licensing Ceres requires the CHOLMOD supernodal factorization and SPQR components of SuiteSparse, which are only available under GPL or commercial terms. Because SuiteSparse was previously autodetected and linked whenever present, a default build could silently become GPL licensed without the user choosing that outcome. Make SuiteSparse support opt-in by defaulting SUITESPARSE to OFF, document the licensing implications in the installation guide. Fixes #1026 Change-Id: I1cfb2148b830a72fa18caadcff76f35a50aeb179
diff --git a/CMakeLists.txt b/CMakeLists.txt index 19ee2a8..d864845 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -85,7 +85,7 @@ include(CMakeDependentOption) include(PrettyPrintCMakeList) -option(SUITESPARSE "Enable SuiteSparse." ON) +option(SUITESPARSE "Enable SuiteSparse." OFF) if (APPLE) option(ACCELERATESPARSE "Enable use of sparse solvers in Apple's Accelerate framework." ON) @@ -407,16 +407,15 @@ set(RELATIVE_CMAKECONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/Ceres) if (SUITESPARSE) - # By default, if SuiteSparse and all dependencies are found, Ceres is - # built with SuiteSparse support. + # SuiteSparse support is opt-in and was explicitly requested. If it and + # all of its dependencies are found, Ceres is built with SuiteSparse + # support. # Check for SuiteSparse and dependencies. find_package(SuiteSparse 4.5.6 COMPONENTS CHOLMOD SPQR OPTIONAL_COMPONENTS Partition) if (SuiteSparse_FOUND) set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})") - # By default, if all of SuiteSparse's dependencies are found, Ceres is - # built with SuiteSparse support. message("-- Found SuiteSparse ${SuiteSparse_VERSION}, " "building with SuiteSparse.")
diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 2329b0f..6548281 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst
@@ -629,15 +629,19 @@ note that if ``LAPACK=ON`` and ``SUITESPARSE=ON``, the ``LAPACK`` and ``BLAS`` libraries used by SuiteSparse and Ceres should be the same. -#. ``SUITESPARSE [Default: ON]``: By default, Ceres will link to - ``SuiteSparse`` if it and all of its dependencies are present. Turn - this ``OFF`` to build Ceres without ``SuiteSparse``. +#. ``SUITESPARSE [Default: OFF]``: SuiteSparse support is opt-in. Turn this + ``ON`` to link Ceres against ``SuiteSparse``, provided it and all of its + dependencies are present. - .. NOTE:: + .. WARNING:: - SuiteSparse is licensed under a mixture of GPL/LGPL/Commercial - terms. Ceres requires some components that are only licensed under - GPL/Commercial terms. + SuiteSparse is licensed under a mixture of GPL/LGPL/Commercial terms. + Ceres requires the CHOLMOD supernodal factorization and SPQR components, + which are only available under GPL/Commercial terms. Consequently, unless + you hold a commercial SuiteSparse license, a Ceres build with + ``SUITESPARSE=ON`` is GPL licensed. This is why SuiteSparse support is + opt-in rather than enabled by default. Obtaining a commercial SuiteSparse + license removes this restriction. #. ``ACCELERATESPARSE [Default: ON]``: By default, Ceres will link to Apple's Accelerate framework directly if a version of it is detected
diff --git a/docs/source/version_history.rst b/docs/source/version_history.rst index f6a9193..a4581eb 100644 --- a/docs/source/version_history.rst +++ b/docs/source/version_history.rst
@@ -20,6 +20,14 @@ #. Clarify building Ceres Solver from Git sources in the installation documentation. +Backward Incompatible API Changes +--------------------------------- + +#. The ``SUITESPARSE`` CMake option now defaults to ``OFF``. Passing + ``-DSUITESPARSE=ON`` restores the previous behavior, but makes the + resulting Ceres build GPL licensed unless you hold a commercial + SuiteSparse license. + 2.2.0 =====