blob: 0bf829505c787fc087a64d423f26823d7aa5d546 [file] [log] [blame]
diff --git a/BUILD b/BUILD
index 652c4b17..9c7a799c 100644
--- a/BUILD
+++ b/BUILD
@@ -32,6 +32,7 @@
# not support parameterization around threading choice or sparse backends.
load("//:bazel/ceres.bzl", "ceres_library")
+load("@org_frc971//tools/build_rules:select.bzl", "compiler_select")
ceres_library(
name = "ceres",
@@ -48,6 +49,7 @@ cc_library(
]],
copts = [
"-Wno-sign-compare",
+ "-Wno-unused-but-set-variable",
"-DCERES_TEST_SRCDIR_SUFFIX=\\\"data/\\\"",
],
includes = [
@@ -158,12 +160,16 @@ TEST_COPTS = [
# but in the future disable these warnings only for rotation_test.
# TODO(keir): When the tests are macro-ified, apply these selectively.
"-Wno-address",
-]
+ "-Wno-unused-parameter",
+] + compiler_select({
+ "gcc": ["-Wno-use-after-free"],
+ "clang": [],
+})
TEST_DEPS = [
"//:ceres",
"//:test_util",
- "@com_gitlab_libeigen_eigen//:eigen",
+ "@org_tuxfamily_eigen//:eigen",
"@com_google_absl//absl/flags:flag",
]
diff --git a/bazel/ceres.bzl b/bazel/ceres.bzl
index ed4d66d9..be8948d7 100644
--- a/bazel/ceres.bzl
+++ b/bazel/ceres.bzl
@@ -190,6 +190,9 @@ def ceres_library(
"-I" + internal,
"-Wunused-parameter",
"-Wno-sign-compare",
+ "-Wno-format-nonliteral",
+ "-Wno-unused-parameter",
+ "-Wno-unused-but-set-variable",
] + schur_eliminator_copts,
# These include directories and defines are propagated to other targets
@@ -215,7 +218,7 @@ def ceres_library(
],
visibility = ["//visibility:public"],
deps = [
- "@com_gitlab_libeigen_eigen//:eigen",
+ "@org_tuxfamily_eigen//:eigen",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
diff --git a/examples/BUILD b/examples/BUILD
index e45fe318..6296417a 100644
--- a/examples/BUILD
+++ b/examples/BUILD
@@ -31,13 +31,14 @@
EXAMPLE_COPTS = [
# Needed to silence GFlags complaints.
"-Wno-sign-compare",
+ "-Wno-unused-parameter",
# Needed to put fscanf in a function.
"-Wno-format-nonliteral",
]
EXAMPLE_DEPS = [
"//:ceres",
- "@com_gitlab_libeigen_eigen//:eigen",
+ "@org_tuxfamily_eigen//:eigen",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log:log",
"@com_google_absl//absl/log:check",
diff --git a/internal/ceres/autodiff_test.cc b/internal/ceres/autodiff_test.cc
index b50327cb..19adcae0 100644
--- a/internal/ceres/autodiff_test.cc
+++ b/internal/ceres/autodiff_test.cc
@@ -647,6 +647,10 @@ TEST(AutoDiff, VariadicAutoDiff) {
}
}
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-but-set-variable"
+#endif
// This is fragile test that triggers the alignment bug on
// i686-apple-darwin10-llvm-g++-4.2 (GCC) 4.2.1. It is quite possible,
// that other combinations of operating system + compiler will
@@ -671,5 +675,8 @@ TEST(AutoDiff, AlignedAllocationTest) {
// Need this to makes sure that x does not get optimized out.
x[0] = x[0] + JetT(1.0);
}
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
} // namespace ceres::internal
diff --git a/internal/ceres/bundle_adjustment_test_util.h b/internal/ceres/bundle_adjustment_test_util.h
index fb2ac719..993863a2 100644
--- a/internal/ceres/bundle_adjustment_test_util.h
+++ b/internal/ceres/bundle_adjustment_test_util.h
@@ -98,7 +98,8 @@ class BundleAdjustmentProblem {
private:
void ReadData(const std::string& filename) {
- FILE* fptr = fopen(filename.c_str(), "r");
+ FILE* fptr = fopen(
+ (std::string("../com_google_ceres_solver/") + filename).c_str(), "r");
if (!fptr) {
LOG(FATAL) << "File Error: unable to open file " << filename;
diff --git a/internal/ceres/triplet_sparse_matrix_test.cc b/internal/ceres/triplet_sparse_matrix_test.cc
index e145c1a2..bde9a6ed 100644
--- a/internal/ceres/triplet_sparse_matrix_test.cc
+++ b/internal/ceres/triplet_sparse_matrix_test.cc
@@ -184,8 +184,15 @@ TEST(TripletSparseMatrix, AssignmentOperatorSelfAssignment) {
orig.mutable_values()[1] = 5.2;
orig.set_num_nonzeros(2);
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wself-assign-overloaded"
+#endif
// Who's on earth gonna do this?
orig = orig;
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
EXPECT_EQ(orig.num_rows(), 2);
EXPECT_EQ(orig.num_cols(), 5);