WORKSPACE 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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: mierle@gmail.com (Keir Mierle)
  30. #
  31. # Bazel workspace file to enable building Ceres with Bazel.
  32. workspace(name = "com_google_ceres_solver")
  33. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
  34. # External dependency: Google Flags; has Bazel build already.
  35. http_archive(
  36. name = "com_github_gflags_gflags",
  37. sha256 = "6e16c8bc91b1310a44f3965e616383dbda48f83e8c1eaa2370a215057b00cabe",
  38. strip_prefix = "gflags-77592648e3f3be87d6c7123eb81cbad75f9aef5a",
  39. urls = [
  40. "https://mirror.bazel.build/github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz",
  41. "https://github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz",
  42. ],
  43. )
  44. # External dependency: Google Log; has Bazel build already.
  45. http_archive(
  46. name = "com_github_google_glog",
  47. sha256 = "7083af285bed3995b5dc2c982f7de39bced9f0e6fd78d631f3285490922a0c3d",
  48. strip_prefix = "glog-3106945d8d3322e5cbd5658d482c9ffed2d892c0",
  49. urls = [
  50. "https://github.com/drigz/glog/archive/3106945d8d3322e5cbd5658d482c9ffed2d892c0.tar.gz",
  51. ],
  52. )
  53. # External dependency: Eigen; has no Bazel build.
  54. http_archive(
  55. name = "com_gitlab_libeigen_eigen",
  56. sha256 = "0215c6593c4ee9f1f7f28238c4e8995584ebf3b556e9dbf933d84feb98d5b9ef",
  57. strip_prefix = "eigen-3.3.8",
  58. urls = [
  59. "https://gitlab.com/libeigen/eigen/-/archive/3.3.8/eigen-3.3.8.tar.bz2",
  60. ],
  61. build_file_content =
  62. """
  63. # TODO(keir): Replace this with a better version, like from TensorFlow.
  64. # See https://github.com/ceres-solver/ceres-solver/issues/337.
  65. cc_library(
  66. name = 'eigen',
  67. srcs = [],
  68. includes = ['.'],
  69. hdrs = glob(['Eigen/**']),
  70. visibility = ['//visibility:public'],
  71. )
  72. """
  73. )
  74. # External dependency: Google Benchmark; has no Bazel build.
  75. http_archive(
  76. name = "com_github_google_benchmark",
  77. urls = ["https://github.com/google/benchmark/archive/56f52ee228783547f544d9ac4a533574b9010e3f.zip"],
  78. sha256 = "8c1c6e90cd320b07504fabb86400f390faff2e599183ebd9396908817968ae79",
  79. strip_prefix = "benchmark-56f52ee228783547f544d9ac4a533574b9010e3f",
  80. build_file_content =
  81. """
  82. cc_library(
  83. name = "benchmark",
  84. srcs = glob([
  85. "src/*.h",
  86. "src/*.cc",
  87. ]),
  88. hdrs = glob(["include/benchmark/*.h"]),
  89. copts = [
  90. "-DHAVE_STD_REGEX",
  91. ],
  92. includes = [
  93. "include",
  94. ],
  95. visibility = ["//visibility:public"],
  96. )
  97. """
  98. )