source: trunk/omh/install/cmake.omh @ 3938

Last change on this file since 3938 was 3938, checked in by bradbell, 2 years ago

merge to branch: trunk
from repository:
start hash code: 78ba7f801a6fec0dbdaa887c01ea58a9ccb59817
end hash code: bd9a72f2ccec67a9773cd2ecd536df8fe09860da

commit bd9a72f2ccec67a9773cd2ecd536df8fe09860da
Author: Brad Bell <bradbell@…>
Date: Mon May 22 06:14:34 2017 -0700

  1. Add the cppad_extra_debug option to cmake command.
  2. Advance to cppad-20170522.

commit 8f832650db029dd1df2f302b3e6a7f39cb83078f
Author: Brad Bell <bradbell@…>
Date: Sun May 21 07:16:35 2017 -0700

CMakeLists.txt: change type of cppad_deprecated to BOOL (must be NO). fix comment about CPPAD_DEPRECATED.
ad_ctor.hpp: remove comment about old use of cppad_deprecated.
cmake.omh: remove description of old deprecated case.

commit 9a0a0705f7c44e5a93c136c3bd1e56ab39bb809f
Author: Brad Bell <bradbell@…>
Date: Sun May 21 06:34:38 2017 -0700

Add test that fails when release.cpp is compiled for release.
CMakeLists.txt: improve command line argument comments.

commit bfbc481d68256d71217a1d9a439bc2b2e07f90c2
Author: Brad Bell <bradbell@…>
Date: Sun May 21 04:15:26 2017 -0700

Advance to cppad-20170521. simplify.

commit 163044ceea186505229e59770b263fe00b12726d
Author: Brad Bell <bradbell@…>
Date: Sat May 20 09:07:15 2017 -0700

Create test_more/debug_rel (Under construction).

commit 9d90a176a0fc75faff28c0cb2034218d8a3b2f6a
Author: Brad Bell <bradbell@…>
Date: Sat May 20 07:04:52 2017 -0700 add link to new directory structure page.

  • Property svn:keywords set to Id
File size: 12.5 KB
1/* --------------------------------------------------------------------------
2CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
4CppAD is distributed under multiple licenses. This distribution is under
5the terms of the
6                    Eclipse Public License Version 1.0.
8A copy of this license is included in the COPYING file of this distribution.
9Please visit for information on other licenses.
10-------------------------------------------------------------------------- */
12$begin cmake$$
13$escape $$
15        cstdint
16        uint
17        pkgconfig
18        ctor
19        op
20        arg
21        sizeof
22        testvector
23        std
24        Wshadow
25        namespace
26        adouble
27        colpack
28        dir
29        makefile
30        usr
31        hpp
32        xml
33        ipopt
34        libcppad
35        CppAD
36        txt
37        Microsoft
38        Makefiles
39        cmake
40        Dcmake
41        cppad
42        adolc
43        boost
44        eigen
45        fadbad
46        sacado
47        datadir
48        docdir
49        includedirs
50        libdirs
51        cxx
52        max num
53        postfix
54        id
55        addr
56        grep
59$section Using CMake to Configure CppAD$$
60$mindex makefile install prefix postfix include directories lib datadir documentation package compile flags profile maximum number threads sparsity internal structure vector sets memory usage tape ctor implicit explicit$$
63$head The CMake Program$$
66program enables one to create a single set of scripts,
67called $code CMakeLists.txt$$,
68that can be used to test and install a program on Unix, Microsoft, or
69Apple operating systems.
70For example, one can use it to automatically generate Microsoft project files.
72$head CMake Command$$
73The command below assumes that $code cmake$$ is in your execution
74path with version greater than or equal 2.8.
75If not, you can put the path to the version of $code cmake$$
76in font the command.
77Only the $code cmake$$ command and the path to the distribution directory
78($code ..$$ at the end of the command below) are required.
79In other words, the first and last lines below are required
80and all of the other lines are optional.
82$subhead Build Directory$$
83Create a $code build$$ subdirectory of the
84$cref/distribution directory/download/Distribution Directory/$$,
85change into the $code build$$  directory,
86and execute the following command:
88cmake %%                                                                     \
89    -D CMAKE_VERBOSE_MAKEFILE=%cmake_verbose_makefile%                       \
90    -G %generator%                                                           \
91        \
92    -D cppad_prefix=%cppad_prefix%                                           \
93    -D cppad_postfix=%cppad_postfix%                                         \
94        \
95    -D cmake_install_includedirs=%cmake_install_includedirs%                 \
96    -D cmake_install_libdirs=%cmake_install_libdirs%                         \
97        \
98    -D cmake_install_datadir=%cmake_install_datadir%                         \
99    -D cmake_install_docdir=%cmake_install_docdir%                           \
100    \
101    -D adolc_prefix=%adolc_prefix%                                           \
102    -D colpack_prefix=%colpack_prefix%                                       \
103    -D eigen_prefix=%eigen_prefix%                                           \
104    -D fadbad_prefix=%fadbad_prefix%                                         \
105    -D ipopt_prefix=%ipopt_prefix%                                           \
106    -D sacado_prefix=%sacado_prefix%                                         \
107    \
108    -D cppad_cxx_flags=%cppad_cxx_flags%                                     \
109    -D cppad_profile_flag=%cppad_profile_flag%                               \
110    \
111    -D cppad_testvector=%cppad_testvector%                                   \
112    -D cppad_max_num_threads=%cppad_max_num_threads%                         \
113    -D cppad_tape_id_type=%cppad_tape_id_type%                               \
114    -D cppad_tape_addr_type=%cppad_tape_addr_type%                           \
115    -D cppad_extra_debug=%cppad_extra_debug% \
116    -D cppad_deprecated=%cppad_deprecated% \
117    \
118    ..
121$head make check$$
122Important information about the CppAD configuration is output
123by this command. If you have the $code grep$$ program,
124and store the output in $code cmake.log$$, you can get a list of
125all the test options with the command:
127        grep 'make check' cmake.log
130$head cmake_verbose_makefile$$
131This value should be either $code YES$$ or $code NO$$.
132The default value, when it is not present, is $code NO$$.
133If it is $code YES$$, then the output of the $code make$$ commands
134will include all of the files and flags used to run the compiler
135and linker. This can be useful for seeing how to compile and link
136your own applications.
138$head generator$$
139The CMake program is capable of generating different kinds of files.
140Below is a table with a few of the possible files
142$icode generator$$ $cnext Description $rnext
143$code "Unix Makefiles"$$   $cnext make files for unix operating system $rnext
144$code "NMake Makefiles"$$  $cnext make files for Visual Studio
146Other generator choices are available; see the cmake
148generators%$$ documentation.
150$head cppad_prefix$$
151This is the top level absolute path below which
152all of the CppAD files are installed by the command
154        make install
156For example,
157if $icode cppad_prefix$$ is $code /usr$$,
158$icode cmake_install_includedirs$$ is $code include$$, and
159$icode cppad_postfix$$ is not specified,
160the file $code cppad.hpp$$ is installed in the location
162        /usr/include/cppad/cppad.hpp
164The default value for $icode cppad_prefix$$ is $code /usr$$.
166$head cppad_postfix$$
167This is the bottom level relative path below which
168all of the CppAD files are installed.
169For example,
170if $icode cppad_prefix$$ is $code /usr$$,
171$icode cmake_install_includedirs$$ is $code include$$, and
172$icode cppad_postfix$$ is $code coin$$,
173the file $code cppad.hpp$$ is installed in the location
175        /usr/include/coin/cppad/cppad.hpp
177The default value for $icode cppad_postfix$$ is empty; i.e,
178there is no bottom level relative directory for the installed files.
181$head cmake_install_includedirs$$
182This is one directory, or a list of directories separated
183by spaces or by semi-colons.
184This first entry in the list is the middle level relative path below which
185the CppAD include files are installed.
186The entire list is used for searching for include files.
187For example,
188if $icode cppad_prefix$$ is $code /usr$$,
189$icode cmake_install_includedirs$$ is $code include$$, and
190$icode cppad_postfix$$ is not specified,
191the file $code cppad.hpp$$ is installed in the location
193        /usr/include/cppad/cppad.hpp
195The default value for this directory list is $code include$$.
198$head cmake_install_libdirs$$
199This is one directory, or a list of directories separated
200by spaces or by semi-colons.
201This first entry in the list is the middle level relative path below which
202the CppAD library files are installed.
203The entire list is used for searching for library files.
204For example,
205if $icode cppad_prefix$$ is $code /usr$$,
206$icode cmake_install_libdirs$$ is $code lib$$,
207$icode cppad_postfix$$ is not specified,
208and $icode ipopt_prefix$$ is specified,
209the file $code libcppad_ipopt.a$$ is installed in the location
211        /usr/lib/libcppad_ipopt.a
213The default value for this directory list is $code lib$$.
215$head cmake_install_datadir$$
216This is the middle level relative path below which
217the CppAD data files are installed.
218For example,
219if $icode cppad_prefix$$ is $code /usr$$,
220$icode cmake_install_datadir$$ is $code share$$, and
221$icode cppad_postfix$$ is not specified,
222the $cref pkgconfig$$ file $code cppad.pc$$ is installed in the location
224        /usr/share/pkgconfig/cppad.pc
226The default value for $icode cmake_install_datadir$$ is $code share$$.
228$head cmake_install_docdir$$
229This is the middle level relative path below which
230the CppAD documentation files are installed.
231For example,
232if $icode cppad_prefix$$ is $code /usr$$,
233$icode cmake_install_docdir$$ is $code share/doc$$, and
234$icode cppad_postfix$$ is not specified,
235the file $code cppad.xml$$ is installed in the location
237        /usr/share/doc/cppad/cppad.xml
239There is no default value for $icode cmake_install_docdir$$.
240If it is not specified, the documentation files are not installed.
242$head package_prefix$$
243Each of these packages corresponds to optional CppAD examples,
244that can be compiled and tested if the corresponding prefix is provided:
246$rref adolc_prefix$$
247$rref colpack_prefix$$
248$rref eigen_prefix$$
249$rref fadbad_prefix$$
250$rref ipopt_prefix$$
251$rref sacado_prefix$$
254$head cppad_cxx_flags$$
255This specifies the addition compiler flags,
256besides the debug and release flags,
257that are used when compiling the CppAD examples and tests.
258The default value for these flags is the empty string $code ""$$.
259These flags must be valid for the C++ compiler
260on your system.
261For example, if you are using $code g++$$ you could specify
263        -D cppad_cxx_flags="-Wall -ansi -pedantic-errors -std=c++11 -Wshadow"
265$subhead C++11$$
266In order for the compiler to take advantage of features that are new in C++11,
267the $icode cppad_cxx_flags$$ must enable these features.
268The compiler may still be used with a flag that disables the new features
269(unless it is a Microsoft compiler; i.e., $code _MSC_VER$$ is defined).
271$head cppad_profile_flag$$
272This specifies an addition compiler and link flag that is used
273for $cref/profiling/speed_main/package/profile/$$ the speed tests.
274A profile version of the speed test is only build when this argument
275is present.
277$subhead Eigen and Fadbad$$
278The packages
279$cref/eigen/eigen_prefix/$$ and $cref/fadbad/fadbad_prefix/$$
280currently generate a lot of shadowed variable warnings.
281If the $code -Wshadow$$ flag is present, it is automatically removed when
282compiling examples and test that use these packages.
284$head cppad_testvector$$
285See $tref cppad_testvector$$.
287$head cppad_max_num_threads$$
288The value $icode cppad_max_num_threads$$
289must be greater than or equal to four; i.e.,
290$icode%max_num_threads% >= 4%$$.
291The current default value for $icode cppad_max_num_threads$$ is 48,
292but it may change in future versions of CppAD.
293The value $icode cppad_max_num_threads$$ in turn specifies
294the default value for the preprocessor symbol
297$head cppad_tape_id_type$$
298The type $icode cppad_tape_id_type$$
299is used for identifying different tapes.
300The valid values for this type are
301$code unsigned char$$,
302$code unsigned short int$$,
303$code unsigned int$$, and
304$code size_t$$.
305The smaller the value of $codei%sizeof(%cppad_tape_id_type%)%$$,
306the less memory is used.
307On the other hand, the value
309        std::numeric_limits<%cppad_tape_id_type%>::max()
311must be larger than the maximum number of tapes used by one thread times
314$subhead cstdint$$
315If all of the following $code cstdint$$ types are defined,
316they can also be used as the value of $icode cppad_tape_addr_type$$:
317$code uint8_t$$,
318$code uint16_t$$,
319$code uint32_t$$,
320$code uint64_t$$.
322$head cppad_tape_addr_type$$
323The type $icode cppad_tape_addr_type$$
324is used for address in the AD recordings (tapes).
325The valid values for this argument are
326$code unsigned char$$,
327$code unsigned short int$$,
328$code unsigned int$$,
329$code size_t$$.
330The smaller the value of $codei%sizeof(%cppad_tape_addr_type%)%$$,
331the less memory is used.
332On the other hand, the value
334        std::numeric_limits<%cppad_tape_addr_type%>::max()
336must be larger than any of the following:
343$subhead cstdint$$
344If all of the following $code cstdint$$ types are defined,
345they can also be used as the value of $icode cppad_tape_addr_type$$:
346$code uint8_t$$,
347$code uint16_t$$,
348$code uint32_t$$,
349$code uint64_t$$.
351$head cppad_extra_debug$$
352If this is $code YES$$ and $code NDEBUG$$ is not defined,
353CppAD does extra debugging checks.
354This extra error checking makes CppAD debug and release object code
357$subhead Under Construction$$
358This option is currently under construction.
359To be specific, the debug and release object code are not yet compatible
360even if $icode cppad_extra_debug$$ is $code NO$$.
362$head cppad_deprecated$$
363The default value for $icode cppad_deprecated$$ is $code NO$$
364(the value $code YES$$ is not currently being used).
367        omh/install/adolc_prefix.omh%
368        omh/install/colpack_prefix.omh%
369        omh/install/eigen_prefix.omh%
370        omh/install/fadbad_prefix.omh%
371        omh/install/ipopt_prefix.omh%
372        omh/install/sacado_prefix.omh%
373        omh/install/testvector.omh
Note: See TracBrowser for help on using the repository browser.