Commit Graph

1835 Commits

Author SHA1 Message Date
Sergiu Deitsch d23dbac25b Update Windows install guide
Change-Id: I445354bee0f54b33921ea9411b7bb320af275d43
2022-03-25 19:19:45 +01:00
Sergiu Deitsch e669c9fc7a Provide citation file
This makes citations accessible directly on Github and allows users to
automatically generate citations in APA and BibTeX format.

Change-Id: Ic5eb3857c92d93a6afafba06a5009da5db2b3c60
2022-03-25 00:01:01 +01:00
Sameer Agarwal ff57c2e91e Update version history for 2.1.0rc2
Change-Id: If107c2cc356ff402d743d8393c2a1f49a0720c28
2.1.0rc2
2022-03-21 09:34:42 -07:00
Sergiu Deitsch ab9436cb9e Workaround MSVC STL deficiency in C++17 mode
Compiling jet_test using the /std:c++17 switch triggers a C3198 compile
error in <numeric>. Moving #pragma below all the includes, allows to
workaround the issue.

Additionally, locally ensure the floating-point model is always
/fp:precise to be able to access the floating-point environment in
jet_test.

Change-Id: Ia5b3a3dac13baf46546ac1d0d304fc05512f8816
2022-03-20 14:35:02 +00:00
Sameer Agarwal 97c232857d Update the included gtest to version 1.11.0
Change-Id: Icd79eaebce95d2836587aaa5273674bcf2899bc5
2022-03-20 14:34:12 +00:00
Sergiu Deitsch 4eac7ddd27 Fix Jet lerp test regression
Partially revert changes from 1d5aff059c
to those in 8426526dff.

Fixes #775

Change-Id: I6b2f481521f15bf09c039283e79f9ee13664f987
2022-03-20 01:57:57 +01:00
Sergiu Deitsch 2ffbe126df Fix Jet test failures on ARMv8 with recent Xcode
Fixes #774

Change-Id: I741924bc82f62f122c47df2b38e02a50e0fdb0da
2022-03-19 22:47:41 +01:00
Dmitriy Korchemkin 0d6a0292c9 Fix unused arguments of Make1stOrderPerturbation
Change-Id: Ibc7ef45e88abdde67dbb2705a3423ad4c4594859
2022-03-18 21:02:05 +03:00
Sergiu Deitsch 93511bfdc9 Fix SuiteSparse path and version reporting
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
2022-03-14 20:27:24 +01:00
Sergiu Deitsch bf329b30f6 Fix link to macOS badge
Change-Id: I95748c2abbd677160c69b424f8fbc3b15e17a641
2022-03-14 18:56:05 +01:00
Sergiu Deitsch 0133dada2d Add Github workflows
Change-Id: I74fc45784b1b1d20c22b9e983902aa69fbfa764f
2022-03-13 23:51:40 +01:00
Sergiu Deitsch 3d3d6ed71b Add missing includes
pair_hash.h uses std::size_t and std::hash but does not include the
corresponding headers <cstddef> and <functional>.

Change-Id: I194a5c76e8f50b1574e1359f616351581033c576
2022-03-13 22:21:18 +01:00
Joydeep Biswas 0a9c0df8aa Fix path for cuda-memcheck tests
* Use generator expression instead of CMAKE_RUNTIME_OUTPUT_DIRECTORY
  to get the path of compiled CUDA test targets when running
  cuda-memcheck tests.
* Only add cuda-memcheck targets if testing is enabled.

Change-Id: Idea498dd9008b7e5075d4af9775f9f43716e22f1
2022-03-13 10:47:45 -05:00
Sameer Agarwal ee35ef66f6 ClangFormat cleanup via scripts/all_format.sh
Change-Id: Ideafec543a9d090a767bae58123b7512c9e9ae4a
2022-03-12 16:25:45 -08:00
Sameer Agarwal 4705159858 Add missing includes for config.h
covariance.h was using SUITE_SPARSE even when SUITESPARSE
was disabled because it did not have config.h included in it
so it did not see that CERES_NO_SUITESPARSE was defined.

Add more config.h includes to files that are using these
configuration macros.

Change-Id: I6b1d2c2bd9e559de40a6332cd6be85ad4da3377b
2022-03-12 15:55:19 -08:00
Brent Yi d3612c12c0 Set CMP0057 policy for IN_LIST operator in FindSuiteSparse.cmake
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
2022-03-09 02:35:00 -08:00
Sergiu Deitsch 4bc100c13d Do not define unusable import targets
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
2022-03-09 09:52:44 +00:00
Sergiu Deitsch e91995cce4 Fix Ubuntu 18.04 shared library build
Overriding export gflags export macros breaks glog in shared Ceres
solver builds. Threfore, always compile gtest as a static library to
avoid the need of overriding the export macros.

Change-Id: Ibc9a04a771085caa8f02c81745ce626643df8450
2022-03-08 19:37:57 +00:00
Sergiu Deitsch 94af09186f Force C++ linker
Forcing linker language to C causes linker errors when compiling using NDK.

Change-Id: Iea587d1ab00d10b2c331ccc3e178e16c6a78ce5f
2022-03-06 15:54:54 +01:00
Sameer Agarwal a65e738851 Update installation docs
Change-Id: I14cc0d6f0ad4bfeee3d60a42d9b57bc5deaad01b
2.1.0rc1
2022-03-04 11:10:38 -08:00
Sergiu Deitsch 1a377d7078 Fix Ubuntu 20.04 SPQR build
Fixes #764

Change-Id: I045eb6653749d8a09f4aeb617163288cbf92ad56
2022-03-04 16:27:41 +01:00
Sergiu Deitsch 817f5a0688 Switch to imported SuiteSparse, CXSparse, and METIS targets
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
2022-03-03 21:26:45 +01:00
Sergiu Deitsch b0f32a20d7 Hide remaining internal symbols
Change-Id: Ibd2f8c5e7a730503479cb4f17db2de8727f94d2c
2022-03-03 18:45:01 +01:00
Sameer Agarwal 5723950987 Add a missing include
Change-Id: Ide00da72d493c6ce38f4ba6542f7c673d7091bfd
2022-03-03 09:37:52 -08:00
Sergiu Deitsch b0aef211db Allow to store pointers in ProductManifold
Change-Id: I32df7afab3a195efb0407b0d8f35dcd2d7cb95d2
2022-03-03 17:08:24 +00:00
Joydeep Biswas 9afe8cc45e Small compile fix to context_impl
* Add missing header include for <string>, affects CUDA builds.
* Fix typo

Change-Id: I82ca6eb180b85a7b85966c36d6ec59ce78726a96
2022-03-03 10:32:18 -06:00
Sergiu Deitsch 284be88ca1 Allow ProductManifold default construction
In many cases, manifolds stored in ProductManifold have a default
constructor which can simplify ProductManifold initialization even
further. Allow default construction of ProductManifold in this case.

Change-Id: I29b2612870c02232556688019a77049709684a55
2022-03-03 14:50:03 +01:00
Joydeep Biswas f59059fffb Bugfix to CUDA workspace handling
* Fix workspace type in CUDADenseQR and CUDADenseCholesky --
  Workspace sizes are in terms of number of elements, not bytes.
* Add cuda-memcheck tests to catch such CUDA memory errors in
  the future.

Change-Id: I3dd0f0947daba9e4c6cd0216bef81d694547d505
2022-03-03 12:50:56 +00:00
Sergiu Deitsch 779634164d Fix MSVC linker error
Apparently, MSVC does not like whenever a fully templated class is
exported.

Change-Id: Ie920720d645941925b4ee04d9ae2b92e6c061f2b
2022-03-03 13:39:38 +01:00
Sergiu Deitsch 7743d2e73c Store ProductManifold instances in a tuple
Since the number of manifolds used to initialize ProductManifold and
their types are known at compile-time, it is possible to avoid storing
pointers to the base class as required by a homogeneous, currently
dynamically sized container. Instead, we can use std::tuple<> as a
heterogenous container with the number of elements fixed at compile-time
that allows us to store the concrete manifold realizations.

The advantage of this approach is that we can bypass the vtable when
iterating over each manifold within ProductManifold. The indirection is
invoked only once while accessing the ProductManifoldImpl members.
Additionally, potential dynamic memory allocations by a std::vector can
be completely avoided. This makes the ProductManifold implementation
more efficient both in memory and runtime.

Change-Id: Ic71b0c175ab726f8992e9703f7666bca477baf19
2022-03-02 23:57:10 +00:00
Alex Stewart 9f32c42ba6 Update Travis-CI status badge to .com from .org
Change-Id: I77091d541d81463b33731fc9b1a2971ce2e8a1f8
2022-03-02 19:25:46 +00:00
Sameer Agarwal eadfead69d Move LineManifold and SphereManifold into their own headers.
Previously they were defined in manifold.h but their implementations
were in the internal directory and to prevent circular dependencies
the implementation headers were pushed to the bottom of manifold.h

This started out as one header and has become progressively worse
as more manifolds are templated.

This change moves the two manifolds into their own headers which
also contain their implementations.

Change-Id: I671da0279a47cd2ff1f52c69a1d159426f55bd80
2022-03-02 06:51:37 -08:00
Sergiu Deitsch f0f8f93bbc Fix docs inconsistencies
Change-Id: Ie3f767d537206ed4c326c7a504825cc751817c61
2022-03-02 14:05:39 +01:00
Sameer Agarwal e40391efa3 Update version history in preparation for 2.1.0
Change-Id: I3771d5d289bbb9982eeec2ae3701246dd25eaac1
2022-03-01 09:35:20 -08:00
Sameer Agarwal 6a37fbf9b4 Add static/compile time sizing to EuclideanManifold
This brings it in line with other manifolds like SphereManifold
and LineManifold, where the user has the choice to specify the size
of the manifold at compile time or runtime.

Most of the time the size is known at compile time so this will
speed up the common case.

Change-Id: I0c7ff8b7a9a64a81203eb11afc074874e208815a
2022-03-01 09:34:23 -08:00
Sameer Agarwal 4ad787ce19 Fix the bazel build
Change-Id: I38c684b816b5e377aa873cf35d13b1181aa152db
2022-02-27 07:50:56 -08:00
Sameer Agarwal ae4d95df6e Two small clang-tidy fixes
Change-Id: I1eb3b5aabc9586958d618c680ca1a2c6ed501fd4
2022-02-27 05:41:07 -08:00
Sergiu Deitsch f0851667be Fix MSVC compilation errors
Disable the definition of `min`/`max` macros by defining `NOMINMAX`
and prevent macro substitution in the public interface.

Also, quiet floating-point comparisons are defined as template functions
by the MSVC STL which causes compilation errors due to ambiguities in
resolving the template parameter types.

Fixes #668
Fixes #716
Fixes #718

Change-Id: I5fe7832a6a3a7ad0421a2557527528c34b88e9c7
2022-02-27 13:24:42 +01:00
Sergiu Deitsch c8658c8992 Modernize more
Apply clang-tidy Google and modernize fixes without trailing return type
using:

$ clang-tidy -p <build-dir> \
  -checks='-*,google-*,modernize-*,-modernize-use-trailing-return-type' {} -fix

Change-Id: I7450cc58ea9abf928f73a467e87876083217fa26
2022-02-26 22:16:56 +00:00
Sergiu Deitsch 46b3495a4f Standardize path handling using GNUInstallDirs
Fixes #649

Change-Id: Iefb3e7be69a04474db0fc768b47f4f3636c8a587
2022-02-25 23:59:34 +00:00
Alex Stewart 98bc3ca17a Fix shared library build due to missing compile features specification
Change-Id: Ib4c7f0b18b8770ab8cb09b15b9cc17f90042ceb0
2022-02-25 19:07:21 +00:00
Sameer Agarwal 8fe8ebc3a6 Add final specifier to public classes
Change-Id: Ib7291dc68d5d4141ee821689743481fc84768606
2022-02-18 15:51:17 -08:00
Sameer Agarwal 84e1696f4e Add final specifier to internal classes.
This should help the compiler devirtualize a bunch of function
calls.

https://github.com/ceres-solver/ceres-solver/issues/747

Change-Id: I9913e68d85e0e9c9f955a249cc710a657875c869
2022-02-18 18:07:06 +00:00
Sameer Agarwal 518970f81e Context should be exported
Change-Id: I451a7f471a6b93d1d32dc003adaa3c5c315fef9f
2022-02-18 09:54:40 -08:00
Sergiu Deitsch 09ec4997fa Cleanup examples
Remove logic invoked based on obsolete variable definitions. Use new
(explicit) target_link_libraries syntax to link binaries against
dependencies. Do not rely on prior knowledge about the compiler for
specifying flags and system libraries but instead directly test their
presence to be more robust.

Change-Id: I76e0d10fae6eba4b343048e4404f0a9b08c7cb6c
2022-02-18 00:53:44 +01:00
William Rucklidge 90e58e10fd Add missing #include.
Change-Id: If32d858c9d9eec9f53753007e0831e56f25d32d4
2022-02-17 11:40:45 -05:00
Sameer Agarwal 15348abe90 Add CUDA based bundle adjustment tests.
Also refactor the logic for generating ba tests a bit
breaking it into dense, sparse and iterative tests.

Change-Id: I6b33e3b047ef900b12907bd150febe4744779b7a
2022-02-15 12:36:18 -08:00
Sergiu Deitsch 57ec9dc92e Do not enforce a specific C++ standard
Current language standard selection mechanism is quite convoluted and
the logic for propagating a specific C++ language standard (which cannot
be fully enforced anyway) is unnecessarily complicated. Instead
communicate the minimum required C++ standard and let CMake handle the
requirement. This allows the compiler and consumers to use newer
language revisions if available. The language standard used to compile
Ceres solver can still be set via `CMAKE_CXX_STANDARD`.

Move to CMake 3.10 which is supported by Ubuntu 18.04 LTS and simplify
the corresponding language features request.

Change-Id: Ib1f95e2bc5f06bf1275a62565d303eb0f114d127
2022-02-15 21:14:29 +01:00
Sergiu Deitsch 99698f0535 Fix Apple Clang weak symbols warnings
Change-Id: I71eba56ca37060c83d05ff14d6f9bfaef61e9493
2022-02-15 21:00:22 +01:00
Joydeep Biswas 8e08421628 Add support for dense CUDA solvers #3
1. Add CUDA initialization and cleanup management to the
   ContextImpl object. The ContextImpl is now solely responsible
   for managing CUDA-related resources.
2. All CUDA dense solvers now use lazy CUDA initialization
   via the ContextImpl object.

Change-Id: Ief456860c72e462367ee997d389c19e2bff50baf
2022-02-15 13:26:12 -06:00