blob: 4162b462631136846752217d50561c3305d20021 [file] [log] [blame]
Sameer Agarwald76da162014-09-07 18:42:49 -07001// Ceres Solver - A fast non-linear least squares minimizer
Sameer Agarwal5a30cae2023-09-19 15:29:34 -07002// Copyright 2023 Google Inc. All rights reserved.
Keir Mierle7492b0d2015-03-17 22:30:16 -07003// http://ceres-solver.org/
Sameer Agarwald76da162014-09-07 18:42:49 -07004//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are met:
7//
8// * Redistributions of source code must retain the above copyright notice,
9// this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above copyright notice,
11// this list of conditions and the following disclaimer in the documentation
12// and/or other materials provided with the distribution.
13// * Neither the name of Google Inc. nor the names of its contributors may be
14// used to endorse or promote products derived from this software without
15// specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27// POSSIBILITY OF SUCH DAMAGE.
28//
29// Author: sameeragarwal@google.com (Sameer Agarwal)
30
Nikolaus Demmel7b8f6752020-09-20 21:45:24 +020031#include "ceres/solver_utils.h"
32
Sameer Agarwal10cbe852015-04-05 23:35:04 -070033#include "Eigen/Core"
Nikolaus Demmel7b8f6752020-09-20 21:45:24 +020034#include "ceres/internal/config.h"
Sergiu Deitschf90833f2022-02-07 23:43:19 +010035#include "ceres/internal/export.h"
Sameer Agarwald76da162014-09-07 18:42:49 -070036#include "ceres/version.h"
Joydeep Biswas36d6d862022-02-03 08:09:10 -060037#ifndef CERES_NO_CUDA
38#include "cuda_runtime.h"
Mark Shachkov6fb3dae2024-05-01 11:00:58 +020039#ifndef CERES_NO_CUDSS
40#include "cudss.h"
41#endif // CERES_NO_CUDSS
Joydeep Biswas36d6d862022-02-03 08:09:10 -060042#endif // CERES_NO_CUDA
Sameer Agarwald76da162014-09-07 18:42:49 -070043
Sameer Agarwalcaf614a2022-04-21 17:41:10 -070044namespace ceres::internal {
Sameer Agarwald76da162014-09-07 18:42:49 -070045
Sergiu Deitsch786866d2022-05-28 01:07:49 +020046constexpr char kVersion[] =
47 // clang-format off
Mark Shachkov522210a2024-05-07 01:47:41 +020048 CERES_VERSION_STRING "-eigen-("
49 CERES_SEMVER_VERSION(EIGEN_WORLD_VERSION,
50 EIGEN_MAJOR_VERSION,
51 EIGEN_MINOR_VERSION) ")"
Alex Stewart857c18a2015-04-05 14:25:25 +010052
Sameer Agarwald76da162014-09-07 18:42:49 -070053#ifdef CERES_NO_LAPACK
Sergiu Deitsch786866d2022-05-28 01:07:49 +020054 "-no_lapack"
Sameer Agarwald76da162014-09-07 18:42:49 -070055#else
Sergiu Deitsch786866d2022-05-28 01:07:49 +020056 "-lapack"
Sameer Agarwald76da162014-09-07 18:42:49 -070057#endif
58
59#ifndef CERES_NO_SUITESPARSE
Sergiu Deitsch786866d2022-05-28 01:07:49 +020060 "-suitesparse-(" CERES_SUITESPARSE_VERSION ")"
Sameer Agarwald76da162014-09-07 18:42:49 -070061#endif
62
Alex Stewart5de77f32022-06-22 19:20:40 +010063#if !defined(CERES_NO_EIGEN_METIS) || !defined(CERES_NO_CHOLMOD_PARTITION)
Sergiu Deitsch0c883012022-05-15 22:26:18 +020064 "-metis-(" CERES_METIS_VERSION ")"
65#endif
Sergiu Deitsch786866d2022-05-28 01:07:49 +020066
Alex Stewart8f41ca62018-06-23 20:17:34 +010067#ifndef CERES_NO_ACCELERATE_SPARSE
Sergiu Deitsch786866d2022-05-28 01:07:49 +020068 "-acceleratesparse"
Alex Stewart8f41ca62018-06-23 20:17:34 +010069#endif
70
Sameer Agarwald76da162014-09-07 18:42:49 -070071#ifdef CERES_USE_EIGEN_SPARSE
Sergiu Deitsch786866d2022-05-28 01:07:49 +020072 "-eigensparse"
Sameer Agarwald76da162014-09-07 18:42:49 -070073#endif
74
75#ifdef CERES_RESTRUCT_SCHUR_SPECIALIZATIONS
Sergiu Deitsch786866d2022-05-28 01:07:49 +020076 "-no_schur_specializations"
Sameer Agarwald76da162014-09-07 18:42:49 -070077#endif
78
Sameer Agarwald76da162014-09-07 18:42:49 -070079#ifdef CERES_NO_CUSTOM_BLAS
Sergiu Deitsch786866d2022-05-28 01:07:49 +020080 "-no_custom_blas"
Sameer Agarwald76da162014-09-07 18:42:49 -070081#endif
82
Joydeep Biswas36d6d862022-02-03 08:09:10 -060083#ifndef CERES_NO_CUDA
Sergiu Deitsch786866d2022-05-28 01:07:49 +020084 "-cuda-(" CERES_TO_STRING(CUDART_VERSION) ")"
Mark Shachkov6fb3dae2024-05-01 11:00:58 +020085#ifndef CERES_NO_CUDSS
86 "-cudss-(" CERES_SEMVER_VERSION(CUDSS_VERSION_MAJOR,
87 CUDSS_VERSION_MINOR,
88 CUDSS_VERSION_PATCH) ")"
89#endif // CERES_NO_CUDSS
Joydeep Biswas36d6d862022-02-03 08:09:10 -060090#endif
Sergiu Deitsch786866d2022-05-28 01:07:49 +020091 ;
92// clang-format on
Joydeep Biswas36d6d862022-02-03 08:09:10 -060093
Sameer Agarwal4aa57d82024-08-09 17:02:53 -070094std::string VersionString() { return kVersion; }
Sameer Agarwald76da162014-09-07 18:42:49 -070095
Sameer Agarwalcaf614a2022-04-21 17:41:10 -070096} // namespace ceres::internal