Update and simplify documentation for Ceres 2.3 dependency baselines - Update installation.rst, version_history.rst, and contributing.rst for CMake >= 3.28, Eigen >= 3.4.0 (including Eigen 5), SuiteSparse >= 7.6.1, Google Benchmark >= 1.8.3, Abseil >= 20260817.0, Ubuntu 24.04/26.04, and Visual Studio 2022+. - Remove obsolete TBB/SuiteSparseQR notes, single-precision CHOLMOD version caveats, and prebuilt SuiteSparse 5.13.0 Windows archive instructions; document upstream SuiteSparse 7 / OpenBLAS builds and vendored SuiteSparse_metis. - Note Bazel 8.6 / 9.1+ requirement for abseil-cpp 20260817.0 and recommend --recurse-submodules by default. - Update sample solver summary strings from suitesparse-(7.1.0) to suitesparse-(7.6.1). Change-Id: I7149fda5319f7f91970c157100a75c1e4efed57a
diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index babbe38..865cc3e 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst
@@ -41,11 +41,12 @@ grants Google a royalty-free, unlimited license to use your contributions while you retain copyright. -3. Clone the Ceres Solver ``git`` repository from Gerrit: +3. Clone the Ceres Solver ``git`` repository from Gerrit (including the + bundled ``Abseil`` and ``GoogleTest`` submodules): .. code-block:: bash - git clone https://ceres-solver.googlesource.com/ceres-solver + git clone --recurse-submodules https://ceres-solver.googlesource.com/ceres-solver 4. Build Ceres following the instructions in
diff --git a/docs/source/gradient_tutorial.rst b/docs/source/gradient_tutorial.rst index 0d9c823..c7829e2 100644 --- a/docs/source/gradient_tutorial.rst +++ b/docs/source/gradient_tutorial.rst
@@ -112,7 +112,7 @@ 33: f: 4.835994e-17 d: 1.00e-12 g: 1.05e-07 h: 1.13e-06 s: 1.00e+00 e: 1 it: 1.19e-06 tt: 3.34e-04 34: f: 1.885250e-22 d: 4.84e-17 g: 2.69e-10 h: 1.45e-08 s: 1.00e+00 e: 1 it: 9.54e-07 tt: 3.37e-04 - Solver Summary (v 2.3.0-eigen-(3.4.0)-lapack-suitesparse-(7.1.0)-metis-(5.1.0)-acceleratesparse-eigensparse) + Solver Summary (v 2.3.0-eigen-(3.4.0)-lapack-suitesparse-(7.6.1)-metis-(5.1.0)-acceleratesparse-eigensparse) Parameters 2 Line search direction LBFGS (20)
diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 21b257e..ddfd593 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst
@@ -18,10 +18,10 @@ optional. For details on customizing the build process, see :ref:`section-customizing`. -- `CMake <https://cmake.org>`_ (**Required**) 3.22 or later. +- `CMake <https://cmake.org>`_ (**Required**) 3.28 or later. - `Eigen <https://libeigen.gitlab.io/>`_ - (**Required**) 3.3.4 or later. + (**Required**) 3.4.0 or later (including Eigen 5). .. NOTE :: @@ -29,34 +29,27 @@ library. See the documentation for ``WITH_EIGENSPARSE`` for more details. -- `Abseil <https://abseil.io/>`_ (**Required**) 20240116 or later. +- `Abseil <https://abseil.io/>`_ (**Required**) 20260817.0 or later. - `GoogleTest <https://github.com/google/googletest>`_ (**Optional**; required to build and run tests) 1.14.0 or later. - `Google Benchmark <https://github.com/google/benchmark>`_ (**Optional**; - used if ``BUILD_BENCHMARKS`` is ``ON``). + used if ``BUILD_BENCHMARKS`` is ``ON``) 1.8.3 or later. - `SuiteSparse <https://people.engr.tamu.edu/davis/suitesparse.html>`_ - (**Optional; strongly recommended for large problems**) 4.5.6 or - later (7.4.0 or later for single-precision ``CHOLMOD`` support). Needed - for solving large sparse linear systems. Because ``SuiteSparse``'s - supernodal ``CHOLMOD`` and ``SPQR`` components are licensed under the - GPL, ``WITH_SUITESPARSE`` defaults to ``OFF``; pass + (**Optional; strongly recommended for large problems**) 7.6.1 or + later. Needed for solving large sparse linear systems. Because + ``SuiteSparse``'s supernodal ``CHOLMOD`` and ``SPQR`` components are + licensed under the GPL, ``WITH_SUITESPARSE`` defaults to ``OFF``; pass ``-DWITH_SUITESPARSE=ON`` to ``CMake`` to enable it (see ``WITH_SUITESPARSE`` in :ref:`options-controlling-ceres-configuration`). - .. NOTE :: - - If SuiteSparseQR is found, Ceres attempts to find the Intel - Threading Building Blocks (TBB) library. If found, Ceres assumes - SuiteSparseQR was compiled with TBB support and links against the - found TBB version. You can customize the searched TBB location - with the ``TBB_ROOT`` variable. - -- `METIS <https://github.com/KarypisLab/METIS>`_ (**Optional**) Used by - ``SuiteSparse``, optionally by ``Eigen``'s sparse solvers (when - ``WITH_EIGENMETIS=ON``), and directly by Ceres for graph partitioning. +- `METIS <https://github.com/KarypisLab/METIS>`_ (**Optional**) Used + by ``Eigen``'s sparse solvers for nested dissection ordering when + ``WITH_EIGENMETIS=ON``. ``SuiteSparse`` 7 bundles its own internal + copy of METIS inside ``CHOLMOD``, so an external ``METIS`` + installation is not required for ``SuiteSparse`` partitioning. - `Apple's Accelerate sparse solvers <https://developer.apple.com/documentation/accelerate/sparse-solvers-library>`_ (**Optional**) @@ -84,9 +77,10 @@ build system automatically detects and uses it. On Windows, ``BLAS`` and ``LAPACK`` (such as ``OpenBLAS`` or ``Intel MKL``) - can be installed via `vcpkg <https://github.com/microsoft/vcpkg>`_ or - `MSYS2 <https://www.msys2.org/>`_, or obtained as part of the prebuilt - ``SuiteSparse`` binary packages (see :ref:`section-windows`). + can be installed via `vcpkg <https://github.com/microsoft/vcpkg>`_, + `MSYS2 <https://www.msys2.org/>`_, or prebuilt `OpenBLAS binary archives + <https://github.com/OpenMathLib/OpenBLAS/releases>`_ + (see :ref:`section-windows`). - `CUDA <https://developer.nvidia.com/cuda/toolkit>`_ and `cuDSS @@ -123,21 +117,17 @@ You can start with the `latest stable release <https://github.com/ceres-solver/ceres-solver/releases/latest>`_ or clone the -Git repository for the latest development version: - -.. code-block:: bash - - git clone https://github.com/ceres-solver/ceres-solver - -If your system does not have recent enough versions of `Abseil -<https://abseil.io/>`_ (>= 20240116) or `GoogleTest -<https://github.com/google/googletest>`_ (>= 1.14.0), clone the repository with -its bundled submodules: +Git repository with its bundled ``Abseil`` and ``GoogleTest`` submodules: .. code-block:: bash git clone --recurse-submodules https://github.com/ceres-solver/ceres-solver +If your system already provides `Abseil <https://abseil.io/>`_ +(>= 20260817.0) and `GoogleTest <https://github.com/google/googletest>`_ +(>= 1.14.0), you can omit ``--recurse-submodules`` and let CMake find the +installed packages instead. + The build instructions below use ``ceres-solver`` as the source directory. If you downloaded and extracted a release archive instead of cloning the Git repository, replace ``ceres-solver`` with the extracted @@ -154,17 +144,15 @@ .. NOTE:: - Ceres Solver always supports the previous and current Ubuntu LTS - releases, currently 22.04 and 24.04 using the default Ubuntu - repositories and compiler toolchain. Support for earlier versions - is not guaranteed or maintained. + Ceres Solver supports the previous and current Ubuntu LTS releases, + currently 24.04 and 26.04, using the default Ubuntu repositories and + compiler toolchain. Support for earlier versions is not maintained. - Because the default ``apt`` repositories on Ubuntu 22.04 and 24.04 - ship versions of ``libabsl-dev`` older than ``20240116``, we - recommend cloning Ceres with ``--recurse-submodules`` on those - distributions so that CMake automatically builds the bundled + Because the default ``apt`` repositories on Ubuntu 24.04 and 26.04 + ship versions of ``libabsl-dev`` older than ``20260817.0``, clone + Ceres with ``--recurse-submodules`` so that CMake builds the bundled ``Abseil`` and ``GoogleTest`` submodules in ``third_party/``. On - newer distributions that ship ``Abseil >= 20240116`` and + distributions that ship ``Abseil >= 20260817.0`` and ``GoogleTest >= 1.14.0``, you can install ``libabsl-dev`` and ``libgtest-dev`` directly via ``apt``. @@ -180,8 +168,10 @@ sudo apt-get install libeigen3-dev # SuiteSparse and METIS (optional) sudo apt-get install libsuitesparse-dev libmetis-dev - # Abseil and GoogleTest (if your distribution ships >= 20240116 and >= 1.14.0; - # otherwise clone Ceres with --recurse-submodules) + # Google Benchmark (optional) + sudo apt-get install libbenchmark-dev + # Abseil and GoogleTest (only if your distribution ships >= 20260817.0 + # and >= 1.14.0; otherwise clone Ceres with --recurse-submodules) sudo apt-get install libabsl-dev libgtest-dev We are now ready to build, test, and install Ceres. @@ -218,7 +208,7 @@ 5 1.803399e+04 5.33e+01 1.48e+04 1.23e+01 9.99e-01 8.33e+05 1 4.74e-02 3.06e-01 6 1.803390e+04 9.02e-02 6.35e+01 8.00e+01 1.00e+00 2.50e+06 1 4.76e-02 3.54e-01 - Solver Summary (v 2.3.0-eigen-(3.4.0)-lapack-suitesparse-(7.1.0)-metis-(5.1.0)-acceleratesparse-eigensparse) + Solver Summary (v 2.3.0-eigen-(3.4.0)-lapack-suitesparse-(7.6.1)-metis-(5.1.0)-acceleratesparse-eigensparse) Original Reduced Parameter blocks 22122 22122 @@ -370,7 +360,7 @@ Building from Source -------------------- -Ceres Solver can also be built from source on Windows using Visual Studio 2019 +Ceres Solver can also be built from source on Windows using Visual Studio 2022 or newer (or MSYS2 / MinGW-w64). #. Create a top-level directory for dependencies, build, and sources somewhere, @@ -378,8 +368,8 @@ #. Obtain the Ceres source code and its dependencies: - #. **Abseil** (>= 20240116) and **GoogleTest** (>= 1.14.0): The simplest way - to provide ``Abseil`` and ``GoogleTest`` when building from source on + #. **Abseil** (>= 20260817.0) and **GoogleTest** (>= 1.14.0): The simplest + way to provide ``Abseil`` and ``GoogleTest`` when building from source on Windows is to clone Ceres with ``--recurse-submodules``: .. code:: bat @@ -391,22 +381,23 @@ ``CMAKE_PREFIX_PATH`` (or set ``absl_DIR`` / ``absl_ROOT`` and ``GTest_DIR`` / ``GTest_ROOT``). - #. **Eigen** (>= 3.3.4): Unpack and configure/install Eigen using CMake, and + #. **Eigen** (>= 3.4.0): Unpack and configure/install Eigen using CMake, and pass ``-DEigen3_ROOT=<path/to/eigen>`` (or ``-DEigen3_DIR=<path/to/Eigen3Config.cmake>``) when configuring Ceres. - #. (Optional) **SuiteSparse**: You can build SuiteSparse on Windows using - `suitesparse-metis-for-windows - <https://github.com/jlblancoc/suitesparse-metis-for-windows>`_ or - official ``SuiteSparse`` CMake releases, or use the prebuilt binary - packages for Visual Studio 2019 and 2022 provided by the `CMake support - for SuiteSparse <https://github.com/sergiud/SuiteSparse>`_ project that - also include `reference LAPACK <https://www.netlib.org/blas/>`_ (and - BLAS). When using the prebuilt ``SuiteSparse`` archive, add its directory - to ``CMAKE_PREFIX_PATH``, enable ``-DWITH_SUITESPARSE=ON``, and set - ``BLAS_blas_LIBRARY`` and ``LAPACK_lapack_LIBRARY`` to - ``<suitesparse_path>/lib/libblas.lib`` and - ``<suitesparse_path>/lib/liblapack.lib``. + #. (Optional) **SuiteSparse** (>= 7.6.1): Install ``SuiteSparse`` via + `vcpkg <https://github.com/microsoft/vcpkg>`__ or `MSYS2 + <https://www.msys2.org/>`__, or build upstream `SuiteSparse + <https://github.com/DrTimothyAldenDavis/SuiteSparse>`__ from source with + CMake (building the ``cholmod;spqr`` projects against ``OpenBLAS`` or + ``Intel MKL``). When building ``SuiteSparse`` with MSVC against prebuilt + MinGW ``OpenBLAS`` binaries, pass ``-DSUITESPARSE_USE_FORTRAN=OFF`` and + ``-DSUITESPARSE_C_TO_FORTRAN="(name,NAME) name##_"`` and ensure + ``openblas\bin`` is on ``PATH``. Then add the ``SuiteSparse`` install + prefix to ``CMAKE_PREFIX_PATH``, enable ``-DWITH_SUITESPARSE=ON``, pass + ``BLAS_blas_LIBRARY`` and ``LAPACK_lapack_LIBRARY`` when configuring + Ceres, and ensure ``suitesparse\bin`` (and ``openblas\bin``) are on + ``PATH`` at runtime for shared builds. #. Install ``CMake``. @@ -718,7 +709,7 @@ command to find all of its dependencies. #. **Config-mode packages** (``Eigen3``, ``absl``, ``GTest``, ``benchmark``, - ``cudss``, ``TBB``, and ``SuiteSparse`` >= 7.0): + and ``cudss``): These dependencies provide CMake package configuration files (``<PackageName>Config.cmake`` or ``<lowercase>-config.cmake``). You can @@ -728,8 +719,7 @@ to search (e.g., ``-DCMAKE_PREFIX_PATH="/opt/local;/custom/prefix"``). - ``<PackageName>_ROOT``: The installation prefix for a specific package (e.g., ``-DEigen3_ROOT=/path/to/eigen``, ``-Dabsl_ROOT=/path/to/abseil``, - ``-Dcudss_ROOT=/usr/lib/x86_64-linux-gnu/libcudss/12``, - ``-DTBB_ROOT=/path/to/tbb``). + ``-Dcudss_ROOT=/usr/lib/x86_64-linux-gnu/libcudss/12``). - ``<PackageName>_DIR``: The exact directory containing the package's ``<PackageName>Config.cmake`` file (e.g., ``-DEigen3_DIR=...``, ``-Dabsl_DIR=...``, ``-DGTest_DIR=...``, ``-Dcudss_DIR=...``). @@ -747,19 +737,21 @@ You can customize the CUDA installation location using ``CUDAToolkit_ROOT`` or ``CUDACXX``. -#. **Find-module dependencies** (``METIS``, ``SuiteSparse`` < 7.0 without - CMake config files, ``AccelerateSparse``, and ``Sphinx``): +#. **Find-module dependencies** (``SuiteSparse``, ``METIS``, + ``AccelerateSparse``, and ``Sphinx``): - When a dependency does not provide a CMake package configuration file, Ceres - uses its bundled ``Find<Package>.cmake`` modules. You can guide these modules - using ``CMAKE_PREFIX_PATH``, ``CMAKE_INCLUDE_PATH``, ``CMAKE_LIBRARY_PATH``, - ``<Package>_ROOT``, or by setting explicit cache variables: + For dependencies that do not ship a unified CMake package configuration + file, Ceres uses its bundled ``Find<Package>.cmake`` modules. You can guide + these modules using ``CMAKE_PREFIX_PATH``, ``CMAKE_INCLUDE_PATH``, + ``CMAKE_LIBRARY_PATH``, ``<Package>_ROOT``, or by setting explicit cache + variables: - - **METIS**: ``METIS_INCLUDE_DIR`` and ``METIS_LIBRARY``. - - **SuiteSparse** (fallback when ``SuiteSparseConfig.cmake`` is not present): + - **SuiteSparse** (delegates to ``SuiteSparseConfig.cmake`` if a packager + provides one; otherwise locates components directly): ``SuiteSparse_<COMPONENT>_INCLUDE_DIR`` and ``SuiteSparse_<COMPONENT>_LIBRARY`` (for components ``AMD``, ``CAMD``, ``CCOLAMD``, ``CHOLMOD``, ``COLAMD``, ``SPQR``, ``Config``). + - **METIS**: ``METIS_INCLUDE_DIR`` and ``METIS_LIBRARY``. - **Sphinx**: ``Sphinx_BUILD_EXECUTABLE``. .. NOTE:: @@ -784,8 +776,9 @@ =================== Ceres Solver also provides a `Bazel <https://bazel.build/>`_ build configuration -using Bzlmod (``MODULE.bazel``), which builds Ceres with ``Eigen`` and -``Abseil`` (and ``GoogleTest`` / ``Google Benchmark`` for tests and benchmarks): +using Bzlmod (``MODULE.bazel``), requiring Bazel 8.6 / 9.1 or later (for +example via ``bazelisk``). It builds Ceres with ``Eigen`` and ``Abseil`` (and +``GoogleTest`` / ``Google Benchmark`` for tests and benchmarks): .. code-block:: bash @@ -821,7 +814,7 @@ .. code-block:: cmake - cmake_minimum_required(VERSION 3.22) + cmake_minimum_required(VERSION 3.28) project(helloworld) @@ -1094,13 +1087,17 @@ - **Abseil replaces glog, gflags, and miniglog**: ``google-glog``, ``gflags``, and ``MINIGLOG`` are no longer used by Ceres. Instead, Ceres requires - `Abseil <https://abseil.io/>`_ (version ``20240116`` or later) and uses + `Abseil <https://abseil.io/>`_ (version ``20260817.0`` or later) and uses `GoogleTest <https://github.com/google/googletest>`_ (version ``1.14.0`` or later) when ``BUILD_TESTING=ON``. If your system does not provide recent enough versions of ``Abseil`` or ``GoogleTest``, clone Ceres with ``git clone --recurse-submodules`` so that CMake automatically builds the bundled submodules in ``third_party/``. -- **CMake minimum version**: Building Ceres now requires CMake 3.22 or later. +- **Updated minimum dependency versions**: Building Ceres now requires CMake + 3.28 or later, Eigen 3.4.0 or later (including Eigen 5), SuiteSparse 7.6.1 or + later (when ``WITH_SUITESPARSE=ON``), and Google Benchmark 1.8.3 or later + (when building benchmarks). Legacy TBB probing for SuiteSparseQR has been + removed. - **CMake feature options use the** ``WITH_`` **prefix**: The Ceres-specific CMake options have been standardized to use the ``WITH_`` prefix: @@ -1147,8 +1144,3 @@ exported Ceres CMake target already contains the definitions of its public include directories which will be automatically included by CMake when compiling a target that links against Ceres. -- While TBB is not used any more directly by Ceres, it might still try - to link against it, if SuiteSparseQR was found. The variable (environment - or CMake) to customize this is ``TBB_ROOT`` (used to be ``TBBROOT``). - For example, use ``cmake -DTBB_ROOT=/opt/intel/tbb ...`` if you want to - link against TBB installed from Intel's binary packages on Linux.
diff --git a/docs/source/nnls_tutorial.rst b/docs/source/nnls_tutorial.rst index 610289c..3eac809 100644 --- a/docs/source/nnls_tutorial.rst +++ b/docs/source/nnls_tutorial.rst
@@ -393,7 +393,7 @@ 13 1.791438e-14 2.69e-13 2.91e-10 3.01e-04 9.37e-01 1.59e+10 1 1.91e-06 4.45e-04 14 1.120029e-15 1.68e-14 3.64e-11 1.51e-04 9.37e-01 4.78e+10 1 2.15e-06 4.48e-04 - Solver Summary (v 2.3.0-eigen-(3.4.0)-lapack-suitesparse-(7.1.0)-metis-(5.1.0)-acceleratesparse-eigensparse) + Solver Summary (v 2.3.0-eigen-(3.4.0)-lapack-suitesparse-(7.6.1)-metis-(5.1.0)-acceleratesparse-eigensparse) Original Reduced Parameter blocks 4 4
diff --git a/docs/source/solving_faqs.rst b/docs/source/solving_faqs.rst index f01a704..2bc321e 100644 --- a/docs/source/solving_faqs.rst +++ b/docs/source/solving_faqs.rst
@@ -79,7 +79,7 @@ 4 1.803857e+04 5.58e+02 2.69e+04 8.66e+01 9.93e-01 3.69e+05 1 1.61e-01 1.03e+00 5 1.803391e+04 4.66e+00 3.11e+02 1.02e+01 1.00e+00 1.11e+06 1 1.49e-01 1.18e+00 - Solver Summary (v 2.3.0-eigen-(3.4.0)-lapack-suitesparse-(7.1.0)-metis-(5.1.0)-acceleratesparse-eigensparse) + Solver Summary (v 2.3.0-eigen-(3.4.0)-lapack-suitesparse-(7.6.1)-metis-(5.1.0)-acceleratesparse-eigensparse) ---------------------------------- Original Reduced Parameter blocks 22122 22122
diff --git a/docs/source/version_history.rst b/docs/source/version_history.rst index 71207bb..4166943 100644 --- a/docs/source/version_history.rst +++ b/docs/source/version_history.rst
@@ -21,8 +21,7 @@ NVIDIA ``cuDSS``, enabling GPU-accelerated ``SPARSE_NORMAL_CHOLESKY`` and ``SPARSE_SCHUR`` solves. (Mark Shachkov, Ben Hamilton & Sameer Agarwal) #. Mixed precision solves + iterative refinement when using ``SUITE_SPARSE`` - as the sparse linear algebra library (requires SuiteSparse 7.4.0 or later - for single-precision ``CHOLMOD``). (Sameer Agarwal) + as the sparse linear algebra library. (Sameer Agarwal) #. Added ``AccurateNorm`` and ``AccurateRNorm`` for overflow and underflow safe variadic norms accurate to nearly full working precision. Their Jet derivatives are defined wherever the norm is nonzero, unlike those of nested @@ -62,7 +61,7 @@ --------------------------------- #. ``glog``, ``gflags``, and ``MINIGLOG`` have been removed and replaced by - `Abseil <https://abseil.io/>`_ (version ``20240116`` or later). + `Abseil <https://abseil.io/>`_ (version ``20260817.0`` or later). `GoogleTest <https://github.com/google/googletest>`_ (version ``1.14.0`` or later) is now required when ``BUILD_TESTING=ON``. (Sameer Agarwal, Reinhold Gschweicher & Sergiu Deitsch) @@ -73,8 +72,10 @@ (formerly ``StringToLoggingtype`` and ``StringToDumpFormatype``) for consistency with the rest of the API, and fix a duplicate declaration in ``ceres/types.h``. (Sameer Agarwal) -#. Ceres Solver now requires CMake 3.22 or later and Eigen 3.3.4 or later. - (Sergiu Deitsch) +#. Ceres Solver now requires CMake 3.28 or later, Eigen 3.4.0 or later + (including Eigen 5), SuiteSparse 7.6.1 or later (when enabled), and Google + Benchmark 1.8.3 or later (when enabled). Legacy TBB probing for + SuiteSparseQR has been removed. (Sergiu Deitsch & Sameer Agarwal) #. The ``WITH_SUITESPARSE`` CMake option (formerly ``SUITESPARSE``) now defaults to ``OFF``. Passing ``-DWITH_SUITESPARSE=ON`` restores the previous behavior, but makes the resulting Ceres build GPL licensed unless