1# Ceres Solver - A fast non-linear least squares minimizer 2# Copyright 2010, 2011, 2012 Google Inc. All rights reserved. 3# http://code.google.com/p/ceres-solver/ 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: settinger@google.com (Scott Ettinger) 30# keir@google.com (Keir Mierle) 31# 32# Builds Ceres for Android, using the standard toolchain (not standalone). It 33# uses STLPort instead of GNU C++. This is useful for anyone wishing to ship 34# GPL-free code. This cannot build the tests or other parts of Ceres; only the 35# core libraries. If you need a more complete Ceres build, consider using the 36# CMake toolchain (noting that the standalone toolchain doesn't work with 37# STLPort). 38# 39# Reducing binary size: 40# 41# This build includes the Schur specializations, which cause binary bloat. If 42# you don't need them for your application, consider adding: 43# 44# -DCERES_RESTRICT_SCHUR_SPECIALIZATION 45# 46# to the LOCAL_CFLAGS variable below, and commenting out all the 47# generated/schur_eliminator_2_2_2.cc-alike files, leaving only the _d_d_d one. 48# 49# Similarly if you do not need the line search minimizer, consider adding 50# 51# -DCERES_NO_LINE_SEARCH_MINIMIZER 52 53LOCAL_PATH := $(call my-dir) 54include $(CLEAR_VARS) 55 56LOCAL_MODULE := libceres 57 58LOCAL_SDK_VERSION := 17 59LOCAL_NDK_STL_VARIANT := stlport_static 60 61LOCAL_C_INCLUDES := $(LOCAL_PATH)/internal \ 62 $(LOCAL_PATH)/internal/ceres \ 63 $(LOCAL_PATH)/internal/ceres/miniglog \ 64 $(LOCAL_PATH)/include \ 65 external/eigen \ 66 67LOCAL_CPP_EXTENSION := .cc 68LOCAL_CPPFLAGS := -DCERES_NO_PROTOCOL_BUFFERS \ 69 -DCERES_NO_LAPACK \ 70 -DCERES_NO_SUITESPARSE \ 71 -DCERES_NO_GFLAGS \ 72 -DCERES_NO_THREADS \ 73 -DCERES_NO_CXSPARSE \ 74 -DCERES_NO_TR1 \ 75 -DCERES_WORK_AROUND_ANDROID_NDK_COMPILER_BUG \ 76 -DMAX_LOG_LEVEL=-1 \ 77 -O3 -w 78 79# On Android NDK 8b, GCC gives spurrious warnings about ABI incompatibility for 80# which there is no solution. Hide the warning instead. 81LOCAL_CFLAGS += -Wno-psabi 82 83LOCAL_SRC_FILES := internal/ceres/array_utils.cc \ 84 internal/ceres/blas.cc \ 85 internal/ceres/block_evaluate_preparer.cc \ 86 internal/ceres/block_jacobian_writer.cc \ 87 internal/ceres/block_jacobi_preconditioner.cc \ 88 internal/ceres/block_random_access_dense_matrix.cc \ 89 internal/ceres/block_random_access_matrix.cc \ 90 internal/ceres/block_random_access_sparse_matrix.cc \ 91 internal/ceres/block_sparse_matrix.cc \ 92 internal/ceres/block_structure.cc \ 93 internal/ceres/canonical_views_clustering.cc \ 94 internal/ceres/cgnr_solver.cc \ 95 internal/ceres/compressed_row_jacobian_writer.cc \ 96 internal/ceres/compressed_row_sparse_matrix.cc \ 97 internal/ceres/conditioned_cost_function.cc \ 98 internal/ceres/conjugate_gradients_solver.cc \ 99 internal/ceres/coordinate_descent_minimizer.cc \ 100 internal/ceres/corrector.cc \ 101 internal/ceres/dense_normal_cholesky_solver.cc \ 102 internal/ceres/dense_qr_solver.cc \ 103 internal/ceres/dense_sparse_matrix.cc \ 104 internal/ceres/detect_structure.cc \ 105 internal/ceres/dogleg_strategy.cc \ 106 internal/ceres/evaluator.cc \ 107 internal/ceres/file.cc \ 108 internal/ceres/gradient_checking_cost_function.cc \ 109 internal/ceres/implicit_schur_complement.cc \ 110 internal/ceres/iterative_schur_complement_solver.cc \ 111 internal/ceres/lapack.cc \ 112 internal/ceres/levenberg_marquardt_strategy.cc \ 113 internal/ceres/line_search.cc \ 114 internal/ceres/line_search_direction.cc \ 115 internal/ceres/line_search_minimizer.cc \ 116 internal/ceres/linear_least_squares_problems.cc \ 117 internal/ceres/linear_operator.cc \ 118 internal/ceres/linear_solver.cc \ 119 internal/ceres/local_parameterization.cc \ 120 internal/ceres/loss_function.cc \ 121 internal/ceres/low_rank_inverse_hessian.cc \ 122 internal/ceres/minimizer.cc \ 123 internal/ceres/normal_prior.cc \ 124 internal/ceres/parameter_block_ordering.cc \ 125 internal/ceres/partitioned_matrix_view.cc \ 126 internal/ceres/polynomial.cc \ 127 internal/ceres/preconditioner.cc \ 128 internal/ceres/problem.cc \ 129 internal/ceres/problem_impl.cc \ 130 internal/ceres/program.cc \ 131 internal/ceres/residual_block.cc \ 132 internal/ceres/residual_block_utils.cc \ 133 internal/ceres/runtime_numeric_diff_cost_function.cc \ 134 internal/ceres/schur_complement_solver.cc \ 135 internal/ceres/schur_eliminator.cc \ 136 internal/ceres/schur_jacobi_preconditioner.cc \ 137 internal/ceres/scratch_evaluate_preparer.cc \ 138 internal/ceres/solver.cc \ 139 internal/ceres/solver_impl.cc \ 140 internal/ceres/sparse_matrix.cc \ 141 internal/ceres/sparse_normal_cholesky_solver.cc \ 142 internal/ceres/split.cc \ 143 internal/ceres/stringprintf.cc \ 144 internal/ceres/suitesparse.cc \ 145 internal/ceres/triplet_sparse_matrix.cc \ 146 internal/ceres/trust_region_minimizer.cc \ 147 internal/ceres/trust_region_strategy.cc \ 148 internal/ceres/types.cc \ 149 internal/ceres/visibility_based_preconditioner.cc \ 150 internal/ceres/visibility.cc \ 151 internal/ceres/wall_time.cc \ 152 internal/ceres/generated/schur_eliminator_d_d_d.cc \ 153 internal/ceres/generated/schur_eliminator_2_2_2.cc \ 154 internal/ceres/generated/schur_eliminator_2_2_3.cc \ 155 internal/ceres/generated/schur_eliminator_2_2_4.cc \ 156 internal/ceres/generated/schur_eliminator_2_2_d.cc \ 157 internal/ceres/generated/schur_eliminator_2_3_3.cc \ 158 internal/ceres/generated/schur_eliminator_2_3_4.cc \ 159 internal/ceres/generated/schur_eliminator_2_3_9.cc \ 160 internal/ceres/generated/schur_eliminator_2_3_d.cc \ 161 internal/ceres/generated/schur_eliminator_2_4_3.cc \ 162 internal/ceres/generated/schur_eliminator_2_4_4.cc \ 163 internal/ceres/generated/schur_eliminator_2_4_d.cc \ 164 internal/ceres/generated/schur_eliminator_4_4_2.cc \ 165 internal/ceres/generated/schur_eliminator_4_4_3.cc \ 166 internal/ceres/generated/schur_eliminator_4_4_4.cc \ 167 internal/ceres/generated/schur_eliminator_4_4_d.cc 168 169include $(BUILD_STATIC_LIBRARY) 170