Take abseil as a dependency

1. Add abseil-cpp as a submodule. We are tracking the latest LTS
release, which is lts_2024_01_16.
2. Replace glog/gflags with absl::log and absl::flags.
3. Remove miniglog
4. Also take a whack at making the bazel build work with
   abseil-cpp and gtest.

There are a number of TODOs in this CL that still need to be resolved.

Change-Id: I39355ed7d61375be4ebcbc8596d9cc70acc1c678
This commit is contained in:
Sameer Agarwal
2024-07-07 10:24:18 -07:00
parent 21b026aa2c
commit 0a53aa9054
218 changed files with 1140 additions and 2160 deletions
+13 -13
View File
@@ -140,14 +140,15 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
# TODO(rodrigoq): add support to configure Ceres into various permutations,
# like SuiteSparse or not, threading or not, glog or not, and so on.
# See https://github.com/ceres-solver/ceres-solver/issues/335.
def ceres_library(name,
restrict_schur_specializations=False):
def ceres_library(
name,
restrict_schur_specializations = False):
# The path to internal/ depends on whether Ceres is the main workspace or
# an external repository.
if native.repository_name() != '@':
internal = 'external/%s/internal' % native.repository_name().lstrip('@')
if native.repository_name() != "@":
internal = "external/%s/internal" % native.repository_name().lstrip("@")
else:
internal = 'internal'
internal = "internal"
# The fixed-size Schur eliminator template instantiations incur a large
# binary size penalty, and are slow to compile, so support disabling them.
@@ -185,11 +186,7 @@ def ceres_library(name,
"config/ceres/internal/config.h",
"config/ceres/internal/export.h",
]),
copts = [
"-I" + internal,
"-Wunused-parameter",
"-Wno-sign-compare",
] + schur_eliminator_copts,
copts = schur_eliminator_copts,
# These include directories and defines are propagated to other targets
# depending on Ceres.
@@ -198,23 +195,26 @@ def ceres_library(name,
# part of a Skylark Ceres target macro.
# https://github.com/ceres-solver/ceres-solver/issues/396
defines = [
"CERES_EXPORT=",
"CERES_NO_ACCELERATE_SPARSE",
"CERES_NO_CHOLMOD_PARTITION",
"CERES_NO_CUDA",
"CERES_NO_CUDSS",
"CERES_NO_EIGEN_METIS",
"CERES_NO_EXPORT=",
"CERES_NO_LAPACK",
"CERES_NO_SUITESPARSE",
"CERES_USE_EIGEN_SPARSE",
"CERES_EXPORT=",
],
includes = [
"config",
"include",
"internal",
],
visibility = ["//visibility:public"],
deps = [
"@com_gitlab_libeigen_eigen//:eigen",
"@com_github_google_glog//:glog",
"@eigen//:eigen",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
],
)