master: Change eigen_prefix -> include_eigen=true.
test_one.sh.in: use pkg-config for adolc and eigen.
pkgconfig_info.cmake: only output variable is ${name}_LIBRARIES.
Brad Bell
3 years ago
95 | 95 | ENDIF( cmake_install_postfix ) |
96 | 96 | IF( adolc_prefix ) |
97 | 97 | MESSAGE(FATAL_ERROR |
98 | "-D adolc_prefix=value has been changed to -D include_adolc=" | |
98 | "-D adolc_prefix=value has been changed to -D include_adolc=true" | |
99 | 99 | ) |
100 | 100 | ENDIF( adolc_prefix ) |
101 | IF( eigen_prefix ) | |
102 | MESSAGE(FATAL_ERROR | |
103 | "-D eigen_prefix=value has been changed to -D include_eigen=true" | |
104 | ) | |
105 | ENDIF( eigen_prefix ) | |
101 | 106 | # ----------------------------------------------------------------------------- |
102 | 107 | # cmake_install_datadir |
103 | 108 | command_line_arg(cmake_install_datadir share STRING |
151 | 156 | SET(cppad_has_adolc 1) |
152 | 157 | ELSE( include_adolc ) |
153 | 158 | SET(cppad_has_adolc 0) |
159 | SET(adolc_LIBRARIES "") | |
154 | 160 | ENDIF( include_adolc ) |
161 | # | |
162 | # eigen | |
163 | IF( include_eigen ) | |
164 | pkgconfig_info(eigen3 ${system_include}) | |
165 | SET(eigen_LIBRARIES "${eigen3_LIBRARIES}") | |
166 | SET(cppad_has_eigen 1) | |
167 | ELSE( include_eigen ) | |
168 | SET(cppad_has_eigen 0) | |
169 | ENDIF( include_eigen ) | |
155 | 170 | # |
156 | 171 | # colpack_prefix |
157 | 172 | optional_package(colpack ${system_include} "colpack install prefix") |
161 | 176 | # |
162 | 177 | # sacado_prefix |
163 | 178 | optional_package(sacado ${system_include} "sacado install prefix") |
164 | # | |
165 | # eigen_prefix | |
166 | optional_package(eigen ${system_include} "eigen install prefix") | |
167 | 179 | # |
168 | 180 | # fadbad_prefix |
169 | 181 | optional_package(fadbad ${system_include} "fadbad install prefix") |
16 | 16 | # ' |
17 | 17 | # list of files and or directories that are moved to new names |
18 | 18 | # move_paths=' |
19 | # cmake/check_source_runs.cmake | |
20 | 19 | # ' |
21 | 20 | # list of sed commands that map old file and directory names to new names. |
22 | 21 | # The characters @s, @d, @n get converted to a space, dollar sign, new line. |
25 | 24 | # ' |
26 | 25 | # list of files that get edited by the extra_seds command |
27 | 26 | # extra_files=' |
27 | # omh/appendix/whats_new/20.omh | |
28 | 28 | # ' |
29 | 29 | # list of sed commands that are applied to the extra files, |
30 | 30 | # after the other sed commands in this file. |
31 | 31 | # The characters @s, @d, @n get converted to a space, dollar sign, new line. |
32 | 32 | # extra_seds=' |
33 | # s|@dspell|&@n@s@s@s@seigen| | |
33 | 34 | # ' |
34 | 35 | # ---------------------------------------------------------------------------- |
35 | 36 | # Put other sed commands below here and without # at start of line |
36 | s|check_source_runs|run_source_test|g | |
37 | s|$cref/eigen/eigen_prefix/\$|$cref eigen$|g | |
38 | s|/eigen_prefix/|/eigen/|g | |
39 | s|prefix_list="$prefix_list eigen"|include_list="$include_list eigen"| | |
40 |
22 | 22 | # |
23 | 23 | # $head Purpose$$ |
24 | 24 | # If you are using Unix, this command will download and install |
25 | # $cref/Eigen/eigen_prefix/Eigen Home Page/$$ | |
25 | # $cref/Eigen/eigen/Eigen Home Page/$$ | |
26 | 26 | # in the CppAD $code build$$ directory. |
27 | 27 | # |
28 | 28 | # $head Distribution Directory$$ |
31 | 31 | echo "prefix=$prefix" |
32 | 32 | # |
33 | 33 | # PKG_CONFIG_PATH |
34 | export PKG_CONFIG_PATH="$prefix/lib64/pkgconfig:$prefix/lib/pkgconfig" | |
34 | PKG_CONFIG_PATH="$prefix/lib64/pkgconfig:$prefix/lib/pkgconfig" | |
35 | PKG_CONFIG_PATH="$prefix/share/pkgconfig:$PKG_CONFIG_PATH" | |
35 | 36 | # ----------------------------------------------------------------------------- |
36 | 37 | addr_t_size_t='no' |
37 | 38 | verbose='no' |
293 | 294 | echo "Cannot find $prefix/include/Eigen" |
294 | 295 | exit 1 |
295 | 296 | fi |
296 | prefix_list="$prefix_list eigen" | |
297 | include_list="$include_list eigen" | |
297 | 298 | fi |
298 | 299 | if [ "$yes_ipopt" == 'yes' ] |
299 | 300 | then |
96 | 96 | original_dir=`pwd` |
97 | 97 | # --------------------------------------------------------------------------- |
98 | 98 | cwd=$(pwd) |
99 | export PKG_CONFIG_PATH="$cwd/build/prefix/lib64/pkgconfig" | |
99 | PKG_CONFIG_PATH="$cwd/build/prefix/lib64/pkgconfig" | |
100 | PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$cwd/build/prefix/share/pkgconfig" | |
100 | 101 | # --------------------------------------------------------------------------- |
101 | 102 | # initialize |
102 | 103 | LD_LIBRARY_PATH='' |
103 | include_flags="-I $original_dir/include" | |
104 | library_flags="-lpthread" | |
104 | include_flags='' | |
105 | library_flags='' | |
105 | 106 | # |
106 | 107 | # adolc |
107 | 108 | if [ @cppad_has_adolc@ == 1 ] |
108 | 109 | then |
109 | 110 | include_flags="$include_flags $(pkg-config adolc --cflags)" |
110 | 111 | library_falgs="library_flags $(pkg-config adolc --libs)" |
112 | fi | |
113 | if [ @cppad_has_eigen@ == 1 ] | |
114 | then | |
115 | include_flags="$include_flags $(pkg-config eigen3 --cflags)" | |
116 | library_falgs="library_flags $(pkg-config eigen3 --libs)" | |
111 | 117 | fi |
112 | 118 | # |
113 | 119 | if [ @cppad_has_boost@ == 1 ] |
137 | 143 | set_libdir @ipopt_prefix@ coinmumps |
138 | 144 | fi |
139 | 145 | # |
140 | # eigen | |
141 | if [ @cppad_has_eigen@ == 1 ] | |
142 | then | |
143 | include_flags="$include_flags -isystem @eigen_prefix@/include" | |
144 | fi | |
145 | # | |
146 | # cppad_lib | |
146 | # cppad | |
147 | include_flags=$(echo $include_flags | \ | |
148 | sed -e 's| -I| -isystem|g' -e 's|^-I|-isystem|' | |
149 | ) | |
150 | include_flags="-I $original_dir/include $include_flags" | |
147 | 151 | cppad_lib_path="@PROJECT_BINARY_DIR@/cppad_lib/libcppad_lib.so" |
148 | library_flags="$library_flags $cppad_lib_path" | |
152 | library_flags="$library_flags $cppad_lib_pagh -lpthread" | |
149 | 153 | # |
150 | 154 | cd build |
151 | 155 | if ! make cppad_lib |
0 | # ---------------------------------------------------------------------------- | |
0 | # ----------------------------------------------------------------------------- | |
1 | # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
2 | # | |
3 | # CppAD is distributed under the terms of the | |
4 | # Eclipse Public License Version 2.0. | |
5 | # | |
6 | # This Source Code may also be made available under the following | |
7 | # Secondary License when the conditions for such availability set forth | |
8 | # in the Eclipse Public License, Version 2.0 are satisfied: | |
9 | # GNU General Public License, Version 2.0 or later. | |
10 | # ----------------------------------------------------------------------------- | |
1 | 11 | # pkgconfig_info(name system) |
2 | 12 | # |
3 | 13 | # Inputs: |
4 | # name: is the name of the package config file without the .pc extension | |
5 | # system: if true (false) include directory will (will not) be | |
6 | # treated like a system directory; i.e., no warnings. | |
14 | # name: is the name of the package config file without the .pc extension | |
15 | # system: if true (false) include directory will (will not) be | |
16 | # treated like a system directory; i.e., no warnings. | |
7 | 17 | # |
8 | 18 | # Outputs: |
9 | 19 | # ${name}_LIBRARIES: list of libraries necessary to use this package. |
10 | # ${name}_LIBRARY_DIRS: directories containing library files for this package. | |
11 | # ${name}_INCLUDE_DIRS: directories containing include files for this package. | |
12 | 20 | # |
13 | 21 | # Side Effects: |
14 | # The include directors are passed to INCLUDE_DIRECTORIES. | |
15 | # The link directories are passed to LINK_DIRECTORIES, | |
16 | # and the SYSTEM flag is inclued if system is TRUE. | |
22 | # Include directors required to use package are passed to INCLUDE_DIRECTORIES. | |
23 | # Link directories requried to link ${name}_LIBRARIES are passed to | |
24 | # LINK_DIRECTORIES, and the SYSTEM flag is inclued if system is TRUE. | |
17 | 25 | # |
18 | 26 | # Assumptions: |
19 | 27 | # FIND_PACKAGE(PkgConfig) was successful |
31 | 39 | ENDIF( ${name}_FOUND ) |
32 | 40 | # |
33 | 41 | # INLCUDE_DIRECTORIES |
34 | IF( system ) | |
42 | IF( ${system} ) | |
35 | 43 | INCLUDE_DIRECTORIES( SYSTEM ${${name}_INCLUDE_DIRS} ) |
36 | ELSE( system ) | |
44 | ELSE( ${system} ) | |
37 | 45 | INCLUDE_DIRECTORIES( ${${name}_INCLUDE_DIRS} ) |
38 | ENDIF( system ) | |
46 | ENDIF( ${system} ) | |
39 | 47 | # |
40 | 48 | # LINK_DIRECTORIES |
41 | 49 | LINK_DIRECTORIES( ${${name}_LIBRARY_DIRS} ) |
0 | 0 | # ----------------------------------------------------------------------------- |
1 | # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell | |
1 | # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
2 | 2 | # |
3 | 3 | # CppAD is distributed under the terms of the |
4 | 4 | # Eclipse Public License Version 2.0. |
10 | 10 | # ----------------------------------------------------------------------------- |
11 | 11 | # Build the example/general directory tests |
12 | 12 | # |
13 | # adolc_sources, adolc_libs | |
13 | # adolc_sources | |
14 | 14 | IF( cppad_has_adolc ) |
15 | 15 | SET(adolc_sources mul_level_adolc.cpp mul_level_adolc_ode.cpp) |
16 | SET(adolc_libs adolc) | |
17 | 16 | ELSE( cppad_has_adolc ) |
18 | 17 | SET(adolc_sources "") |
19 | SET(adolc_libs "") | |
20 | 18 | ENDIF( cppad_has_adolc ) |
21 | 19 | # |
22 | 20 | # eigen_sources |
147 | 145 | # |
148 | 146 | # List of libraries to be linked into the specified target |
149 | 147 | TARGET_LINK_LIBRARIES(example_general |
150 | ${adolc_libs} | |
148 | ${adolc_LIBRARIES} | |
151 | 149 | ) |
152 | 150 | # |
153 | 151 | # Add the check_example_general target |
70 | 70 | ENDIF( cppad_boostvector ) |
71 | 71 | # |
72 | 72 | IF( cppad_eigenvector ) |
73 | IF( NOT eigen_prefix ) | |
73 | IF( NOT include_eigen ) | |
74 | 74 | MESSAGE(FATAL_ERROR |
75 | 75 | "cppad_testvector == eigen but eigen_prefix is not specified" |
76 | 76 | ) |
77 | ENDIF( NOT eigen_prefix ) | |
77 | ENDIF( NOT include_eigen ) | |
78 | 78 | ENDIF( cppad_eigenvector ) |
79 | 79 | # ============================================================================= |
80 | 80 | # Begin C++11 features |
0 | 0 | # ifndef CPPAD_CONFIGURE_HPP |
1 | 1 | # define CPPAD_CONFIGURE_HPP |
2 | 2 | /* -------------------------------------------------------------------------- |
3 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell | |
3 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
4 | 4 | |
5 | 5 | CppAD is distributed under the terms of the |
6 | 6 | Eclipse Public License Version 2.0. |
89 | 89 | /* %$$ |
90 | 90 | |
91 | 91 | $head CPPAD_HAS_ADOLC$$ |
92 | Was a adolc_prefix specified on the cmake command line. | |
92 | Was a include_adolc=true specified on the cmake command line. | |
93 | 93 | $srccode%hpp% */ |
94 | 94 | # define CPPAD_HAS_ADOLC @cppad_has_adolc@ |
95 | 95 | /* %$$ |
101 | 101 | /* %$$ |
102 | 102 | |
103 | 103 | $head CPPAD_HAS_EIGEN$$ |
104 | Was a eigen_prefix specified on the cmake command line. | |
104 | Was a include_eigen=true specified on the cmake command line. | |
105 | 105 | $srccode%hpp% */ |
106 | 106 | # define CPPAD_HAS_EIGEN @cppad_has_eigen@ |
107 | 107 | /* %$$ |
0 | 0 | # ifndef CPPAD_EXAMPLE_CPPAD_EIGEN_HPP |
1 | 1 | # define CPPAD_EXAMPLE_CPPAD_EIGEN_HPP |
2 | 2 | /* -------------------------------------------------------------------------- |
3 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell | |
3 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
4 | 4 | |
5 | 5 | CppAD is distributed under the terms of the |
6 | 6 | Eclipse Public License Version 2.0. |
54 | 54 | %$$ |
55 | 55 | |
56 | 56 | $head Purpose$$ |
57 | Enables the use of the $cref/eigen/eigen_prefix/$$ | |
57 | Enables the use of the $cref eigen$$ | |
58 | 58 | linear algebra package with the type $icode%AD<%Base%>%$$; see |
59 | 59 | $href% |
60 | 60 | https://eigen.tuxfamily.org/dox/TopicCustomizing_CustomScalar.html% |
37 | 37 | 1%$$ |
38 | 38 | |
39 | 39 | $head Include$$ |
40 | If $cref eigen_prefix$$ is specified on the cmake command line, | |
40 | If $cref/include_eigen/cmake/include_eigen/$$ is specified on the cmake command line, | |
41 | 41 | the file $code cppad/utility/sparse2eigen.hpp$$ |
42 | 42 | is included by $code cppad/cppad.hpp$$. |
43 | 43 | In any case, |
0 | 0 | # ifndef CPPAD_UTILITY_SPARSE_RCV_HPP |
1 | 1 | # define CPPAD_UTILITY_SPARSE_RCV_HPP |
2 | 2 | /* -------------------------------------------------------------------------- |
3 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell | |
3 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
4 | 4 | |
5 | 5 | CppAD is distributed under the terms of the |
6 | 6 | Eclipse Public License Version 2.0. |
197 | 197 | row and column values (if $code NDEBUG$$ is not defined). |
198 | 198 | |
199 | 199 | $head Eigen Matrix$$ |
200 | If you have the $cref/eigen package/eigen_prefix/$$ in your include path, | |
200 | If you have the $cref/eigen package/eigen/$$ in your include path, | |
201 | 201 | you can use $cref sparse2eigen$$ to convert a sparse matrix to eigen format. |
202 | 202 | |
203 | 203 | $children% |
0 | 0 | /* -------------------------------------------------------------------------- |
1 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell | |
1 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
2 | 2 | |
3 | 3 | CppAD is distributed under the terms of the |
4 | 4 | Eclipse Public License Version 2.0. |
195 | 195 | $lnext |
196 | 196 | The command for running the |
197 | 197 | $cref/adolc examples/adolc/Examples/$$ and |
198 | $cref/eigen examples/eigen_prefix/Examples/$$ | |
198 | $cref/eigen examples/eigen/Examples/$$ | |
199 | 199 | was fixed |
200 | 200 | (changed from $code make check$$ to $code make check_example$$). |
201 | 201 | $lend |
83 | 83 | The constructor from an arbitrary type to $codei%AD<%Base%>%$$ was |
84 | 84 | implicit, but there was no specification to this effect. |
85 | 85 | The caused problems when using CppAD with |
86 | $cref/eigen 3.2/eigen_prefix/$$ (scheduled to be fixed in 3.3). | |
86 | $cref/eigen 3.2/eigen/$$ (scheduled to be fixed in 3.3). | |
87 | 87 | The default for this constructor has been changed to be |
88 | 88 | $cref/explicit/ad_ctor/x/explicit/$$. |
89 | 89 | In addition, other |
486 | 486 | $code cppad_test_vector_namespace$$ was fixed to be |
487 | 487 | $cref/cppad_testvector/cmake/cppad_testvector/$$. |
488 | 488 | This was also fixed for the |
489 | $cref/eigen test vector/eigen_prefix/Test Vector/$$ documentation. | |
489 | $cref/eigen test vector/eigen/Test Vector/$$ documentation. | |
490 | 490 | $lnext |
491 | 491 | An option to specify that the compiler supports c++11 constructs, |
492 | 492 | $code cppad_c11_flag$$, was added |
0 | 0 | /* -------------------------------------------------------------------------- |
1 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell | |
1 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
2 | 2 | |
3 | 3 | CppAD is distributed under the terms of the |
4 | 4 | Eclipse Public License Version 2.0. |
285 | 285 | $head 03-24$$ |
286 | 286 | $list number$$ |
287 | 287 | Fix build of $code example/atomic.cpp$$ when |
288 | $cref eigen_prefix$$ is not available | |
288 | $cref eigen$$ is not available | |
289 | 289 | (bug introduced when $cref atomic_two_eigen_mat_mul.cpp$$ was added). |
290 | 290 | $lnext |
291 | 291 | Extend $cref atomic_two_eigen_mat_mul.cpp$$ example to include |
389 | 389 | This avoids an incompatibility between sacado and newer versions of eigen, |
390 | 390 | when eigen is used for the $cref testvector$$. |
391 | 391 | $lnext |
392 | The $cref/eigen/eigen_prefix/$$ package changed its requirements for | |
392 | The $cref eigen$$ package changed its requirements for | |
393 | 393 | defining Scalar types |
394 | 394 | (some where between eigen-3.2.9 and eigen-3.3.3). |
395 | 395 | The member variable |
11 | 11 | |
12 | 12 | $begin whats_new_20$$ |
13 | 13 | $spell |
14 | eigen | |
14 | 15 | CppAD |
15 | 16 | vec |
16 | 17 | ind |
114 | 115 | If $cref ipopt_prefix$$ is specified on the cmake command line, |
115 | 116 | $cref ipopt_solve$$ is automatically included by $code cppad/cppad.hpp$$. |
116 | 117 | The $cref sparse2eigen$$ utility can still be used even |
117 | if $cref eigen_prefix$$ is not specified on the cmake command line. | |
118 | if $cref/include_eigen/cmake/include_eigen/$$ is not specified on the cmake command line. | |
118 | 119 | |
119 | 120 | |
120 | 121 | $head 05-26$$ |
51 | 51 | $codei% |
52 | 52 | pkg-config adolc --path --print-errors |
53 | 53 | %$$ |
54 | find the location of the file $code adolc.pc$$. | |
54 | finds the location of the file $code adolc.pc$$. | |
55 | 55 | Note that CppAD assumes adolc has been configured with |
56 | 56 | its sparse matrix computations enabled; i.e, using |
57 | 57 | $codei% |
62 | 62 | $cref get_colpack.sh$$. |
63 | 63 | |
64 | 64 | $head Examples$$ |
65 | If you include $icode adolc_prefix$$ on the $cref cmake$$ command line, | |
66 | you will be able to run the Adolc examples listed above | |
65 | If you specify $cref/include_adolc/cmake/include_adolc/$$ on the cmake command | |
66 | line, you will be able to run the Adolc examples listed above | |
67 | 67 | by executing the following commands starting in the |
68 | 68 | $cref/distribution directory/download/Distribution Directory/$$: |
69 | 69 | $codei% |
141 | 141 | -D cmake_install_docdir=%cmake_install_docdir% \ |
142 | 142 | \ |
143 | 143 | -D include_adolc=true \ |
144 | -D include_eigen=true \ | |
144 | 145 | \ |
145 | 146 | -D colpack_prefix=%colpack_prefix% \ |
146 | -D eigen_prefix=%eigen_prefix% \ | |
147 | 147 | -D fadbad_prefix=%fadbad_prefix% \ |
148 | 148 | -D cppadcg_prefix=%cppadcg_prefix% |
149 | 149 | -D ipopt_prefix=%ipopt_prefix% \ |
370 | 370 | The $cref adolc$$ examples |
371 | 371 | will be compiled and tested if $icode include_adolc$$ is true. |
372 | 372 | |
373 | $head include_eigen$$ | |
374 | The $cref eigen$$ examples | |
375 | will be compiled and tested if $icode include_eigen$$ is true. | |
376 | ||
373 | 377 | $head package_prefix$$ |
374 | 378 | Each of these packages corresponds to optional CppAD examples, |
375 | 379 | that can be compiled and tested if the corresponding prefix is provided: |
376 | 380 | $table |
377 | 381 | $rref colpack_prefix$$ |
378 | $rref eigen_prefix$$ | |
379 | 382 | $rref fadbad_prefix$$ |
380 | 383 | $rref cppadcg_prefix$$ |
381 | 384 | $rref ipopt_prefix$$ |
426 | 429 | |
427 | 430 | $subhead Eigen and Fadbad$$ |
428 | 431 | The packages |
429 | $cref/eigen/eigen_prefix/$$ and $cref/fadbad/fadbad_prefix/$$ | |
432 | $cref eigen$$ and $cref/fadbad/fadbad_prefix/$$ | |
430 | 433 | currently generate a lot of shadowed variable warnings. |
431 | 434 | |
432 | 435 | $head cppad_testvector$$ |
514 | 517 | bin/get_optional.sh% |
515 | 518 | omh/install/adolc.omh% |
516 | 519 | omh/install/colpack_prefix.omh% |
517 | omh/install/eigen_prefix.omh% | |
520 | omh/install/eigen.omh% | |
518 | 521 | omh/install/fadbad_prefix.omh% |
519 | 522 | omh/install/cppadcg_prefix.omh% |
520 | 523 | omh/install/ipopt_prefix.omh% |
0 | /* -------------------------------------------------------------------------- | |
1 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
2 | ||
3 | CppAD is distributed under the terms of the | |
4 | Eclipse Public License Version 2.0. | |
5 | ||
6 | This Source Code may also be made available under the following | |
7 | Secondary License when the conditions for such availability set forth | |
8 | in the Eclipse Public License, Version 2.0 are satisfied: | |
9 | GNU General Public License, Version 2.0 or later. | |
10 | -------------------------------------------------------------------------- */ | |
11 | $begin eigen$$ | |
12 | $dollar @$$ | |
13 | $spell | |
14 | testvector | |
15 | dir | |
16 | namespace | |
17 | Eigen | |
18 | Cpp | |
19 | includedirs | |
20 | cmake | |
21 | det | |
22 | cppad | |
23 | config | |
24 | $$ | |
25 | ||
26 | $section Including Eigen Examples, Tests, and sparse2eigen$$ | |
27 | ||
28 | $head Eigen Home Page$$ | |
29 | $href%http://eigen.tuxfamily.org%$$ | |
30 | ||
31 | $head Examples and Tests$$ | |
32 | CppAD can include the following examples and tests that | |
33 | use the linear algebra package Eigen: | |
34 | $comment check list with: grep 'eigen.*\.cpp' omh/example_list.omh'$$ | |
35 | $table | |
36 | $rref cppad_eigen.hpp$$ | |
37 | $rref eigen_array.cpp$$ | |
38 | $rref eigen_det.cpp$$ | |
39 | $rref sparse2eigen.cpp$$ | |
40 | $rref atomic_two_eigen_cholesky.hpp$$ | |
41 | $rref atomic_two_eigen_mat_inv.hpp$$ | |
42 | $rref atomic_two_eigen_mat_mul.hpp$$ | |
43 | $tend | |
44 | ||
45 | $head sparse2eigen$$ | |
46 | The $cref sparse2eigen$$ utility will only be available if | |
47 | $cref/include_eigen/cmake/include_eigen/$$ | |
48 | is specified on the cmake command line. | |
49 | ||
50 | $head include_eigen$$ | |
51 | If Eigen is installed on your system, you can | |
52 | specify $icode include_eigen=true$$ on the | |
53 | $cref cmake$$ command line. | |
54 | The value of $icode PKG_CONFIG_PATH$$ must be such that the command | |
55 | $codei% | |
56 | pkg-config eigen3 --path --print-errors | |
57 | %$$ | |
58 | finds the location of the file $code eigen3.pc$$. | |
59 | ||
60 | $head Examples$$ | |
61 | If you specify $icode/include_eigen/cmake/include_eigen/$$ | |
62 | on the cmake command line, | |
63 | you will be able to run the Eigen examples list above | |
64 | by executing the following commands starting in the | |
65 | $cref/distribution directory/download/Distribution Directory/$$: | |
66 | $codei% | |
67 | cd build/example | |
68 | make check_example | |
69 | %$$ | |
70 | If you do this, | |
71 | you will see an indication that the examples | |
72 | $code eigen_array$$ and $code eigen_det$$ | |
73 | have passed their correctness check. | |
74 | ||
75 | $head Test Vector$$ | |
76 | If you have specified $icode eigen_prefix$$ you can choose | |
77 | $codei% | |
78 | -D cppad_testvector=eigen | |
79 | %$$ | |
80 | on the $cref/cmake command/cmake/CMake Command/$$ line. | |
81 | This we set the CppAD $cref testvector$$ to use Eigen vectors. | |
82 | ||
83 | $head get_eigen$$ | |
84 | If you are using Unix, you can download and install | |
85 | a copy of Eigen using $cref get_eigen.sh$$. | |
86 | The corresponding $icode eigen_prefix$$ would be | |
87 | $code build/prefix$$. | |
88 | ||
89 | ||
90 | $end |
0 | /* -------------------------------------------------------------------------- | |
1 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
2 | ||
3 | CppAD is distributed under the terms of the | |
4 | Eclipse Public License Version 2.0. | |
5 | ||
6 | This Source Code may also be made available under the following | |
7 | Secondary License when the conditions for such availability set forth | |
8 | in the Eclipse Public License, Version 2.0 are satisfied: | |
9 | GNU General Public License, Version 2.0 or later. | |
10 | -------------------------------------------------------------------------- */ | |
11 | $begin eigen_prefix$$ | |
12 | $dollar @$$ | |
13 | $spell | |
14 | testvector | |
15 | dir | |
16 | namespace | |
17 | Eigen | |
18 | Cpp | |
19 | includedirs | |
20 | cmake | |
21 | det | |
22 | cppad | |
23 | $$ | |
24 | ||
25 | $section Including Eigen Examples, Tests, and sparse2eigen$$ | |
26 | ||
27 | $head Eigen Home Page$$ | |
28 | $href%http://eigen.tuxfamily.org%$$ | |
29 | ||
30 | $head Examples and Tests$$ | |
31 | CppAD can include the following examples and tests that | |
32 | use the linear algebra package Eigen: | |
33 | $comment check list with: grep 'eigen.*\.cpp' omh/example_list.omh'$$ | |
34 | $table | |
35 | $rref cppad_eigen.hpp$$ | |
36 | $rref eigen_array.cpp$$ | |
37 | $rref eigen_det.cpp$$ | |
38 | $rref sparse2eigen.cpp$$ | |
39 | $rref atomic_two_eigen_cholesky.hpp$$ | |
40 | $rref atomic_two_eigen_mat_inv.hpp$$ | |
41 | $rref atomic_two_eigen_mat_mul.hpp$$ | |
42 | $tend | |
43 | ||
44 | $head sparse2eigen$$ | |
45 | The $cref sparse2eigen$$ utility will not be available if $icode eigen_prefix$$ | |
46 | is not specified on the $cref cmake$$ command line. | |
47 | ||
48 | $head eigen_prefix$$ | |
49 | If Eigen is installed on your system, you can | |
50 | specify a value for its install $icode eigen_prefix$$ on the | |
51 | $cref cmake$$ command line. | |
52 | The value of $icode eigen_prefix$$ must be such that, | |
53 | for one of the directories $icode dir$$ in | |
54 | $cref/cmake_install_includedirs/cmake/cmake_install_includedirs/$$, | |
55 | $codei% | |
56 | %eigen_prefix%/%dir%/Eigen/Core | |
57 | %$$ | |
58 | is a valid way to reference to the include file $code Core$$; | |
59 | ||
60 | $head Examples$$ | |
61 | If you include $icode eigen_prefix$$ on the $cref cmake$$ command line, | |
62 | you will be able to run the Eigen examples list above | |
63 | by executing the following commands starting in the | |
64 | $cref/distribution directory/download/Distribution Directory/$$: | |
65 | $codei% | |
66 | cd build/example | |
67 | make check_example | |
68 | %$$ | |
69 | If you do this, | |
70 | you will see an indication that the examples | |
71 | $code eigen_array$$ and $code eigen_det$$ | |
72 | have passed their correctness check. | |
73 | ||
74 | $head Test Vector$$ | |
75 | If you have specified $icode eigen_prefix$$ you can choose | |
76 | $codei% | |
77 | -D cppad_testvector=eigen | |
78 | %$$ | |
79 | on the $cref/cmake command/cmake/CMake Command/$$ line. | |
80 | This we set the CppAD $cref testvector$$ to use Eigen vectors. | |
81 | ||
82 | $head get_eigen$$ | |
83 | If you are using Unix, you can download and install | |
84 | a copy of Eigen using $cref get_eigen.sh$$. | |
85 | The corresponding $icode eigen_prefix$$ would be | |
86 | $code build/prefix$$. | |
87 | ||
88 | ||
89 | $end |
0 | 0 | /* -------------------------------------------------------------------------- |
1 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell | |
1 | CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
2 | 2 | |
3 | 3 | CppAD is distributed under the terms of the |
4 | 4 | Eclipse Public License Version 2.0. |
65 | 65 | one of the eigen template classes is used to define |
66 | 66 | $code CPPAD_TESTVECTOR$$. |
67 | 67 | In this case, |
68 | $cref eigen_prefix$$ must be specified on the $code cmake$$ command line. | |
68 | $cref/include_eigen/cmake/include_eigen/$$ must be specified on the $code cmake$$ command line. | |
69 | 69 | |
70 | 70 | |
71 | 71 | $end |
0 | 0 | # ----------------------------------------------------------------------------- |
1 | # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell | |
1 | # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
2 | 2 | # |
3 | 3 | # CppAD is distributed under the terms of the |
4 | 4 | # Eclipse Public License Version 2.0. |
41 | 41 | # cppad_pkgconfig_cflags |
42 | 42 | # cppad_pkgconfig_cflags_uninstalled |
43 | 43 | # |
44 | SET(cppad_pkgconfig_cflags "-I${cppad_abs_includedir}" ) | |
45 | SET(cppad_pkgconfig_cflags_uninstalled "-I${cppad_SOURCE_DIR}" ) | |
44 | SET(cppad_pkgconfig_cflags "-I${cppad_abs_includedir}" ) | |
45 | SET(cppad_pkgconfig_cflags_uninstalled "-I${cppad_SOURCE_DIR}/include" ) | |
46 | 46 | # ---------------------------------------------------------------------------- |
47 | 47 | # cppad_pkgconfig_libs |
48 | 48 | # cppad_pkgconfig_libs_uninstalled |
0 | 0 | # ----------------------------------------------------------------------------- |
1 | # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell | |
1 | # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell | |
2 | 2 | # |
3 | 3 | # CppAD is distributed under the terms of the |
4 | 4 | # Eclipse Public License Version 2.0. |
10 | 10 | # ----------------------------------------------------------------------------- |
11 | 11 | # Build the test_more/general tests |
12 | 12 | # |
13 | # adolc_sources, adolc_libs | |
13 | # adolc_sources | |
14 | 14 | IF( cppad_has_adolc ) |
15 | 15 | SET(adolc_sources base_adolc.cpp) |
16 | SET(adolc_libs adolc) | |
17 | 16 | ELSE( cppad_has_adolc ) |
18 | 17 | SET(adolc_sources "") |
19 | SET(adolc_libs "") | |
20 | 18 | ENDIF( cppad_has_adolc ) |
21 | 19 | # |
22 | 20 | # eigen_sources |
159 | 157 | # List of libraries to be linked into the specified target |
160 | 158 | TARGET_LINK_LIBRARIES(test_more_general |
161 | 159 | ${cppad_lib} |
162 | ${adolc_libs} | |
160 | ${adolc_LIBRARIES} | |
163 | 161 | ${ipopt_libs} |
164 | 162 | ${colpack_libs} |
165 | 163 | ) |