| 1 |
# Ceres Solver - A fast non-linear least squares minimizer |
| 2 |
# Copyright 2023 Google Inc. All rights reserved. |
| 3 |
# http://ceres-solver.org/ |
| 4 |
# |
| 5 |
# Redistribution and use in source and binary forms, with or without |
| 6 |
# modification, are permitted provided that the following conditions are met: |
| 7 |
# |
| 8 |
# * Redistributions of source code must retain the above copyright notice, |
| 9 |
# this list of conditions and the following disclaimer. |
| 10 |
# * Redistributions in binary form must reproduce the above copyright notice, |
| 11 |
# this list of conditions and the following disclaimer in the documentation |
| 12 |
# and/or other materials provided with the distribution. |
| 13 |
# * Neither the name of Google Inc. nor the names of its contributors may be |
| 14 |
# used to endorse or promote products derived from this software without |
| 15 |
# specific prior written permission. |
| 16 |
# |
| 17 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 |
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 |
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 20 |
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 21 |
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 |
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 |
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 24 |
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 25 |
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 26 |
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 27 |
# POSSIBILITY OF SUCH DAMAGE. |
| 28 |
# |
| 29 |
# Authors: [email protected] (Keir Mierle) |
| 30 |
# |
| 31 |
# Bazel workspace file to enable building Ceres with Bazel. |
| 32 |
|
| 33 |
workspace(name = "com_google_ceres_solver") |
| 34 |
|
| 35 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 36 |
|
| 37 |
# External dependency: Google Flags; has Bazel build already. |
| 38 |
http_archive( |
| 39 |
name = "com_github_gflags_gflags", |
| 40 |
sha256 = "6e16c8bc91b1310a44f3965e616383dbda48f83e8c1eaa2370a215057b00cabe", |
| 41 |
strip_prefix = "gflags-77592648e3f3be87d6c7123eb81cbad75f9aef5a", |
| 42 |
urls = [ |
| 43 |
"https://mirror.bazel.build/github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz", |
| 44 |
"https://github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz", |
| 45 |
], |
| 46 |
) |
| 47 |
|
| 48 |
# External dependency: Google Log; has Bazel build already. |
| 49 |
http_archive( |
| 50 |
name = "com_github_google_glog", |
| 51 |
sha256 = "7083af285bed3995b5dc2c982f7de39bced9f0e6fd78d631f3285490922a0c3d", |
| 52 |
strip_prefix = "glog-3106945d8d3322e5cbd5658d482c9ffed2d892c0", |
| 53 |
urls = [ |
| 54 |
"https://github.com/drigz/glog/archive/3106945d8d3322e5cbd5658d482c9ffed2d892c0.tar.gz", |
| 55 |
], |
| 56 |
) |
| 57 |
|
| 58 |
# External dependency: Eigen; has no Bazel build. |
| 59 |
http_archive( |
| 60 |
name = "com_gitlab_libeigen_eigen", |
| 61 |
sha256 = "0215c6593c4ee9f1f7f28238c4e8995584ebf3b556e9dbf933d84feb98d5b9ef", |
| 62 |
strip_prefix = "eigen-3.3.8", |
| 63 |
urls = [ |
| 64 |
"https://gitlab.com/libeigen/eigen/-/archive/3.3.8/eigen-3.3.8.tar.bz2", |
| 65 |
], |
| 66 |
build_file_content = |
| 67 |
""" |
| 68 |
# TODO(keir): Replace this with a better version, like from TensorFlow. |
| 69 |
# See https://github.com/ceres-solver/ceres-solver/issues/337. |
| 70 |
cc_library( |
| 71 |
name = 'eigen', |
| 72 |
srcs = [], |
| 73 |
includes = ['.'], |
| 74 |
hdrs = glob(['Eigen/**']), |
| 75 |
visibility = ['//visibility:public'], |
| 76 |
) |
| 77 |
""" |
| 78 |
) |
| 79 |
|
| 80 |
# External dependency: Google Benchmark; has no Bazel build. |
| 81 |
http_archive( |
| 82 |
name = "com_github_google_benchmark", |
| 83 |
urls = ["https://github.com/google/benchmark/archive/56f52ee228783547f544d9ac4a533574b9010e3f.zip"], |
| 84 |
sha256 = "8c1c6e90cd320b07504fabb86400f390faff2e599183ebd9396908817968ae79", |
| 85 |
strip_prefix = "benchmark-56f52ee228783547f544d9ac4a533574b9010e3f", |
| 86 |
build_file_content = |
| 87 |
""" |
| 88 |
cc_library( |
| 89 |
name = "benchmark", |
| 90 |
srcs = glob([ |
| 91 |
"src/*.h", |
| 92 |
"src/*.cc", |
| 93 |
]), |
| 94 |
hdrs = glob(["include/benchmark/*.h"]), |
| 95 |
copts = [ |
| 96 |
"-DHAVE_STD_REGEX", |
| 97 |
], |
| 98 |
includes = [ |
| 99 |
"include", |
| 100 |
], |
| 101 |
visibility = ["//visibility:public"], |
| 102 |
) |
| 103 |
""" |
| 104 |
) |