Previously, MSVC warning C4996 was suppressed unconditionally in the
entire code base which made it difficult identifying and fixing specific
problems, particularly those in the public interface.
Prefer now to disable warnings at the specific location they occur. This
approach, however, reveals an inconsistency in how Ceres handles POSIX
functions which are declared deprecated by MSVC. Specifically, Bessel
functions use the underscore form whereas the read function does not. To
simplify the logic, we revert to POSIX compatible functions.
C++23 also deprecates std::numeric_limits<T>::has_denorm which MSVC
warns about. Here, we disable the deprecation warning locally to avoid
the warning leaking into the user code.
Fixes#1013
Change-Id: Ida8457cc8dd8770b4384a7c49d16f213b02cdec4
1. Add a version history
2. Update copyright years across the code base
3. Run format_all.sh
4. Update version strings from 2.1.0 to 2.2.0 in the docs and
elsewhere.
Change-Id: I46d8d479d54bd6002d532785e67342106e73c9ac
* Make sphinx_rtd_theme a find module component to avoid hard-wiring it
into the module and allowing to report the theme in case it is missing
using the standard CMake package mechanism.
* Adjust find module cache variables names case to match the find module
name.
* Also report sphinx-build version for completeness.
* Invoke the find module only once. Calling find_package on the same
module is not needed.
Change-Id: I9d1bf0fcc0d44b9b37e624128812f348c5442ada
Given we no longer support Ubuntu 18.04 due to packaged GCC lacking
C++17 support we can bump the minimum required CMake version to the one
provided by Ubuntu 20.04 which is CMake 3.16. Consequently, this allows
to drop some of the legacy CMake logic.
Change-Id: I1f05d4c5681d10aa7faa0800ef4a803be2f5b7dd
Since c++11, we can depend on C++ threads always being available.
With the recent work on the performance of CXX threading, the
additional complexity of maintaining multiple backends for some
minor performance delta is not worth it
https://github.com/ceres-solver/ceres-solver/issues/886
Change-Id: Idee480b22a498daec9c4366da8589aa58eaf36a1
The version component macro names are delimited by multiple spaces in
the new release resulting in a failure to parse the version.
An additional guard ensures that if the version cannot be correctly
parsed it is discarded and a user warning is issued.
Fixes#919
Change-Id: I630f30dba0fd23979b6fe5d854e59701c22c3469
- Enables relocatable installs if the CUDA libraries are not installed
in a location on the LD_LIBRARY_PATH.
- Also bump the minimum CMake version to 3.11 to reflect the issue
reported in #903.
Change-Id: I333882b7238c76104d739c7054f29cc35cc4e919
* Split `CERES_NO_METIS` into two defines: `CERES_NO_PARTITION` and
`CERES_NO_METIS`. The former refers to METIS support in SuiteSparse,
the latter to the Eigen's MetisSupport module. This enables the use of
sparse matrix reordering independent from SuiteSparse.
* Run Linux, macOS, and macOS Github workflows with METIS enabled
SuiteSparse.
Fixes#808
Change-Id: I5076b7e1268d32cc3e7e56650edcbaf7fb3b59ce
1. The platform specific threads library is only needed if we actually
use threads. In this case, the library is not optional opposed to
previous logic.
2. Do not hide the find module output to allow the user to understand
what happens in case of a CMake failure to locate Threads.
3. Finally, Threads is private dependency that does need to be
propagated to consumers unless Ceres was compiled as a static
library.
Change-Id: I8d9d9cd42930e1ed234f69a2dba70d0ee2755b4e
Depending on the compiler in use, linking against OpenMP may require
passing specific compiler flags instead of linking against a library.
Use the CMake OpenMP find module to abstract OpenMP activation.
Change-Id: Ib43f576ac12e2c5e9598e9586df3dfa018e9c08b
Eigen provides all the functionality that we need from CXSparse
with a more liberal license.
I will update the documentation in a follow up CL.
Change-Id: I0b9fd8be3c27754cc2986cc0e06595c8b3fdec0b
If SuiteSparse is found, an unhelpful message "Found SuiteSparse: TRUE
..." is printed. Instead, report the found include directory and version
information which was previously not shown due to unset
SuiteSparse_FOUND variable.
Change-Id: Ib43fb99934f34e6007110007d2cd4a8fbd841aa2
A recent change introduced some uses of `IN_LIST` in
FindSuiteSparse.cmake, but this is only introduced in cmake 3.3 and
breaks downstream projects that set cmake_minimum_required() to anything
lower.
This commit locally sets CMP0057, which enables the `IN_LIST` operator
and fixes the build for these projects.
Primarily motivated by colmap, which sets cmake_minimum_required(3.0)
and is currently broken: https://github.com/colmap/colmap/issues/1451
Change-Id: I9580c86f56248611326a932b8650b9048fb0ff14
In the case, necessary properties of import targets cannot be set (i.e.,
either because the include directory or the library was found), do not
define import target to begin with.
Change-Id: Id216cd692a8ec240a20f65b174f196ddaa306c2b
These changes allow the use of a SuiteSparse CMake package from
https://github.com/sergiud/SuiteSparse that allows native compilation of
SuiteSparse using CMake on a variety of platforms Packages generated
using official SuiteSparse makefiles can still be used without
modifications. The find module remains agnostic to specific CMake
package implementation.
CMake packages have the advantage that they are self-contained and
relocatable. The latter is particularly useful in cross-compilation
scenarios.
Fixes#728
Change-Id: I089d5c6f87c05b1530a5ab9a36dff2fcbe82d13d
Currently, the logic for exporting symbols is rather complicated: when
tests are enabled internal symbols are exported in addition to the
public symbols. Such logic causes several problems. (1) Test binaries
link against a Ceres build that is different from the final release
since fewer optimizations are applied if more symbols are exported. (2)
Also, some toolchains hide symbols by default breaking the existing
logic eventually causing linker errors.
Since internal symbols are not intended to be used outside of the
project, we can compile them into object files and use exactly the same
binary code both for the final build and the tests without relying on
conditionals.
By default, all symbols are now hidden unless annotated as public.
Internal symbols are explicitly marked as not being exported in case
users chose not to hide symbols by default.
Change-Id: I589dd10be2f6f438508783cf99d141af0120057b
1. Add CUDADenseCholesky64Bit, CUDADenseCholesky32Bit, & tests.
CUDADenseCholesky32Bit uses the legacy versions of potrf/potrs
in cuSolverDN, while CUDADenseCholesky64Bit uses the new 64-bit
versions available since Cuda 11.1. The legacy versions are
provided since some platforms such as the Nvidia Jetsons only
support Cuda 10.2.
2. Expose CUDA as a new option under DenseLinearAlgebraLibraryType.
The relevant option to string and string to option helper functions
are modified accordingly.
3. Add cuda as a dense_linear_algebra_library option in bundle_adjuster
to demonstrate the use of the new CUDA option.
Change-Id: I23615e1d301df5185ed646b3e33ee802508dae86
Build with documentation fails if the required 'sphinx rtd theme' is
not available. Check if dependency is installed before building with
documentation.
Add Python3 as requirement for building documentation.
Change-Id: I5edc5d7374864990e625a5efb358f5a23b3c50fe
- Protect against the case when the user has multiple installs of TBB
in their search paths and the first install does not contain debug
libraries. In this case it is possible to get mismatched versions
of TBB inserted into TBB_LIBRARIES.
- Also suppresses warning about use of TBB_ROOT on modern versions of
CMake due to CMP0074.
Change-Id: I2eaafdde4a028cbf6c500c63771973d85bc4723d
- Ceres will fail to configure if Eigen3::Eigen target is not found, and
the minimum required Eigen version specified (3.3) exports Eigen as
a CMake package and this is reflected in the default Ubuntu 18.04
packages.
- This permits users to specify their own Eigen3 detection should they
choose to do so, but they must do so via an imported target.
Change-Id: I5edff117c8001770004f49012ac1ae63b66ec9c1
- As our minimum required version of gflags (2.2) exports itself as
a CMake package and this is the case for the default 18.04 package
we can use the gflags target directly.
- Replaces forced use of CONFIG in find_package(gflags) with a check
that the gflags imported target exists to avoid ambiguity with
libgflags if installed in a default location. This permits users to
override the gflags detection should they so choose, provided that
they do so via an imported target.
- Also removes some previously removed legacy GLAGS_ vars from the
installation docs.
Change-Id: I015f5a751e5b22f956bbf9df692e63a6825c9f0d
- Removes all workarounds for pre-C++14 versions
- Removes '11' qualifier from C++ threading option and associated
defines.
- Fix missing inclusion of 'Multithreading' in reported Ceres components
when C++ threading model is enabled.
- Update Sphinx documentation to specify C++14 as minimum requirement.
Change-Id: I706c8b367b3221e3c4d1a0aaf669a8f9c911e438
- If the version of glog detected and used to build Ceres was built with
CMake (i.e. Config mode) then we now use Config mode directly in
CeresConfig.cmake and do not install Ceres' FindGlog.cmake module.
- This has the benefit of removing any hard-coded paths from
CeresConfig.cmake provided that all dependencies were also built with
CMake.
Change-Id: I85af8a953fd6d300e8bc0cdeb0b3636fec182f68
- This reflects modern CMake style, and also provides a measure of
protection against missing find_package() imports in downstream
clients resulting in linker errors when 'ceres' matches the compiled
library and not the imported target.
- The original 'ceres' target remains, as a local imported interface
target created by CeresConfig for backwards compatibility.
Change-Id: Ie9ed8de9b7059bc0cae1ae5002bb94d8fe617188
Ensure that Ceres does not print any log messages when somebody has
used 'find_package(Ceres QUIET)' in their CMake project.
Change-Id: Id6b68859cc8a5857f3fa78f29736cb82fd5a0943
This patch integrates the code generation module into the build
system. All depenendcies are tracked through CMake targets.
Modifying the cost functor will automatically trigger code
re-generation.
All this functionality is defined in the CMake function
ceres_generate_cost_function_implementation_for_functor
in CeresCodeGeneration.cmake. A hello world usage example
is included in examples/CMakeLists.txt.
Change-Id: I23b8b6698d1ea51cf3d788a47afcf39f8c5ce327
Use the CMake provided module CMakePackageConfigHelpers and its function
write_basic_package_version_file() to write the CeresConfigVersion.cmake
file to be installed.
Use SameMajorVersion compatibility flag.
Change-Id: I353aa8ede1ffee34e58b41371958ed5dedca4104
- Fix Homebrew Ruby errors by forcing brew update before install.
- Remove use of custom Eigen 3.3.4 on Linux in favour of default Bionic
3.3.4 package.
- Update Android NDK version to R20b and build for arm64-v8.
- Fix erroneous string -> STRING in iOS toolchain file.
Change-Id: I041c2a08b92b8307c12bd8967159beb6984e3c65
- As detailed in a previous CL, Xcode 11.0-1 exhibited a -fstack-check
bug on 10.15 Catalina that broke alignment for at least AVX
instructions causing segfaults from within Eigen.
- As Xcode 11.2 fixes this issue, and is probably a more reliable fix
than -fno-stack-check, we now require the user update in this case.
Change-Id: I482748fe5f40f82e7daf4da133cdfabbd95ffc89
- On macOS 10.15 and Xcode 11 -fstack-check is enabled by default. This
breaks SIMD alignment (and other alignment) as detailed here:
https://forums.developer.apple.com/thread/121887 resulting in random
segfaults from within Eigen.
- The underlying problem also exists with earlier OS versions running
Xcode 11 if -fstack-check is explicitly enabled.
- This CL explicitly disables -fstack-check on affected versions of
macOS 10.15 and Xcode 11.
Change-Id: I74d964281c360710d5fb722ac59e6930b0fdcc41
This commit includes the following:
- Changes to CMake to make it safer to see which compiler flags are supported,
so this way we do not need to worry about version checks in CMake.
- Unix platforms (which includes both Linux and Apple as far as i can tell)
will now enable -Wmissing-declarations warning for the whole Ceres.
- Changes in all sources to solve missing declaration warning. In most cases
it was either matter of using static qualifier or moving functions to an
anonymous namespace.
In one case the function got removed, since it seems to be unused.
Additionally, in slam examples there was a non-inlined function implementation
in a header, which is a direct way to cause linking errors if other .cc file
will include that helper header.
- All third party sources (which is currently only gmock) has this extra
paranoid warning disabled.
This warning is important in the following cases:
- Detect helper functions which are not needed anymore.
- Avoid unnoticed pollution of namespace.
- Avoid bad level calls.
- Avoid missing updates in header files after changes in implementation file.
- Helps integrating Ceres into software where paranoid warnings are important.
Change-Id: I9b1044aced3910d8c6b2356cfe2bf57f3c8c58db
- Adding the Homebrew install prefix to CMAKE_PREFIX_PATH, irrespective
of whether it is a standard location (e.g. /usr/local) overrides any
user-specified HINTS locations according to the search order of
CMake's find_xxx() functions.
- Now we append the relevant include/lib directory to its respective
HINTS directory variable (to the back to avoid overriding any user
specified values). This achieves the same effect, but only after
searching any user specified values.
- Also adds Homebrew install prefix to find_package() calls for
dependencies optionally exported with CMake after the possible user
specified <DEPENDENCY_NAME>_DIR prefix.
- Raised as issue #431
Change-Id: I47030f0f4fd9b96665fac57279be2285d9700b9a
In ceres' CMakeLists.txt a workaround for custom homebrew locations
sets CMAKE_PREFIX_PATH to the homebrew install path. This overrides
explicit requests for custom locations for third-party dependencies,
in particular for Eigen with EIGEN_INCLUDE_DIR_HINTS.
This commit introduces a workaround to make EIGEN_INCLUDE_DIR_HINTS
work on macos by ignoring CMAKE_PREFIX_PATH in that case.
Fixes https://github.com/ceres-solver/ceres-solver/issues/431
Change-Id: I3ec0ec418d45d41b9e5ebdd6aee60552438afec3