From 76b431ef0495776f9cce48dd4d212927c3c0c627 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Tue, 28 Jul 2026 00:53:24 +0200 Subject: [PATCH] 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 --- CMakeLists.txt | 9 ++++----- docs/source/installation.rst | 18 +++++++++++------- docs/source/version_history.rst | 8 ++++++++ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19ee2a864..d864845b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ enable_testing() 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 @@ endif (LAPACK) 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 2329b0f45..6548281c3 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -629,15 +629,19 @@ Options controlling Ceres configuration 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 f6a9193dd..a4581eb0c 100644 --- a/docs/source/version_history.rst +++ b/docs/source/version_history.rst @@ -20,6 +20,14 @@ Bug Fixes & Minor Changes #. 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 =====