blob: 00b799ea4cd056f4063b800c55cc0cf6623ce30e [file] [log] [blame]
Keir Mierlea3b1e192018-02-21 11:13:57 -08001# Ceres Solver - A fast non-linear least squares minimizer
2# Copyright 2018 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# Author: mierle@gmail.com (Keir Mierle)
30
31EXAMPLE_COPTS = [
32 # Needed to silence GFlags complaints.
33 "-Wno-sign-compare",
Austin Schuh17cf0182020-12-23 23:42:34 -080034 # Needed to put fscanf in a function.
35 "-Wno-format-nonliteral",
Keir Mierlea3b1e192018-02-21 11:13:57 -080036]
37
38EXAMPLE_DEPS = [
39 "//:ceres",
Sameer Agarwal29c29122020-10-13 12:07:06 -070040 "@com_gitlab_libeigen_eigen//:eigen",
Keir Mierlea3b1e192018-02-21 11:13:57 -080041 "@com_github_gflags_gflags//:gflags",
42]
43
44cc_binary(
45 name = "bundle_adjuster",
46 srcs = [
47 "bal_problem.cc",
48 "bal_problem.h",
49 "bundle_adjuster.cc",
Keir Mierlea3b1e192018-02-21 11:13:57 -080050 "snavely_reprojection_error.h",
51 ],
52 copts = EXAMPLE_COPTS,
53 deps = EXAMPLE_DEPS,
54)
55
56cc_binary(
57 name = "denoising",
58 srcs = [
59 "denoising.cc",
60 "fields_of_experts.cc",
61 "fields_of_experts.h",
62 "pgm_image.h",
63 ],
64 copts = EXAMPLE_COPTS,
65 deps = EXAMPLE_DEPS,
66)
67
68cc_binary(
69 name = "robot_pose_mle",
70 srcs = [
Keir Mierlea3b1e192018-02-21 11:13:57 -080071 "robot_pose_mle.cc",
72 ],
73 copts = EXAMPLE_COPTS,
74 deps = EXAMPLE_DEPS,
75)
76
Keir Mierlea3b1e192018-02-21 11:13:57 -080077cc_binary(
78 name = "pose_graph_2d",
79 srcs = [
80 "slam/common/read_g2o.h",
81 "slam/pose_graph_2d/angle_local_parameterization.h",
82 "slam/pose_graph_2d/normalize_angle.h",
83 "slam/pose_graph_2d/pose_graph_2d.cc",
84 "slam/pose_graph_2d/pose_graph_2d_error_term.h",
85 "slam/pose_graph_2d/types.h",
86 ],
Austin Schuhc48a3272020-12-23 22:37:59 -080087 copts = EXAMPLE_COPTS,
88 includes = ["slam"],
Keir Mierlea3b1e192018-02-21 11:13:57 -080089 deps = EXAMPLE_DEPS,
90)
91
92cc_binary(
93 name = "pose_graph_3d",
94 srcs = [
95 "slam/common/read_g2o.h",
96 "slam/pose_graph_3d/pose_graph_3d.cc",
97 "slam/pose_graph_3d/pose_graph_3d_error_term.h",
98 "slam/pose_graph_3d/types.h",
99 ],
Austin Schuhc48a3272020-12-23 22:37:59 -0800100 copts = EXAMPLE_COPTS,
101 includes = ["slam"],
Keir Mierlea3b1e192018-02-21 11:13:57 -0800102 deps = EXAMPLE_DEPS,
103)
104
105[cc_binary(
106 name = example,
107 srcs = [example + ".cc"],
108 copts = EXAMPLE_COPTS,
109 deps = EXAMPLE_DEPS,
110) for example in [
111 "circle_fit",
112 "curve_fitting",
113 "ellipse_approximation",
114 "helloworld",
115 "helloworld_analytic_diff",
116 "helloworld_numeric_diff",
117 "libmv_bundle_adjuster",
118 "libmv_homography",
119 "more_garbow_hillstrom",
120 "nist",
121 "powell",
122 "robust_curve_fitting",
123 "rosenbrock",
124 "sampled_function/sampled_function",
125 "simple_bundle_adjuster",
126]]