blob: b3dfb50fe06a6d40af597115618e6810b9e03e50 [file] [log] [blame]
Austin Schuh70cc9552019-01-21 19:46:48 -08001.. _chapter-installation:
2
3============
4Installation
5============
6
7Getting the source code
8=======================
9.. _section-source:
10
11You can start with the `latest stable release
12<http://ceres-solver.org/ceres-solver-1.14.0.tar.gz>`_ . Or if you want
13the latest version, you can clone the git repository
14
15.. code-block:: bash
16
17 git clone https://ceres-solver.googlesource.com/ceres-solver
18
19.. _section-dependencies:
20
21Dependencies
22============
23
24 .. NOTE ::
25
26 All versions of Ceres > 1.14 require a **fully C++11-compliant**
27 compiler. In versions <= 1.14, C++11 was an optional requirement
28 controlled by the ``CXX11 [Default: OFF]`` build option.
29
30Ceres relies on a number of open source libraries, some of which are
31optional. For details on customizing the build process, see
32:ref:`section-customizing` .
33
34- `Eigen <http://eigen.tuxfamily.org/index.php?title=Main_Page>`_
35 3.2.2 or later **strongly** recommended, 3.1.0 or later **required**.
36
37 .. NOTE ::
38
39 Ceres can also use Eigen as a sparse linear algebra
40 library. Please see the documentation for ``EIGENSPARSE`` for
41 more details.
42
43- `CMake <http://www.cmake.org>`_ 3.5 or later.
44 **Required on all platforms except for legacy Android.**
45
46- `glog <https://github.com/google/glog>`_ 0.3.1 or
47 later. **Recommended**
48
49 ``glog`` is used extensively throughout Ceres for logging detailed
50 information about memory allocations and time consumed in various
51 parts of the solve, internal error conditions etc. The Ceres
52 developers use it extensively to observe and analyze Ceres's
53 performance. `glog <https://github.com/google/glog>`_ allows you to
54 control its behaviour from the command line. Starting with
55 ``-logtostderr`` you can add ``-v=N`` for increasing values of ``N``
56 to get more and more verbose and detailed information about Ceres
57 internals.
58
59 Ceres also ships with a minimal replacement of ``glog`` called
60 ``miniglog`` that can be enabled with the ``MINIGLOG`` build option.
61 ``miniglog`` is supplied for platforms which do not support the full
62 version of ``glog``.
63
64 In an attempt to reduce dependencies, it may be tempting to use
65 ``miniglog`` on platforms which already support ``glog``. While
66 there is nothing preventing the user from doing so, we strongly
67 recommend against it. ``miniglog`` has worse performance than
68 ``glog`` and is much harder to control and use.
69
70 .. NOTE ::
71
72 If you are compiling ``glog`` from source, please note that
73 currently, the unit tests for ``glog`` (which are enabled by
74 default) do not compile against a default build of ``gflags`` 2.1
75 as the gflags namespace changed from ``google::`` to
76 ``gflags::``. A patch to fix this is available from `here
77 <https://code.google.com/p/google-glog/issues/detail?id=194>`_.
78
79- `gflags <https://github.com/gflags/gflags>`_. Needed to build
80 examples and tests.
81
82- `SuiteSparse
83 <http://faculty.cse.tamu.edu/davis/suitesparse.html>`_. Needed for
84 solving large sparse linear systems. **Optional; strongly recomended
85 for large scale bundle adjustment**
86
87- `CXSparse <http://faculty.cse.tamu.edu/davis/suitesparse.html>`_.
88 Similar to ``SuiteSparse`` but simpler and slower. CXSparse has
89 no dependencies on ``LAPACK`` and ``BLAS``. This makes for a simpler
90 build process and a smaller binary. **Optional**
91
92- `Apple's Accelerate sparse solvers <https://developer.apple.com/documentation/accelerate/sparse_solvers>`_.
93 As of Xcode 9.0, Apple's Accelerate framework includes support for
94 solving sparse linear systems across macOS, iOS et al. **Optional**
95
96- `BLAS <http://www.netlib.org/blas/>`_ and `LAPACK
97 <http://www.netlib.org/lapack/>`_ routines are needed by
98 ``SuiteSparse``, and optionally used by Ceres directly for some
99 operations.
100
101 On ``UNIX`` OSes other than Mac OS X we recommend `ATLAS
102 <http://math-atlas.sourceforge.net/>`_, which includes ``BLAS`` and
103 ``LAPACK`` routines. It is also possible to use `OpenBLAS
104 <https://github.com/xianyi/OpenBLAS>`_ . However, one needs to be
105 careful to `turn off the threading
106 <https://github.com/xianyi/OpenBLAS/wiki/faq#wiki-multi-threaded>`_
107 inside ``OpenBLAS`` as it conflicts with use of threads in Ceres.
108
109 Mac OS X ships with an optimized ``LAPACK`` and ``BLAS``
110 implementation as part of the ``Accelerate`` framework. The Ceres
111 build system will automatically detect and use it.
112
113 For Windows things are much more complicated. `LAPACK For
114 Windows <http://icl.cs.utk.edu/lapack-for-windows/lapack/>`_
115 has detailed instructions..
116
117 **Optional but required for** ``SuiteSparse``.
118
119.. _section-linux:
120
121Linux
122=====
123
124We will use `Ubuntu <http://www.ubuntu.com>`_ as our example linux
125distribution.
126
127.. NOTE::
128
129 Up to at least Ubuntu 14.04, the SuiteSparse package in the official
130 package repository (built from SuiteSparse v3.4.0) **cannot** be used
131 to build Ceres as a *shared* library. Thus if you want to build
132 Ceres as a shared library using SuiteSparse, you must perform a
133 source install of SuiteSparse or use an external PPA (see `bug report
134 here
135 <https://bugs.launchpad.net/ubuntu/+source/suitesparse/+bug/1333214>`_).
136 It is recommended that you use the current version of SuiteSparse
137 (4.2.1 at the time of writing).
138
139
140Start by installing all the dependencies.
141
142.. code-block:: bash
143
144 # CMake
145 sudo apt-get install cmake
146 # google-glog + gflags
147 sudo apt-get install libgoogle-glog-dev
148 # BLAS & LAPACK
149 sudo apt-get install libatlas-base-dev
150 # Eigen3
151 sudo apt-get install libeigen3-dev
152 # SuiteSparse and CXSparse (optional)
153 # - If you want to build Ceres as a *static* library (the default)
154 # you can use the SuiteSparse package in the main Ubuntu package
155 # repository:
156 sudo apt-get install libsuitesparse-dev
157 # - However, if you want to build Ceres as a *shared* library, you must
158 # add the following PPA:
159 sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
160 sudo apt-get update
161 sudo apt-get install libsuitesparse-dev
162
163We are now ready to build, test, and install Ceres.
164
165.. code-block:: bash
166
167 tar zxf ceres-solver-1.14.0.tar.gz
168 mkdir ceres-bin
169 cd ceres-bin
170 cmake ../ceres-solver-1.14.0
171 make -j3
172 make test
173 # Optionally install Ceres, it can also be exported using CMake which
174 # allows Ceres to be used without requiring installation, see the documentation
175 # for the EXPORT_BUILD_DIR option for more information.
176 make install
177
178You can also try running the command line bundling application with one of the
179included problems, which comes from the University of Washington's BAL
180dataset [Agarwal]_.
181
182.. code-block:: bash
183
184 bin/simple_bundle_adjuster ../ceres-solver-1.14.0/data/problem-16-22106-pre.txt
185
186This runs Ceres for a maximum of 10 iterations using the
187``DENSE_SCHUR`` linear solver. The output should look something like
188this.
189
190.. code-block:: bash
191
192 iter cost cost_change |gradient| |step| tr_ratio tr_radius ls_iter iter_time total_time
193 0 4.185660e+06 0.00e+00 1.09e+08 0.00e+00 0.00e+00 1.00e+04 0 7.59e-02 3.37e-01
194 1 1.062590e+05 4.08e+06 8.99e+06 5.36e+02 9.82e-01 3.00e+04 1 1.65e-01 5.03e-01
195 2 4.992817e+04 5.63e+04 8.32e+06 3.19e+02 6.52e-01 3.09e+04 1 1.45e-01 6.48e-01
196 3 1.899774e+04 3.09e+04 1.60e+06 1.24e+02 9.77e-01 9.26e+04 1 1.43e-01 7.92e-01
197 4 1.808729e+04 9.10e+02 3.97e+05 6.39e+01 9.51e-01 2.78e+05 1 1.45e-01 9.36e-01
198 5 1.803399e+04 5.33e+01 1.48e+04 1.23e+01 9.99e-01 8.33e+05 1 1.45e-01 1.08e+00
199 6 1.803390e+04 9.02e-02 6.35e+01 8.00e-01 1.00e+00 2.50e+06 1 1.50e-01 1.23e+00
200
201 Ceres Solver v1.14.0 Solve Report
202 ----------------------------------
203 Original Reduced
204 Parameter blocks 22122 22122
205 Parameters 66462 66462
206 Residual blocks 83718 83718
207 Residual 167436 167436
208
209 Minimizer TRUST_REGION
210
211 Dense linear algebra library EIGEN
212 Trust region strategy LEVENBERG_MARQUARDT
213
214 Given Used
215 Linear solver DENSE_SCHUR DENSE_SCHUR
216 Threads 1 1
217 Linear solver threads 1 1
218 Linear solver ordering AUTOMATIC 22106, 16
219
220 Cost:
221 Initial 4.185660e+06
222 Final 1.803390e+04
223 Change 4.167626e+06
224
225 Minimizer iterations 6
226 Successful steps 6
227 Unsuccessful steps 0
228
229 Time (in seconds):
230 Preprocessor 0.261
231
232 Residual evaluation 0.082
233 Jacobian evaluation 0.412
234 Linear solver 0.442
235 Minimizer 1.051
236
237 Postprocessor 0.002
238 Total 1.357
239
240 Termination: CONVERGENCE (Function tolerance reached. |cost_change|/cost: 1.769766e-09 <= 1.000000e-06)
241
242.. section-osx:
243
244Mac OS X
245========
246.. NOTE::
247
248 Ceres will not compile using Xcode 4.5.x (Clang version 4.1) due to a
249 bug in that version of Clang. If you are running Xcode 4.5.x, please
250 update to Xcode >= 4.6.x before attempting to build Ceres.
251
252
253On OS X, you can either use `MacPorts <https://www.macports.org/>`_ or
254`Homebrew <http://mxcl.github.com/homebrew/>`_ to install Ceres Solver.
255
256If using `MacPorts <https://www.macports.org/>`_, then
257
258.. code-block:: bash
259
260 sudo port install ceres-solver
261
262will install the latest version.
263
264If using `Homebrew <http://mxcl.github.com/homebrew/>`_ and assuming
265that you have the ``homebrew/science`` [#f1]_ tap enabled, then
266
267.. code-block:: bash
268
269 brew install ceres-solver
270
271will install the latest stable version along with all the required
272dependencies and
273
274.. code-block:: bash
275
276 brew install ceres-solver --HEAD
277
278will install the latest version in the git repo.
279
280You can also install each of the dependencies by hand using `Homebrew
281<http://mxcl.github.com/homebrew/>`_. There is no need to install
282``BLAS`` or ``LAPACK`` separately as OS X ships with optimized
283``BLAS`` and ``LAPACK`` routines as part of the `vecLib
284<https://developer.apple.com/library/mac/#documentation/Performance/Conceptual/vecLib/Reference/reference.html>`_
285framework.
286
287.. code-block:: bash
288
289 # CMake
290 brew install cmake
291 # google-glog and gflags
292 brew install glog
293 # Eigen3
294 brew install eigen
295 # SuiteSparse and CXSparse
296 brew install suite-sparse
297
298We are now ready to build, test, and install Ceres.
299
300.. code-block:: bash
301
302 tar zxf ceres-solver-1.14.0.tar.gz
303 mkdir ceres-bin
304 cd ceres-bin
305 cmake ../ceres-solver-1.14.0
306 make -j3
307 make test
308 # Optionally install Ceres, it can also be exported using CMake which
309 # allows Ceres to be used without requiring installation, see the
310 # documentation for the EXPORT_BUILD_DIR option for more information.
311 make install
312
313Building with OpenMP on OS X
314----------------------------
315
316Up to at least Xcode 8, OpenMP support was disabled in Apple's version of
317Clang. However, you can install the latest version of the LLVM toolchain
318from Homebrew which does support OpenMP, and thus build Ceres with OpenMP
319support on OS X. To do this, you must install llvm via Homebrew:
320
321.. code-block:: bash
322
323 # Install latest version of LLVM toolchain.
324 brew install llvm
325
326As the LLVM formula in Homebrew is keg-only, it will not be installed to
327``/usr/local`` to avoid conflicts with the standard Apple LLVM toolchain.
328To build Ceres with the Homebrew LLVM toolchain you should do the
329following:
330
331.. code-block:: bash
332
333 tar zxf ceres-solver-1.14.0.tar.gz
334 mkdir ceres-bin
335 cd ceres-bin
336 # Configure the local shell only (not persistent) to use the Homebrew LLVM
337 # toolchain in favour of the default Apple version. This is taken
338 # verbatim from the instructions output by Homebrew when installing the
339 # llvm formula.
340 export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
341 export CPPFLAGS="-I/usr/local/opt/llvm/include"
342 export PATH="/usr/local/opt/llvm/bin:$PATH"
343 # Force CMake to use the Homebrew version of Clang. OpenMP will be
344 # automatically enabled if it is detected that the compiler supports it.
345 cmake -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ ../ceres-solver-1.14.0
346 make -j3
347 make test
348 # Optionally install Ceres. It can also be exported using CMake which
349 # allows Ceres to be used without requiring installation. See the
350 # documentation for the EXPORT_BUILD_DIR option for more information.
351 make install
352
353Like the Linux build, you should now be able to run
354``bin/simple_bundle_adjuster``.
355
356
357.. rubric:: Footnotes
358
359.. [#f1] Ceres and many of its dependencies are in `homebrew/science
360 <https://github.com/Homebrew/homebrew-science>`_ tap. So, if you
361 don't have this tap enabled, then you will need to enable it as
362 follows before executing any of the commands in this section.
363
364 .. code-block:: bash
365
366 brew tap homebrew/science
367
368
369.. _section-windows:
370
371Windows
372=======
373
374.. NOTE::
375
376 If you find the following CMake difficult to set up, then you may
377 be interested in a `Microsoft Visual Studio wrapper
378 <https://github.com/tbennun/ceres-windows>`_ for Ceres Solver by Tal
379 Ben-Nun.
380
381On Windows, we support building with Visual Studio 2013 Release 4 or newer. Note
382that the Windows port is less featureful and less tested than the
383Linux or Mac OS X versions due to the lack of an officially supported
384way of building SuiteSparse and CXSparse. There are however a number
385of unofficial ways of building these libraries. Building on Windows
386also a bit more involved since there is no automated way to install
387dependencies.
388
389.. NOTE:: Using ``google-glog`` & ``miniglog`` with windows.h.
390
391 The windows.h header if used with GDI (Graphics Device Interface)
392 defines ``ERROR``, which conflicts with the definition of ``ERROR``
393 as a LogSeverity level in ``google-glog`` and ``miniglog``. There
394 are at least two possible fixes to this problem:
395
396 #. Use ``google-glog`` and define ``GLOG_NO_ABBREVIATED_SEVERITIES``
397 when building Ceres and your own project, as documented `here
398 <http://google-glog.googlecode.com/svn/trunk/doc/glog.html>`__.
399 Note that this fix will not work for ``miniglog``, but use of
400 ``miniglog`` is strongly discouraged on any platform for which
401 ``google-glog`` is available (which includes Windows).
402 #. If you do not require GDI, then define ``NOGDI`` **before**
403 including windows.h. This solution should work for both
404 ``google-glog`` and ``miniglog`` and is documented for
405 ``google-glog`` `here
406 <https://code.google.com/p/google-glog/issues/detail?id=33>`__.
407
408#. Make a toplevel directory for deps & build & src somewhere: ``ceres/``
409#. Get dependencies; unpack them as subdirectories in ``ceres/``
410 (``ceres/eigen``, ``ceres/glog``, etc)
411
412 #. ``Eigen`` 3.1 (needed on Windows; 3.0.x will not work). There is
413 no need to build anything; just unpack the source tarball.
414
415 #. ``google-glog`` Open up the Visual Studio solution and build it.
416 #. ``gflags`` Open up the Visual Studio solution and build it.
417
418 #. (Experimental) ``SuiteSparse`` Previously SuiteSparse was not
419 available on Windows, recently it has become possible to build
420 it on Windows using the `suitesparse-metis-for-windows
421 <https://github.com/jlblancoc/suitesparse-metis-for-windows>`_
422 project. If you wish to use ``SuiteSparse``, follow their
423 instructions for obtaining and building it.
424
425 #. (Experimental) ``CXSparse`` Previously CXSparse was not
426 available on Windows, there are now several ports that enable it
427 to be, including: `[1] <https://github.com/PetterS/CXSparse>`_
428 and `[2] <https://github.com/TheFrenchLeaf/CXSparse>`_. If you
429 wish to use ``CXSparse``, follow their instructions for
430 obtaining and building it.
431
432#. Unpack the Ceres tarball into ``ceres``. For the tarball, you
433 should get a directory inside ``ceres`` similar to
434 ``ceres-solver-1.3.0``. Alternately, checkout Ceres via ``git`` to
435 get ``ceres-solver.git`` inside ``ceres``.
436
437#. Install ``CMake``,
438
439#. Make a dir ``ceres/ceres-bin`` (for an out-of-tree build)
440
441#. Run ``CMake``; select the ``ceres-solver-X.Y.Z`` or
442 ``ceres-solver.git`` directory for the CMake file. Then select the
443 ``ceres-bin`` for the build dir.
444
445#. Try running ``Configure``. It won't work. It'll show a bunch of options.
446 You'll need to set:
447
448 #. ``EIGEN_INCLUDE_DIR_HINTS``
449 #. ``GLOG_INCLUDE_DIR_HINTS``
450 #. ``GLOG_LIBRARY_DIR_HINTS``
451 #. ``GFLAGS_INCLUDE_DIR_HINTS``
452 #. ``GFLAGS_LIBRARY_DIR_HINTS``
453 #. (Optional) ``SUITESPARSE_INCLUDE_DIR_HINTS``
454 #. (Optional) ``SUITESPARSE_LIBRARY_DIR_HINTS``
455 #. (Optional) ``CXSPARSE_INCLUDE_DIR_HINTS``
456 #. (Optional) ``CXSPARSE_LIBRARY_DIR_HINTS``
457
458 to the appropriate directories where you unpacked/built them. If
459 any of the variables are not visible in the ``CMake`` GUI, create a
460 new entry for them. We recommend using the
461 ``<NAME>_(INCLUDE/LIBRARY)_DIR_HINTS`` variables rather than
462 setting the ``<NAME>_INCLUDE_DIR`` & ``<NAME>_LIBRARY`` variables
463 directly to keep all of the validity checking, and to avoid having
464 to specify the library files manually.
465
466#. You may have to tweak some more settings to generate a MSVC
467 project. After each adjustment, try pressing Configure & Generate
468 until it generates successfully.
469
470#. Open the solution and build it in MSVC
471
472
473To run the tests, select the ``RUN_TESTS`` target and hit **Build
474RUN_TESTS** from the build menu.
475
476Like the Linux build, you should now be able to run
477``bin/simple_bundle_adjuster``.
478
479Notes:
480
481#. The default build is Debug; consider switching it to release mode.
482#. Currently ``system_test`` is not working properly.
483#. CMake puts the resulting test binaries in ``ceres-bin/examples/Debug``
484 by default.
485#. The solvers supported on Windows are ``DENSE_QR``, ``DENSE_SCHUR``,
486 ``CGNR``, and ``ITERATIVE_SCHUR``.
487#. We're looking for someone to work with upstream ``SuiteSparse`` to
488 port their build system to something sane like ``CMake``, and get a
489 fully supported Windows port.
490
491
492.. _section-android:
493
494Android
495=======
496
497.. NOTE::
498
499 You will need Android NDK r15 or higher to build Ceres solver.
500
501To build Ceres for Android, we need to force ``CMake`` to find
502the toolchains from the Android NDK instead of using the standard
503ones. For example, assuming you have specified ``$NDK_DIR``:
504
505.. code-block:: bash
506
507 cmake \
508 -DCMAKE_TOOLCHAIN_FILE=\
509 $NDK_DIR/build/cmake/android.toolchain.cmake \
510 -DEIGEN_INCLUDE_DIR=/path/to/eigen/header \
511 -DANDROID_ABI=armeabi-v7a \
512 -DANDROID_STL=c++_shared \
513 -DANDROID_NATIVE_API_LEVEL=android-24 \
514 -DBUILD_SHARED_LIBS=ON \
515 -DMINIGLOG=ON \
516 <PATH_TO_CERES_SOURCE>
517
518You can build for any Android STL or ABI, but the c++_shared STL
519and the armeabi-v7a or arm64-v8a ABI are recommended for 32bit
520and 64bit architectures, respectively. Several API levels may
521be supported, but it is recommended that you use the highest
522level that is suitable for your Android project.
523
524.. NOTE::
525
526 You must always use the same API level and STL library for
527 your Android project and the Ceres binaries.
528
529After building, you get a ``libceres.so`` library, which you can
530link in your Android build system by using a
531``PREBUILT_SHARED_LIBRARY`` target in your build script.
532
533If you are building any Ceres samples and would like to verify
534your library, you will need to place them in an executable public
535directory together with ``libceres.so`` on your Android device
536(e.g. in /data/local/tmp) and ensure that the STL library from
537your NDK is present in that same directory. You may then execute
538the sample by running for example:
539
540.. code-block:: bash
541 adb shell
542 cd /data/local/tmp
543 LD_LIBRARY_PATH=/data/local/tmp ./helloworld
544
545Note that any solvers or other shared dependencies you include in
546your project must also be present in your android build config and
547your test directory on Android.
548
549.. _section-ios:
550
551iOS
552===
553
554.. NOTE::
555
556 You need iOS version 7.0 or higher to build Ceres Solver.
557
558To build Ceres for iOS, we need to force ``CMake`` to find the
559toolchains from the iOS SDK instead of using the standard ones. For
560example:
561
562.. code-block:: bash
563
564 cmake \
565 -DCMAKE_TOOLCHAIN_FILE=../ceres-solver/cmake/iOS.cmake \
566 -DEIGEN_INCLUDE_DIR=/path/to/eigen/header \
567 -DIOS_PLATFORM=<PLATFORM> \
568 <PATH_TO_CERES_SOURCE>
569
570``PLATFORM`` can be: ``OS``, ``SIMULATOR`` or ``SIMULATOR64``. You can
571build for ``OS`` (``armv7``, ``armv7s``, ``arm64``), ``SIMULATOR``
572(``i386``) or ``SIMULATOR64`` (``x86_64``) separately and use ``lipo``
573to merge them into one static library. See ``cmake/iOS.cmake`` for
574more options.
575
576.. NOTE::
577
578 iOS version 11.0+ requires a 64-bit architecture, so you cannot
579 build for armv7/armv7s with iOS 11.0+ (only arm64 is supported).
580
581After building, you will get a ``libceres.a`` library, which you will
582need to add to your Xcode project.
583
584The default CMake configuration builds a bare bones version of Ceres
585Solver that only depends on Eigen (``MINIGLOG`` is compiled into Ceres
586if it is used), this should be sufficient for solving small to
587moderate sized problems (No ``SPARSE_SCHUR``,
588``SPARSE_NORMAL_CHOLESKY`` linear solvers and no ``CLUSTER_JACOBI``
589and ``CLUSTER_TRIDIAGONAL`` preconditioners).
590
591If you decide to use ``LAPACK`` and ``BLAS``, then you also need to
592add ``Accelerate.framework`` to your Xcode project's linking
593dependency.
594
595.. _section-customizing:
596
597Customizing the build
598=====================
599
600It is possible to reduce the libraries needed to build Ceres and
601customize the build process by setting the appropriate options in
602``CMake``. These options can either be set in the ``CMake`` GUI, or
603via ``-D<OPTION>=<ON/OFF>`` when running ``CMake`` from the command
604line. In general, you should only modify these options from their
605defaults if you know what you are doing.
606
607.. NOTE::
608
609 If you are setting variables via ``-D<VARIABLE>=<VALUE>`` when
610 calling ``CMake``, it is important to understand that this forcibly
611 **overwrites** the variable ``<VARIABLE>`` in the ``CMake`` cache at
612 the start of *every configure*.
613
614 This can lead to confusion if you are invoking the ``CMake`` `curses
615 <http://www.gnu.org/software/ncurses/ncurses.html>`_ terminal GUI
616 (via ``ccmake``, e.g. ```ccmake -D<VARIABLE>=<VALUE>
617 <PATH_TO_SRC>``). In this case, even if you change the value of
618 ``<VARIABLE>`` in the ``CMake`` GUI, your changes will be
619 **overwritten** with the value passed via ``-D<VARIABLE>=<VALUE>``
620 (if one exists) at the start of each configure.
621
622 As such, it is generally easier not to pass values to ``CMake`` via
623 ``-D`` and instead interactively experiment with their values in the
624 ``CMake`` GUI. If they are not present in the *Standard View*,
625 toggle to the *Advanced View* with ``<t>``.
626
627
628Modifying default compilation flags
629-----------------------------------
630
631The ``CMAKE_CXX_FLAGS`` variable can be used to define additional
632default compilation flags for all build types. Any flags specified
633in ``CMAKE_CXX_FLAGS`` will be used in addition to the default
634flags used by Ceres for the current build type.
635
636For example, if you wished to build Ceres with `-march=native
637<https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html>`_ which is not
638enabled by default (even if ``CMAKE_BUILD_TYPE=Release``) you would invoke
639CMake with:
640
641.. code-block:: bash
642
643 cmake -DCMAKE_CXX_FLAGS="-march=native" <PATH_TO_CERES_SOURCE>
644
645.. NOTE ::
646
647 The use of ``-march=native`` will limit portability, as it will tune the
648 implementation to the specific CPU of the compiling machine (e.g. use of
649 AVX if available). Run-time segfaults may occur if you then tried to
650 run the resulting binaries on a machine with a different processor, even
651 if it is from the same family (e.g. x86) if the specific options available
652 are different. Note that the performance gains from the use of
653 ``-march=native`` are not guaranteed to be significant.
654
655.. _options-controlling-ceres-configuration:
656
657Options controlling Ceres configuration
658---------------------------------------
659
660#. ``LAPACK [Default: ON]``: If this option is enabled, and the ``BLAS`` and
661 ``LAPACK`` libraries are found, Ceres will enable **direct** use of
662 ``LAPACK`` routines (i.e. Ceres itself will call them). If this option is
663 disabled, then Ceres will not require ``LAPACK`` or ``BLAS``. It is
664 however still possible that Ceres may call ``LAPACK`` routines indirectly
665 via SuiteSparse if ``LAPACK=OFF`` and ``SUITESPARSE=ON``. Finally
666 note that if ``LAPACK=ON`` and ``SUITESPARSE=ON``, the ``LAPACK`` and
667 ``BLAS`` libraries used by SuiteSparse and Ceres should be the same.
668
669#. ``SUITESPARSE [Default: ON]``: By default, Ceres will link to
670 ``SuiteSparse`` if it and all of its dependencies are present. Turn
671 this ``OFF`` to build Ceres without ``SuiteSparse``.
672
673 .. NOTE::
674
675 SuiteSparse is licensed under a mixture of GPL/LGPL/Commercial
676 terms. Ceres requires some components that are only licensed under
677 GPL/Commercial terms.
678
679#. ``CXSPARSE [Default: ON]``: By default, Ceres will link to
680 ``CXSparse`` if all its dependencies are present. Turn this ``OFF``
681 to build Ceres without ``CXSparse``.
682
683 .. NOTE::
684
685 CXSparse is licensed under the LGPL.
686
687#. ``ACCELERATESPARSE [Default: ON]``: By default, Ceres will link to
688 Apple's Accelerate framework directly if a version of it is detected
689 which supports solving sparse linear systems. Note that on Apple OSs
690 Accelerate usually also provides the BLAS/LAPACK implementations and
691 so would be linked against irrespective of the value of ``ACCELERATESPARSE``.
692
693#. ``EIGENSPARSE [Default: ON]``: By default, Ceres will not use
694 Eigen's sparse Cholesky factorization.
695
696 .. NOTE::
697
698 For good performance, use Eigen version 3.2.2 or later.
699
700 .. NOTE::
701
702 Unlike the rest of Eigen (>= 3.1.1 MPL2, < 3.1.1 LGPL), Eigen's sparse
703 Cholesky factorization is (still) licensed under the LGPL.
704
705#. ``GFLAGS [Default: ON]``: Turn this ``OFF`` to build Ceres without
706 ``gflags``. This will also prevent some of the example code from
707 building.
708
709#. ``MINIGLOG [Default: OFF]``: Ceres includes a stripped-down,
710 minimal implementation of ``glog`` which can optionally be used as
711 a substitute for ``glog``, thus removing ``glog`` as a required
712 dependency. Turn this ``ON`` to use this minimal ``glog``
713 implementation.
714
715#. ``SCHUR_SPECIALIZATIONS [Default: ON]``: If you are concerned about
716 binary size/compilation time over some small (10-20%) performance
717 gains in the ``SPARSE_SCHUR`` solver, you can disable some of the
718 template specializations by turning this ``OFF``.
719
720#. ``CERES_THREADING_MODEL [Default: CXX11_THREADS > OPENMP > NO_THREADS]``:
721 Multi-threading backend Ceres should be compiled with. This will
722 automatically be set to only accept the available subset of threading
723 options in the CMake GUI.
724
725#. ``BUILD_SHARED_LIBS [Default: OFF]``: By default Ceres is built as
726 a static library, turn this ``ON`` to instead build Ceres as a
727 shared library.
728
729#. ``EXPORT_BUILD_DIR [Default: OFF]``: By default Ceres is configured
730 solely for installation, and so must be installed in order for
731 clients to use it. Turn this ``ON`` to export Ceres' build
732 directory location into the `user's local CMake package registry
733 <http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#user-package-registry>`_
734 where it will be detected **without requiring installation** in a
735 client project using CMake when `find_package(Ceres)
736 <http://www.cmake.org/cmake/help/v3.2/command/find_package.html>`_
737 is invoked.
738
739#. ``BUILD_DOCUMENTATION [Default: OFF]``: Use this to enable building
740 the documentation, requires `Sphinx <http://sphinx-doc.org/>`_ and
741 the `sphinx-better-theme
742 <https://pypi.python.org/pypi/sphinx-better-theme>`_ package
743 available from the Python package index. In addition, ``make
744 ceres_docs`` can be used to build only the documentation.
745
746#. ``MSVC_USE_STATIC_CRT [Default: OFF]`` *Windows Only*: By default
747 Ceres will use the Visual Studio default, *shared* C-Run Time (CRT)
748 library. Turn this ``ON`` to use the *static* C-Run Time library
749 instead.
750
751#. ``LIB_SUFFIX [Default: "64" on non-Debian/Arch based 64-bit Linux,
752 otherwise: ""]``: The suffix to append to the library install
753 directory, built from:
754 ``${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}``.
755
756 The filesystem hierarchy standard recommends that 64-bit systems
757 install native libraries to lib64 rather than lib. Most Linux
758 distributions follow this convention, but Debian and Arch based
759 distros do not. Note that the only generally sensible values for
760 ``LIB_SUFFIX`` are "" and "64".
761
762 Although by default Ceres will auto-detect non-Debian/Arch based
763 64-bit Linux distributions and default ``LIB_SUFFIX`` to "64", this
764 can always be overridden by manually specifying LIB_SUFFIX using:
765 ``-DLIB_SUFFIX=<VALUE>`` when invoking CMake.
766
767
768Options controlling Ceres dependency locations
769----------------------------------------------
770
771Ceres uses the ``CMake`` `find_package
772<http://www.cmake.org/cmake/help/v3.2/command/find_package.html>`_
773function to find all of its dependencies using
774``Find<DEPENDENCY_NAME>.cmake`` scripts which are either included in
775Ceres (for most dependencies) or are shipped as standard with
776``CMake`` (for ``LAPACK`` & ``BLAS``). These scripts will search all
777of the "standard" install locations for various OSs for each
778dependency. However, particularly for Windows, they may fail to find
779the library, in this case you will have to manually specify its
780installed location. The ``Find<DEPENDENCY_NAME>.cmake`` scripts
781shipped with Ceres support two ways for you to do this:
782
783#. Set the *hints* variables specifying the *directories* to search in
784 preference, but in addition, to the search directories in the
785 ``Find<DEPENDENCY_NAME>.cmake`` script:
786
787 - ``<DEPENDENCY_NAME (CAPS)>_INCLUDE_DIR_HINTS``
788 - ``<DEPENDENCY_NAME (CAPS)>_LIBRARY_DIR_HINTS``
789
790 These variables should be set via ``-D<VAR>=<VALUE>``
791 ``CMake`` arguments as they are not visible in the GUI.
792
793#. Set the variables specifying the *explicit* include directory
794 and library file to use:
795
796 - ``<DEPENDENCY_NAME (CAPS)>_INCLUDE_DIR``
797 - ``<DEPENDENCY_NAME (CAPS)>_LIBRARY``
798
799 This bypasses *all* searching in the
800 ``Find<DEPENDENCY_NAME>.cmake`` script, but validation is still
801 performed.
802
803 These variables are available to set in the ``CMake`` GUI. They are
804 visible in the *Standard View* if the library has not been found
805 (but the current Ceres configuration requires it), but are always
806 visible in the *Advanced View*. They can also be set directly via
807 ``-D<VAR>=<VALUE>`` arguments to ``CMake``.
808
809Building using custom BLAS & LAPACK installs
810----------------------------------------------
811
812If the standard find package scripts for ``BLAS`` & ``LAPACK`` which
813ship with ``CMake`` fail to find the desired libraries on your system,
814try setting ``CMAKE_LIBRARY_PATH`` to the path(s) to the directories
815containing the ``BLAS`` & ``LAPACK`` libraries when invoking ``CMake``
816to build Ceres via ``-D<VAR>=<VALUE>``. This should result in the
817libraries being found for any common variant of each.
818
819Alternatively, you may also directly specify the ``BLAS_LIBRARIES`` and
820``LAPACK_LIBRARIES`` variables via ``-D<VAR>=<VALUE>`` when invoking CMake
821to configure Ceres.
822
823.. _section-using-ceres:
824
825Using Ceres with CMake
826======================
827
828In order to use Ceres in client code with CMake using `find_package()
829<http://www.cmake.org/cmake/help/v3.2/command/find_package.html>`_
830then either:
831
832#. Ceres must have been installed with ``make install``. If the
833 install location is non-standard (i.e. is not in CMake's default
834 search paths) then it will not be detected by default, see:
835 :ref:`section-local-installations`.
836
837 Note that if you are using a non-standard install location you
838 should consider exporting Ceres instead, as this will not require
839 any extra information to be provided in client code for Ceres to
840 be detected.
841
842#. Or Ceres' build directory must have been exported by enabling the
843 ``EXPORT_BUILD_DIR`` option when Ceres was configured.
844
845
846As an example of how to use Ceres, to compile `examples/helloworld.cc
847<https://ceres-solver.googlesource.com/ceres-solver/+/master/examples/helloworld.cc>`_
848in a separate standalone project, the following CMakeList.txt can be
849used:
850
851.. code-block:: cmake
852
853 cmake_minimum_required(VERSION 3.5)
854
855 project(helloworld)
856
857 find_package(Ceres REQUIRED)
858
859 # helloworld
860 add_executable(helloworld helloworld.cc)
861 target_link_libraries(helloworld ${CERES_LIBRARIES})
862
863Irrespective of whether Ceres was installed or exported, if multiple
864versions are detected, set: ``Ceres_DIR`` to control which is used.
865If Ceres was installed ``Ceres_DIR`` should be the path to the
866directory containing the installed ``CeresConfig.cmake`` file
867(e.g. ``/usr/local/share/Ceres``). If Ceres was exported, then
868``Ceres_DIR`` should be the path to the exported Ceres build
869directory.
870
871 .. NOTE ::
872
873 You do not need to call include_directories(${CERES_INCLUDE_DIRS})
874 as the exported Ceres CMake target already contains the definitions
875 of its public include directories which will be automatically
876 included by CMake when compiling a target that links against Ceres.
877
878Specify Ceres components
879-------------------------------------
880
881You can specify particular Ceres components that you require (in order
882for Ceres to be reported as found) when invoking
883``find_package(Ceres)``. This allows you to specify, for example,
884that you require a version of Ceres built with SuiteSparse support.
885By definition, if you do not specify any components when calling
886``find_package(Ceres)`` (the default) any version of Ceres detected
887will be reported as found, irrespective of which components it was
888built with.
889
890The Ceres components which can be specified are:
891
892#. ``LAPACK``: Ceres built using LAPACK (``LAPACK=ON``).
893
894#. ``SuiteSparse``: Ceres built with SuiteSparse (``SUITESPARSE=ON``).
895
896#. ``CXSparse``: Ceres built with CXSparse (``CXSPARSE=ON``).
897
898#. ``AccelerateSparse``: Ceres built with Apple's Accelerate sparse solvers (``ACCELERATESPARSE=ON``).
899
900#. ``EigenSparse``: Ceres built with Eigen's sparse Cholesky factorization
901 (``EIGENSPARSE=ON``).
902
903#. ``SparseLinearAlgebraLibrary``: Ceres built with *at least one* sparse linear
904 algebra library. This is equivalent to ``SuiteSparse`` **OR** ``CXSparse``
905 **OR** ``AccelerateSparse`` **OR** ``EigenSparse``.
906
907#. ``SchurSpecializations``: Ceres built with Schur specializations
908 (``SCHUR_SPECIALIZATIONS=ON``).
909
910#. ``OpenMP``: Ceres built with OpenMP (``CERES_THREADING_MODEL=OPENMP``).
911
912#. ``Multithreading``: Ceres built with *a* multithreading library.
913 This is equivalent to (``CERES_THREAD != NO_THREADS``).
914
915#. ``C++11``: Ceres built with C++11.
916
917To specify one/multiple Ceres components use the ``COMPONENTS`` argument to
918`find_package()
919<http://www.cmake.org/cmake/help/v3.2/command/find_package.html>`_ like so:
920
921.. code-block:: cmake
922
923 # Find a version of Ceres compiled with SuiteSparse & EigenSparse support.
924 #
925 # NOTE: This will report Ceres as **not** found if the detected version of
926 # Ceres was not compiled with both SuiteSparse & EigenSparse.
927 # Remember, if you have multiple versions of Ceres installed, you
928 # can use Ceres_DIR to specify which should be used.
929 find_package(Ceres REQUIRED COMPONENTS SuiteSparse EigenSparse)
930
931
932Specify Ceres version
933---------------------
934
935Additionally, when CMake has found Ceres it can optionally check the package
936version, if it has been specified in the `find_package()
937<http://www.cmake.org/cmake/help/v3.2/command/find_package.html>`_
938call. For example:
939
940.. code-block:: cmake
941
942 find_package(Ceres 1.2.3 REQUIRED)
943
944.. _section-local-installations:
945
946Local installations
947-------------------
948
949If Ceres was installed in a non-standard path by specifying
950``-DCMAKE_INSTALL_PREFIX="/some/where/local"``, then the user should
951add the **PATHS** option to the ``find_package()`` command, e.g.,
952
953.. code-block:: cmake
954
955 find_package(Ceres REQUIRED PATHS "/some/where/local/")
956
957Note that this can be used to have multiple versions of Ceres
958installed. However, particularly if you have only a single version of
959Ceres which you want to use but do not wish to install to a system
960location, you should consider exporting Ceres using the
961``EXPORT_BUILD_DIR`` option instead of a local install, as exported
962versions of Ceres will be automatically detected by CMake,
963irrespective of their location.
964
965Understanding the CMake Package System
966----------------------------------------
967
968Although a full tutorial on CMake is outside the scope of this guide,
969here we cover some of the most common CMake misunderstandings that
970crop up when using Ceres. For more detailed CMake usage, the
971following references are very useful:
972
973- The `official CMake tutorial <http://www.cmake.org/cmake-tutorial/>`_
974
975 Provides a tour of the core features of CMake.
976
977- `ProjectConfig tutorial
978 <http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file>`_
979 and the `cmake-packages documentation
980 <http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html>`_
981
982 Cover how to write a ``ProjectConfig.cmake`` file, discussed below,
983 for your own project when installing or exporting it using CMake.
984 It also covers how these processes in conjunction with
985 ``find_package()`` are actually handled by CMake. The
986 `ProjectConfig tutorial
987 <http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file>`_
988 is the older style, currently used by Ceres for compatibility with
989 older versions of CMake.
990
991 .. NOTE :: **Targets in CMake.**
992
993 All libraries and executables built using CMake are represented as
994 *targets* created using `add_library()
995 <http://www.cmake.org/cmake/help/v3.2/command/add_library.html>`_
996 and `add_executable()
997 <http://www.cmake.org/cmake/help/v3.2/command/add_executable.html>`_.
998 Targets encapsulate the rules and dependencies (which can be other
999 targets) required to build or link against an object. This allows
1000 CMake to implicitly manage dependency chains. Thus it is
1001 sufficient to tell CMake that a library target: ``B`` depends on a
1002 previously declared library target ``A``, and CMake will
1003 understand that this means that ``B`` also depends on all of the
1004 public dependencies of ``A``.
1005
1006When a project like Ceres is installed using CMake, or its build
1007directory is exported into the local CMake package registry (see
1008:ref:`section-install-vs-export`), in addition to the public headers
1009and compiled libraries, a set of CMake-specific project configuration
1010files are also installed to: ``<INSTALL_ROOT>/share/Ceres`` (if Ceres
1011is installed), or created in the build directory (if Ceres' build
1012directory is exported). When `find_package
1013<http://www.cmake.org/cmake/help/v3.2/command/find_package.html>`_ is
1014invoked, CMake checks various standard install locations (including
1015``/usr/local`` on Linux & UNIX systems), and the local CMake package
1016registry for CMake configuration files for the project to be found
1017(i.e. Ceres in the case of ``find_package(Ceres)``). Specifically it
1018looks for:
1019
1020- ``<PROJECT_NAME>Config.cmake`` (or
1021 ``<lower_case_project_name>-config.cmake``)
1022
1023 Which is written by the developers of the project, and is
1024 configured with the selected options and installed locations when
1025 the project is built and defines the CMake variables:
1026 ``<PROJECT_NAME>_INCLUDE_DIRS`` & ``<PROJECT_NAME>_LIBRARIES``
1027 which are used by the caller to import the project.
1028
1029The ``<PROJECT_NAME>Config.cmake`` typically includes a second file
1030installed to the same location:
1031
1032- ``<PROJECT_NAME>Targets.cmake``
1033
1034 Which is autogenerated by CMake as part of the install process and defines
1035 **imported targets** for the project in the caller's CMake scope.
1036
1037An **imported target** contains the same information about a library
1038as a CMake target that was declared locally in the current CMake
1039project using ``add_library()``. However, imported targets refer to
1040objects that have already been built by a different CMake project.
1041Principally, an imported target contains the location of the compiled
1042object and all of its public dependencies required to link against it.
1043Any locally declared target can depend on an imported target, and
1044CMake will manage the dependency chain, just as if the imported target
1045had been declared locally by the current project.
1046
1047Crucially, just like any locally declared CMake target, an imported target is
1048identified by its **name** when adding it as a dependency to another target.
1049
1050Thus, if in a project using Ceres you had the following in your CMakeLists.txt:
1051
1052.. code-block:: cmake
1053
1054 find_package(Ceres REQUIRED)
1055 message("CERES_LIBRARIES = ${CERES_LIBRARIES}")
1056
1057You would see the output: ``CERES_LIBRARIES = ceres``. **However**,
1058here ``ceres`` is an **imported target** created when
1059``CeresTargets.cmake`` was read as part of ``find_package(Ceres
1060REQUIRED)``. It does **not** refer (directly) to the compiled Ceres
1061library: ``libceres.a/so/dylib/lib``. This distinction is important,
1062as depending on the options selected when it was built, Ceres can have
1063public link dependencies which are encapsulated in the imported target
1064and automatically added to the link step when Ceres is added as a
1065dependency of another target by CMake. In this case, linking only
1066against ``libceres.a/so/dylib/lib`` without these other public
1067dependencies would result in a linker error.
1068
1069Note that this description applies both to projects that are
1070**installed** using CMake, and to those whose **build directory is
1071exported** using `export()
1072<http://www.cmake.org/cmake/help/v3.2/command/export.html>`_ (instead
1073of `install()
1074<http://www.cmake.org/cmake/help/v3.2/command/install.html>`_). Ceres
1075supports both installation and export of its build directory if the
1076``EXPORT_BUILD_DIR`` option is enabled, see
1077:ref:`section-customizing`.
1078
1079.. _section-install-vs-export:
1080
1081Installing a project with CMake vs Exporting its build directory
1082^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1083
1084When a project is **installed**, the compiled libraries and headers
1085are copied from the source & build directory to the install location,
1086and it is these copied files that are used by any client code. When a
1087project's build directory is **exported**, instead of copying the
1088compiled libraries and headers, CMake creates an entry for the project
1089in the `user's local CMake package registry
1090<http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#user-package-registry>`_,
1091``<USER_HOME>/.cmake/packages`` on Linux & OS X, which contains the
1092path to the project's build directory which will be checked by CMake
1093during a call to ``find_package()``. The effect of which is that any
1094client code uses the compiled libraries and headers in the build
1095directory directly, **thus not requiring the project to be installed
1096to be used**.
1097
1098Installing / Exporting a project that uses Ceres
1099--------------------------------------------------
1100
1101As described in `Understanding the CMake Package System`_, the contents of
1102the ``CERES_LIBRARIES`` variable is the **name** of an imported target which
1103represents Ceres. If you are installing / exporting your *own* project which
1104*uses* Ceres, it is important to understand that:
1105
1106**Imported targets are not (re)exported when a project which imported them is
1107exported**.
1108
1109Thus, when a project ``Foo`` which uses Ceres is exported, its list of
1110dependencies as seen by another project ``Bar`` which imports ``Foo``
1111via: ``find_package(Foo REQUIRED)`` will contain: ``ceres``. However,
1112the definition of ``ceres`` as an imported target is **not
1113(re)exported** when Foo is exported. Hence, without any additional
1114steps, when processing ``Bar``, ``ceres`` will not be defined as an
1115imported target. Thus, when processing ``Bar``, CMake will assume
1116that ``ceres`` refers only to: ``libceres.a/so/dylib/lib`` (the
1117compiled Ceres library) directly if it is on the current list of
1118search paths. In which case, no CMake errors will occur, but ``Bar``
1119will not link properly, as it does not have the required public link
1120dependencies of Ceres, which are stored in the imported target
1121definition.
1122
1123The solution to this is for ``Foo`` (i.e., the project that uses
1124Ceres) to invoke ``find_package(Ceres)`` in ``FooConfig.cmake``, thus
1125``ceres`` will be defined as an imported target when CMake processes
1126``Bar``. An example of the required modifications to
1127``FooConfig.cmake`` are show below:
1128
1129.. code-block:: cmake
1130
1131 # Importing Ceres in FooConfig.cmake using CMake 2.8.x style.
1132 #
1133 # When configure_file() is used to generate FooConfig.cmake from
1134 # FooConfig.cmake.in, @Ceres_DIR@ will be replaced with the current
1135 # value of Ceres_DIR being used by Foo. This should be passed as a hint
1136 # when invoking find_package(Ceres) to ensure that the same install of
1137 # Ceres is used as was used to build Foo.
1138 set(CERES_DIR_HINTS @Ceres_DIR@)
1139
1140 # Forward the QUIET / REQUIRED options.
1141 if (Foo_FIND_QUIETLY)
1142 find_package(Ceres QUIET HINTS ${CERES_DIR_HINTS})
1143 elseif (Foo_FIND_REQUIRED)
1144 find_package(Ceres REQUIRED HINTS ${CERES_DIR_HINTS})
1145 else ()
1146 find_package(Ceres HINTS ${CERES_DIR_HINTS})
1147 endif()
1148
1149.. code-block:: cmake
1150
1151 # Importing Ceres in FooConfig.cmake using CMake 3.x style.
1152 #
1153 # In CMake v3.x, the find_dependency() macro exists to forward the REQUIRED
1154 # / QUIET parameters to find_package() when searching for dependencies.
1155 #
1156 # Note that find_dependency() does not take a path hint, so if Ceres was
1157 # installed in a non-standard location, that location must be added to
1158 # CMake's search list before this call.
1159 include(CMakeFindDependencyMacro)
1160 find_dependency(Ceres)