Fix the bazel build Change-Id: I38c684b816b5e377aa873cf35d13b1181aa152db
diff --git a/bazel/ceres.bzl b/bazel/ceres.bzl index c70341a..e60865e 100644 --- a/bazel/ceres.bzl +++ b/bazel/ceres.bzl
@@ -31,7 +31,6 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [ "accelerate_sparse.cc", "array_utils.cc", - "blas.cc", "block_evaluate_preparer.cc", "block_jacobian_writer.cc", "block_jacobi_preconditioner.cc", @@ -78,7 +77,6 @@ "inner_product_computer.cc", "iterative_refiner.cc", "iterative_schur_complement_solver.cc", - "lapack.cc", "levenberg_marquardt_strategy.cc", "line_search.cc", "line_search_direction.cc", @@ -174,11 +172,13 @@ "include/ceres/internal/*.h", ]) + - # This is an empty config, since the Bazel-based build does not - # generate a config.h from config.h.in. This is fine, since Bazel - # properly handles propagating -D defines to dependent targets. + # This is an empty config and export, since the + # Bazel-based build does not generate a + # config.h/export.h. This is fine, since Bazel properly + # handles propagating -D defines to dependent targets. native.glob([ "config/ceres/internal/config.h", + "config/ceres/internal/export.h", ]), copts = [ "-I" + internal, @@ -202,6 +202,9 @@ "CERES_NO_LAPACK", "CERES_USE_EIGEN_SPARSE", "CERES_USE_CXX_THREADS", + "CERES_NO_CUDA", + "CERES_EXPORT=", + "CERES_NO_EXPORT=", ], includes = [ "config",
diff --git a/config/ceres/internal/config.h b/config/ceres/internal/config.h index 1cf034d..969e43b 100644 --- a/config/ceres/internal/config.h +++ b/config/ceres/internal/config.h
@@ -1,5 +1,5 @@ // Ceres Solver - A fast non-linear least squares minimizer -// Copyright 2015 Google Inc. All rights reserved. +// Copyright 2022 Google Inc. All rights reserved. // http://ceres-solver.org/ // // Redistribution and use in source and binary forms, with or without @@ -30,16 +30,14 @@ // Default (empty) configuration options for Ceres. // -// IMPORTANT: Most users of Ceres will not use this file, when -// compiling Ceres with CMake, CMake will configure a new -// config.h with the currently selected Ceres compile -// options in <BUILD_DIR>/config, which will be added to -// the include path for compilation, and installed with the -// public Ceres headers. However, for some users of Ceres -// who compile without CMake (Android), this file ensures -// that Ceres will compile, with the user either specifying -// manually the Ceres compile options, or passing them -// directly through the compiler. +// IMPORTANT: Most users of Ceres will not use this file, when compiling Ceres +// with CMake, CMake will configure a new config.h with the currently +// selected Ceres compile options in <BUILD_DIR>/config, which will +// be added to the include path for compilation, and installed with +// the public Ceres headers. However, for some users of Ceres who +// compile without CMake (Bazel), this file ensures that Ceres will +// compile, with the user either specifying manually the Ceres +// compile options, or passing them directly through the compiler. #ifndef CERES_PUBLIC_INTERNAL_CONFIG_H_ #define CERES_PUBLIC_INTERNAL_CONFIG_H_
diff --git a/config/ceres/internal/export.h b/config/ceres/internal/export.h new file mode 100644 index 0000000..0d4495d --- /dev/null +++ b/config/ceres/internal/export.h
@@ -0,0 +1,46 @@ +// Ceres Solver - A fast non-linear least squares minimizer +// Copyright 2022 Google Inc. All rights reserved. +// http://ceres-solver.org/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Google Inc. nor the names of its contributors may be +// used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// Author: alexs.mac@gmail.com (Alex Stewart) + +// Default (empty) configuration options for Ceres. +// +// IMPORTANT: Most users of Ceres will not use this file, when compiling Ceres +// with CMake, CMake will configure a new config.h with the currently +// selected Ceres compile options in <BUILD_DIR>/export, which will +// be added to the include path for compilation, and installed with +// the public Ceres headers. However, for some users of Ceres who +// compile without CMake (Bazel), this file ensures that Ceres will +// compile, with the user either specifying manually the Ceres +// compile options, or passing them directly through the compiler. + +#ifndef CERES_PUBLIC_INTERNAL_EXPORT_H_ +#define CERES_PUBLIC_INTERNAL_EXPORT_H_ + + +#endif // CERES_PUBLIC_INTERNAL_EXPORT_H_