source: trunk/configure.ac @ 3941

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

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: b7056a15a1028d7be587b70a3ecc44b1f42dc05e
end hash code: c8c4cc081accff3628e7e66370ec01e4c99afe8d

commit c8c4cc081accff3628e7e66370ec01e4c99afe8d
Author: Brad Bell <bradbell@…>
Date: Thu Jun 1 23:16:39 2017 -0600

Changes automatically generated by the autotools.

commit f4392bc3eee8f6d0ccd45a0bb3be51181e211680
Author: Brad Bell <bradbell@…>
Date: Thu Jun 1 23:11:56 2017 -0600

  1. Add colpack_jac.cpp example (rename colpack_jac.cpp->colpack_jacobian.cpp).
  2. Add colpack_hescpp example (rename colpack_hes.cpp->colpack_hessian.cpp).


test_one.sh.in: adapt to using test_boolofvoid for testing.
sparse_hes.hpp: fix bug in cppad.symmetric case.

commit 086b8a8709b0c9cb01ce2cf8bc7910e903105ff7
Author: Brad Bell <bradbell@…>
Date: Thu Jun 1 08:54:59 2017 -0600

  1. Fix bug in use of colpack (see kludge in comments).
  2. Fix colpack.symmetric (not general) and add colpack.general.
  3. Deprecate colpack.star.
  4. More autotools from install to deprecated.
  5. Advance to cppad-20170601.

commit 23f26c060648f5c6fc62a1598c659aeccc5ca46f
Author: Brad Bell <bradbell@…>
Date: Tue May 30 08:14:04 2017 -0700

Advance to cppad-20170530.

commit 97f8c08509865d1bfb7ec2e5cd557ddc979f8412
Author: Brad Bell <bradbell@…>
Date: Tue May 30 07:38:47 2017 -0700

debug_rel branch:
There is a problem with speed sparse_hessian debug that goes back to master.
Supresss debug in cppad speed tests until it is fixed.

commit 39ea0d7d9c041784ccd26ce80d19a7ab02752818
Author: Brad Bell <bradbell@…>
Date: Mon May 29 22:34:22 2017 -0700

debug_rel branch:
run_cmake.sh: fix debug_none case.
CMakeLists.txt: use cppad_debug_which to determine debug or release.
CMakeLists.txt: let set_compile_flags determkine build type.

commit 191553e54dca407207789cf0d7c6c27fe6188775
Author: Brad Bell <bradbell@…>
Date: Mon May 29 19:53:08 2017 -0700

debug_rel branch:
Use set_compile_flags in introduction.

commit fba276a84e58d9a0d0944168d5706b7446beb32c
Author: Brad Bell <bradbell@…>
Date: Mon May 29 19:46:30 2017 -0700

debug_rel branch:
Use set_compile_flags in eample/multi_thread subdirectories.

commit 66c8cdb266fa3af29b211b8c870a3aed7a13b021
Author: Brad Bell <bradbell@…>
Date: Mon May 29 18:56:48 2017 -0700

debug_rel branch:
Use set_compile_flags in speed directory.

commit c431b15ee7714d3106234bc527ba2f9a836750e1
Author: Brad Bell <bradbell@…>
Date: Mon May 29 18:36:51 2017 -0700

debug_rel branch:
Convert cppad_ipopt to use set_compile_flags and cppad_debug_which.


CMakeLists.txt: alwasy compile for release to reduce testing time.

commit 2c95b0019f1b665fb14b9f00b049e8b5fb11f89d
Author: Brad Bell <bradbell@…>
Date: Mon May 29 16:55:07 2017 -0700

debug_rel branch:
Add cppad_debug_which to the cmake command line.

commit fd8d1498cf6dc092deca41f764cbb2a001a4cc88
Author: Brad Bell <bradbell@…>
Date: Mon May 29 08:14:23 2017 -0700

debug_rel branch:
Change random_debug_release -> set_compile_flags.

commit 159f5a5aa09012213a52f4ed1c9f0607129a5fe7
Author: Brad Bell <bradbell@…>
Date: Mon May 29 06:50:43 2017 -0700

debug_rel branch:
Update the autotools automatically generated build files.


batch_edit.sh: Start comments about a plan for editing all the source files.
get_sacado.sh: advance to trilions-12.10.11.
makefile.am: advance to trilinos-12.10.1

commit 302153317cd296ec6f927c3202cf96bf38594bbb
Author: Brad Bell <bradbell@…>
Date: Mon May 29 05:20:00 2017 -0700

debug_rel branch:
Add error message if sacado configuration file does not exist.

commit 3f01a631ae808c3a1359e53e1cd55e9a0ea88711
Author: Brad Bell <bradbell@…>
Date: Mon May 29 04:24:00 2017 -0700

debug_rel branch:
CMakeLists.txt: automate naming of libraries Sacado needs.
checkpoint.cpp: fix warnings.

commit dd240928c0c8b6972a8197c985ccc01f08b8886b
Author: Brad Bell <bradbell@…>
Date: Sun May 28 08:25:20 2017 -0700

debug_rel branch:
sparse_sub_hes.cpp: add missing cases found by clang compiler.

commit 30a0c35f1ac50ec425be9a2b7b026284026eccd7
Author: Brad Bell <bradbell@…>
Date: Sun May 28 07:57:36 2017 -0700

debug_rel branch:
eigen_cholesky.hpp: fix compiler warning.
harmonic_time.cpp: remove include that is not used.
forward_active.cpp: fix compiler warning.

commit 4876d14e49dc235865b1574fb38a55cf5ea7a422
Author: Brad Bell <bradbell@…>
Date: Sun May 28 06:19:48 2017 -0700

debug_rel branch:
random_debug_release.cmake: fix comment, remove message replaced by random_choice_0123 in output.
multiple_solution.cpp: fix warnings with clang compiler.
eigen_cholesky.hpp: fix warnings with clang compiler.
compare_change.cpp: fix CPPAD_DEBUG_AND_RELEASE case.

commit 2c51a18f35188d04d2f94069382439580e23f4ac
Author: Brad Bell <bradbell@…>
Date: Sat May 27 21:04:37 2017 -0700

debug_rel branch:
Advance version to cppad-20170527.

commit 4500887b362537774b05e954ad2a95b65a7b8ba0
Author: Brad Bell <bradbell@…>
Date: Sat May 27 09:04:56 2017 -0700

debug_rel branch:
Ramdomly select debug or release flags in example directory.


CMakeLists.txt: always debug for multi_threed examples.

commit 140b5269a0b1a30643894e5a7a8c9a5eb1310301
Author: Brad Bell <bradbell@…>
Date: Sat May 27 08:10:51 2017 -0700

debug_rel branch:
Changing how we set all debug and release flags.

commit e6fb2639db1288fb75de4030b5906df1e41756f9
Author: Brad Bell <bradbell@…>
Date: Sat May 27 07:30:24 2017 -0700

debug_rel branch:
Replace use of cppad_extra_debug by CPPAD_DEBUG_AND_RELEASE.

commit fbbfd0f6e94862174a8a7a17308489ffddb28084
Author: Brad Bell <bradbell@…>
Date: Sat May 27 05:55:58 2017 -0700

debug_rel branch:
Improve random selection of which files are build for release or debug.


forward.cpp: use new -DCPPAD_DEBUG_AND_RELEASE flag.

commit 284be366fb5e2f685a0c71ea6a0e3f74584bf187
Author: Brad Bell <bradbell@…>
Date: Thu May 25 07:39:32 2017 -0700

debug_rel branch:
Add test that failed before change to player.


player.hpp: Fix so it has the same size in debug and release more.
checkpoint.cpp: fix warning when compiling for release.
run_cmake.sh: prepare to use random number to switch debug and release set.
CMakeLists.txt: switch to only test debug (for now).

commit f32375b77e3825628fee6cb160f691a32c48b796
Author: Brad Bell <bradbell@…>
Date: Wed May 24 12:04:27 2017 -0700

debug_rel branch:
forward.cpp: fix a warning during release build.

commit 5fcc7eb78ae8de9f1dbc6c4f0c76fe38e8aeba95
Author: Brad Bell <bradbell@…>
Date: Wed May 24 10:11:12 2017 -0700

debug_rel branch:
CMakeLists.txt: make easy to mix debug and release builds.
eigen_mat_inv.hpp: fix release version warning.

commit 696266f3d62079f5e3bfb1a0f60a7e4f8134e068
Author: Brad Bell <bradbell@…>
Date: Wed May 24 05:43:29 2017 -0700

push_git2svn.py: user ./build in place of ./build/work.
testvector.hpp: improve comments about replacing CPPAD_TESTVECTOR.

  • Property svn:keywords set to Id
File size: 24.8 KB
Line 
1dnl --------------------------------------------------------------------------
2dnl CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
3dnl
4dnl CppAD is distributed under multiple licenses. This distribution is under
5dnl the terms of the
6dnl                     Eclipse Public License Version 1.0.
7dnl
8dnl A copy of this license is included in the COPYING file of this distribution.
9dnl Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
10dnl ---------------------------------------------------------------------------
11dnl
12dnl Process this file with autoconf to produce a configure script.
13dnl   package   version              bug-report
14AC_INIT([cppad], [20170601], [cppad@list.coin-or.org])
15AM_SILENT_RULES([yes])
16
17dnl By defalut disable maintainer mode when running configure;
18dnl --enable-maintainer-mode will enable it.
19dnl This avoids the autoconf and automake tools being launched by make
20AM_MAINTAINER_MODE
21
22dnl Set the default install prefix to the installers home directory
23dnl cygwin begin delete:
24AC_PREFIX_DEFAULT(${HOME})
25dnl cygwin end delete:
26dnl cygwin replace: AC_PREFIX_DEFAULT(/usr)
27
28dnl Run any macros required for proper operation of generated makefiles
29dnl Note this must come before AC_PROG_CC; see
30dnl http://lists.gnu.org/archive/html/automake/2010-08/msg00113.html
31dnl
32dnl nostdinc: Do not define standard include directories in generated makefiles
33dnl subdir-objects: create objects in sub-directories, same structure source
34dnl foreign: not GNU standard; no NEWS, AUTHORS, ...
35AM_INIT_AUTOMAKE([nostdinc subdir-objects -Wall foreign])
36
37# check if we have ar program
38have_ar='yes'
39AM_PROG_AR([have_ar='no'])
40AC_MSG_NOTICE([have_ar = $have_ar])
41
42dnl ----------------------------------------------------------------------
43AC_MSG_NOTICE([*** Check command line arguments that are longer used ****])
44
45if test "$CPP_ERROR_WARN" != "" ; then
46    AC_MSG_ERROR([The CPP_ERROR_WARN configure option is now CXX_FLAGS])
47fi
48dnl
49AC_ARG_WITH(SpeedExample, AC_HELP_STRING(
50        [--with-SpeedExample], [is not necessary, see install instructions.]),
51        [SpeedExample="yes"], [SpeedExample="no"]
52)
53if test "$SpeedExample" = "yes" ; then
54    AC_MSG_ERROR([--with-SpeedExample not necessary, see install instructions.])
55fi
56dnl
57AC_ARG_WITH(profiling, AC_HELP_STRING(
58        [--with-profiling], [is not necessary, see install instructions.]),
59        [profiling="yes"], [profiling="no"]
60)
61if test "$profiling" = "yes" ; then
62    AC_MSG_ERROR([--with-profiling not necessary, see install instructions.])
63fi
64dnl
65AC_ARG_WITH(Speed, AC_HELP_STRING(
66        [--with-Speed], [is not necessary, see install instructions.]),
67        [Speed="yes"], [Speed="no"]
68)
69if test "$Speed" = "yes" ; then
70    AC_MSG_ERROR([--with-Speed not necessary, see install instructions.])
71fi
72dnl
73AC_ARG_WITH(Introduction, AC_HELP_STRING(
74        [--with-Introduction], [is not necessary, see install instructions.]),
75        [Introduction="yes"], [Introduction="no"]
76)
77if test "$Introduction" = "yes" ; then
78    AC_MSG_ERROR([--with-Introduction not necessary, see install instructions.])
79fi
80dnl
81AC_ARG_WITH(Example, AC_HELP_STRING(
82        [--with-Example], [is not necessary, see install instructions.]),
83        [Example="yes"], [Example="no"]
84)
85if test "$Example" = "yes" ; then
86    AC_MSG_ERROR([--with-Example not necessary, see install instructions.])
87fi
88dnl
89AC_ARG_WITH(TestMore, AC_HELP_STRING(
90        [--with-TestMore], [is not necessary, see install instructions.]),
91        [TestMore="yes"], [TestMore="no"]
92)
93if test "$TestMore" = "yes" ; then
94    AC_MSG_ERROR([--with-TestMore not necessary, see install instructions.])
95fi
96dnl
97AC_ARG_WITH(PrintFor, AC_HELP_STRING(
98        [--with-PrintFor], [is not necessary, see install instructions.]),
99        [PrintFor="yes"], [PrintFor="no"]
100)
101if test "$PrintFor" = "yes" ; then
102    AC_MSG_ERROR([--with-PrintFor not necessary, see install instructions.])
103fi
104AC_ARG_WITH(sparse_set,
105        AC_HELP_STRING([--with-sparse_set], [no longer available]),
106        [sparse_set="yes"],
107        [sparse_set="no"]
108)
109if test "$sparse_set" = "yes" ; then
110        AC_MSG_ERROR([--with-sparse_set is no longer available])
111fi
112AC_ARG_WITH(sparse_list,
113        AC_HELP_STRING([--with-sparse_list], [no longer necessary]),
114        [sparse_set="yes"],
115        [sparse_set="no"]
116)
117if test "$sparse_set" = "yes" ; then
118        AC_MSG_ERROR([--with-sparse_set is no longer necessary])
119fi
120AC_ARG_WITH(deprecated, AC_HELP_STRING(
121        [--with-deprecated],
122        [include deprectated features that are on the chopping block]
123        ),
124        [deprecated="yes"],
125        [deprecated="no"]
126)
127AM_CONDITIONAL(CppAD_DEPRECATED, test "$deprecated" = 'yes' )
128if test "$deprecated" = "yes" ; then
129        AC_MSG_ERROR(
130                [autotools version does not install features on the chopping block]
131        )
132fi
133dnl --------------------------------------------------------------------------
134AC_MSG_NOTICE([******  Check command line arguments that are used ***********])
135
136dnl -----------------------------------------------------------------------
137dnl The case where enable_msvc != no is defined and supported by Ted Ralphs
138AC_MSG_CHECKING([--enable-msvc])
139AC_ARG_ENABLE([msvc],
140  [AC_HELP_STRING([--enable-msvc],
141                  [Prefer (i)cl/ifort/link over GNU on MinGW/Cygwin.])],
142  [enable_msvc=$enableval],
143  [enable_msvc=no]
144)
145AC_MSG_RESULT([$enable_msvc])
146
147
148dnl the prefix directory corresponding to CppAD -------------------------
149dnl The following seems to work but NONE is not in autoconf specifications
150AC_MSG_CHECKING([--prefix])
151if test "$prefix" = "NONE" ; then
152        AC_MSG_RESULT([$HOME])
153else
154        AC_MSG_RESULT([$prefix])
155fi
156
157dnl Are we installing the documentation -----------------------------------
158dnl cygwin begin delete:
159AC_MSG_CHECKING([--with-Documentation])
160AC_ARG_WITH(Documentation,
161        AC_HELP_STRING([--with-Documentation], [default is no]),
162        [Documentation="yes"],
163        [Documentation="no"]
164)
165AM_CONDITIONAL(CppAD_DOCUMENTATION, test "$Documentation" = "yes")
166AC_MSG_RESULT([$Documentation])
167dnl cygwin end delete:
168dnl cygwin replace: AM_CONDITIONAL(CppAD_DOCUMENTATION, test "yes" = "yes")
169
170dnl Are we using standard vectors ----------------------------------------
171AC_MSG_CHECKING([--with-stdvector])
172AC_ARG_WITH(stdvector,
173        AC_HELP_STRING([--with-stdvector], [default is no]),
174        [stdvector="yes"],
175        [stdvector="no"]
176)
177if test "$stdvector" = "yes" ; then
178        AC_SUBST(cppad_stdvector, 1)
179else
180        AC_SUBST(cppad_stdvector, 0)
181fi
182AC_MSG_RESULT([$stdvector])
183
184dnl Are we using boost vectors ----------------------------------------
185AC_MSG_CHECKING([--with-boostvector])
186AC_ARG_WITH(boostvector,
187        AC_HELP_STRING([--with-boostvector], [default is no]),
188        [boostvector="yes"],
189        [boostvector="no"]
190)
191AC_MSG_RESULT([$boostvector])
192if test "$boostvector" = "yes" ; then
193        if test "$stdvector" != "no" ; then
194                AC_MSG_ERROR([cannot --with both stdvector and boostvector])
195        fi
196        AC_SUBST(cppad_boostvector, 1)
197else
198        AC_SUBST(cppad_boostvector, 0)
199fi
200
201dnl Are we using eigen vectors ----------------------------------------
202AC_MSG_CHECKING([--with-eigenvector])
203AC_ARG_WITH(eigenvector,
204        AC_HELP_STRING([--with-eigenvector], [default is no]),
205        [eigenvector="yes"],
206        [eigenvector="no"]
207)
208AC_MSG_RESULT([$eigenvector])
209if test "$eigenvector" = "yes" ; then
210        if test "$stdvector" != "no" ; then
211                AC_MSG_ERROR([cannot --with both stdvector and eigenvector])
212        fi
213        if test "$boostvector" != "no" ; then
214                AC_MSG_ERROR([cannot --with both boostvector and eigenvector])
215        fi
216        AC_SUBST(cppad_eigenvector, 1)
217else
218        AC_SUBST(cppad_eigenvector, 0)
219fi
220
221dnl The postfix directiory corresponding to CppAD ------------------------
222AC_MSG_CHECKING([POSTFIX_DIR])
223AC_ARG_VAR(POSTFIX_DIR,
224        [postfix directory for CppAD installation]
225)
226AM_CONDITIONAL(CppAD_POSTFIX, test "$POSTFIX_DIR" != "")
227if test "$POSTFIX_DIR" != "" ; then
228        AC_MSG_RESULT([$POSTFIX_DIR])
229else
230        AC_MSG_RESULT([no])
231fi
232
233dnl The prefix corresponding to the installation of Adolc ---------------
234AC_MSG_CHECKING([ADOLC_DIR])
235AC_ARG_VAR(ADOLC_DIR,
236        [value of configure prefix directory during Adolc install]
237)
238AM_CONDITIONAL(CppAD_ADOLC, test "$ADOLC_DIR" != "")
239if test "$ADOLC_DIR" != "" ; then
240        AC_MSG_RESULT([$ADOLC_DIR])
241        if test "$have_ar" = "no"; then
242                AC_MSG_ERROR([ar is missing and ADOLC_DIR is present])
243        fi
244        AC_SUBST(cppad_has_adolc, 1)
245else
246        AC_MSG_RESULT([no])
247        AC_SUBST(cppad_has_adolc, 0)
248fi
249
250dnl The prefix corresponding to the installation of Eigen ---------------
251AC_MSG_CHECKING([EIGEN_DIR])
252AC_ARG_VAR(EIGEN_DIR,
253        [value of configure prefix directory during Eigen install]
254)
255AM_CONDITIONAL(CppAD_EIGEN_DIR, test "$EIGEN_DIR" != "")
256if test "$EIGEN_DIR" != "" ; then
257        AC_MSG_RESULT([$EIGEN_DIR])
258        AC_SUBST(EIGEN_INCLUDE, [-I$EIGEN_DIR/include])
259        AC_SUBST(cppad_has_eigen, 1)
260else
261        AC_MSG_RESULT([no])
262        AC_SUBST(EIGEN_INCLUDE, [])
263        AC_SUBST(cppad_has_eigen, 0)
264fi
265
266dnl The directory corresponding to the installation of FADBAD -----------
267AC_MSG_CHECKING([FADBAD_DIR])
268AC_ARG_VAR(FADBAD_DIR,
269        [parent directory directly above FADBAD++ directory]
270)
271AM_CONDITIONAL(CppAD_FADBAD, test "$FADBAD_DIR" != "")
272if test "$FADBAD_DIR" != "" ; then
273        AC_MSG_RESULT([$FADBAD_DIR])
274        if test "$have_ar" = "no"; then
275                AC_MSG_ERROR([ar is missing and FADBAD_DIR is present])
276        fi
277        AC_SUBST(cppad_has_fadbad, 1)
278else
279        AC_MSG_RESULT([no])
280        AC_SUBST(cppad_has_fadbad, 0)
281fi
282
283dnl The directory corresponding to the installation of SACADO -----------
284AC_MSG_CHECKING([SACADO_DIR])
285AC_ARG_VAR(SACADO_DIR,
286        [value of the configure prefix directory during Sacado install]
287)
288AM_CONDITIONAL(CppAD_SACADO, test "$SACADO_DIR" != "")
289if test "$SACADO_DIR" != "" ; then
290        AC_MSG_RESULT([$SACADO_DIR])
291        if test "$have_ar" = "no"; then
292                AC_MSG_ERROR([ar is missing and SACADO_DIR is present])
293        fi
294        AC_SUBST(cppad_has_sacado, 1)
295else
296        AC_MSG_RESULT([no])
297        AC_SUBST(cppad_has_sacado, 0)
298fi
299
300dnl The directory corresponding to the installation of IPOPT -----------
301AC_MSG_CHECKING([IPOPT_DIR])
302AC_ARG_VAR(IPOPT_DIR,
303        [value of the configure prefix directory during Ipopt install]
304)
305AM_CONDITIONAL(CppAD_IPOPT, test "$IPOPT_DIR" != "")
306if test "$IPOPT_DIR" != "" ; then
307        AC_MSG_RESULT([$IPOPT_DIR])
308        if test "$have_ar" = "no"; then
309                AC_MSG_ERROR([ar is missing and IPOPT_DIR is present])
310        fi
311        AC_SUBST(cppad_has_ipopt, 1)
312else
313        AC_MSG_RESULT([no])
314        AC_SUBST(cppad_has_ipopt, 0)
315fi
316
317dnl The directory corresponding to the installation of BOOST ------------
318AC_MSG_CHECKING([BOOST_DIR])
319AC_ARG_VAR(BOOST_DIR,
320        [parent directory directly above boost directory]
321)
322AM_CONDITIONAL(CppAD_BOOST_DIR, test "$BOOST_DIR" != "")
323if test "$BOOST_DIR" != "" ; then
324        AC_MSG_RESULT([$BOOST_DIR])
325        AC_SUBST(BOOST_INCLUDE, [-I$BOOST_DIR/include])
326        AC_SUBST(cppad_has_boost, 1)
327else
328        AC_MSG_RESULT([no])
329        AC_SUBST(BOOST_INCLUDE,[])
330        AC_SUBST(cppad_has_boost, 0)
331fi
332
333dnl The C++ compiler flags CXX_FLAGS -------------------------------------
334dnl see AC_SUBST(CXXFLAGS, "") next to AC_PROG_CXX
335#
336AC_MSG_CHECKING([CXX_FLAGS])
337AC_ARG_VAR(CXX_FLAGS,
338        [ CXXFLAGS is ignored, use CXX_FLAGS for compiler flags]
339)
340# cxx_flags for fadbad and eigen
341if test "$CXX_FLAGS" != "" ; then
342        AC_MSG_RESULT([$CXX_FLAGS])
343        cxx_flags_fadbad=`echo "$CXX_FLAGS" | sed -e 's|-Wshadow||'`
344        cxx_flags_eigen="$cxx_flags_fadbda -Wno-long-long"
345else
346        AC_MSG_RESULT([no])
347        cxx_flags_fadbad=""
348        cxx_flags_eigen=""
349fi
350AC_SUBST(CXX_FLAGS_FADBAD, "$cxx_flags_fadbad")
351AC_SUBST(CXX_FLAGS_EIGEN,  "$cxx_flags_eigen")
352
353dnl The compiler OpenMP flags OPENMP_FLAGS ----------------------------------
354AC_MSG_CHECKING([OPENMP_FLAGS])
355AC_ARG_VAR(OPENMP_FLAGS,
356        [ flags that instruct compiler to interpret OpenMP directrives ]
357)
358if test "$OPENMP_FLAGS" != "" ; then
359        AC_MSG_RESULT([$OPENMP_FLAGS])
360else
361        AC_MSG_RESULT([no])
362fi
363AM_CONDITIONAL(CppAD_OPENMP, test "$OPENMP_FLAGS" != "")
364
365dnl The compiler OpenMP flags MAX_NUM_THREADS -------------------------------
366AC_MSG_CHECKING([MAX_NUM_THREADS])
367AC_ARG_VAR(MAX_NUM_THREADS,
368        [ maximum number of threads that can be used with CppAD ]
369)
370if test "$MAX_NUM_THREADS" != "" ; then
371        AC_MSG_RESULT([$MAX_NUM_THREADS])
372        if test "$MAX_NUM_THREADS" -lt "4" ; then
373                AC_MSG_ERROR(
374                        [ MAX_NUM_THREADS=$MAX_NUM_THREADS is less than 4 ]
375                )
376        fi
377        max_num_threads="$MAX_NUM_THREADS"
378else
379        max_num_threads="48"
380        AC_MSG_RESULT([no, using default value $max_num_threads])
381fi
382AC_SUBST(cppad_max_num_threads, [$max_num_threads])
383
384dnl type used for addresses in AD tapes [ default = unsigned int ] -----------
385AC_MSG_CHECKING([TAPE_ADDR_TYPE])
386AC_ARG_VAR(TAPE_ADDR_TYPE, [type used for addresses in AD tapes])
387if test "$TAPE_ADDR_TYPE" == "" ; then
388        addr_t="unsigned int"
389else
390        addr_t="$TAPE_ADDR_TYPE"
391fi
392AC_SUBST(cppad_tape_addr_type, [$addr_t])
393AC_MSG_RESULT([$addr_t])
394ok="no"
395if test "$addr_t" == "size_t" ; then
396        ok="yes"
397fi
398if test "$addr_t" == "int" ; then
399        AC_MSG_WARN(
400                [TAPE_ADDR_TYPE=int is for CppAD developers (not users)]
401        )
402        ok="yes"
403fi
404if test "$addr_t" == "unsigned int" ; then
405        ok="yes"
406fi
407if test "$addr_t" == "unsigned short int" ; then
408        ok="yes"
409fi
410if test "$ok" == "no" ; then
411        AC_MSG_ERROR(
412                [$addr_t is not a valid choice for TAPE_ADDR_TYPE]
413        )
414fi
415
416dnl type used for tape identifier [ default = unsigned int ] -----------
417AC_MSG_CHECKING([TAPE_ID_TYPE])
418AC_ARG_VAR(TAPE_ID_TYPE, [type used for addresses in AD tapes])
419if test "$TAPE_ID_TYPE" == "" ; then
420        tape_id_t="unsigned int"
421else
422        tape_id_t="$TAPE_ID_TYPE"
423fi
424AC_SUBST(cppad_tape_id_type, [$tape_id_t])
425AC_MSG_RESULT([$tape_id_t])
426ok="no"
427if test "$tape_id_t" == "size_t" ; then
428        ok="yes"
429fi
430if test "$tape_id_t" == "int" ; then
431        AC_MSG_WARN(
432                [TAPE_ID_TYPE=int is for CppAD developers (not users)]
433        )
434        ok="yes"
435fi
436if test "$tape_id_t" == "unsigned int" ; then
437        ok="yes"
438fi
439if test "$tape_id_t" == "unsigned short int" ; then
440        ok="yes"
441fi
442if test "$ok" == "no" ; then
443        AC_MSG_ERROR(
444                [$tape_id_t is not a valid choice for TAPE_ID_TYPE]
445        )
446fi
447AC_MSG_NOTICE([********** End Checking Command Line arguments ***************])
448
449dnl --------------------------------------------------------------------------
450if test "$enable_msvc" == "no"
451then
452        cxx_list="g++ clang++ CC pgCC icpc gpp cxx cc++"
453        cc_list="gcc clang cc pgcc icc"
454        fc_list="gfortran ifort g95 fort77 f77 g77 pgf90 pgf77 ifc frt af77"
455else
456        dnl This case defined and supported by Ted Ralphs
457        cxx_list="icl cl g++"
458        cc_list="icl cl gcc"
459        fc_list="ifort gfortran"
460fi
461dnl --------------------------------------------------------------------------
462
463dnl AC_PROG_CXX([compiler-search-list]) outputs CXX as C++ compiler to use
464AC_PROG_CXX([$cxx_list])
465dnl erase any setting of CXXFLAGS, see CXX_FLAGS documentation
466AC_SUBST(CXXFLAGS, "")
467
468dnl AC_PROG_CC([compiler-search-list]) outputs CC as C++ compiler to use
469AC_PROG_CC([$cc_list])
470dnl erase any setting of CFLAGS
471AC_SUBST(CFLAGS, "")
472
473dnl AC_PROG_FC ([compiler-search-list], [dialect])
474AC_PROG_FC([$fc_list])
475dnl not compiling any fortran so no need to touch flags
476
477dnl Check for pkgconfig
478AC_CHECK_PROG(have_pkg_config, [pkg-config], [yes], [no])
479AM_CONDITIONAL(CppAD_PKG_CONFIG, test "$have_pkg_config" = "yes")
480
481dnl check if we can build libraries
482AM_CONDITIONAL(CppAD_HAVE_AR, test "$have_ar" = 'yes' )
483if test "$have_ar" = 'no'; then
484        AC_MSG_WARN(
485        [cannot build any libraries because ar is missing; e.g,, speed/* not built]
486        )
487fi
488
489dnl test_one.sh.in settings for cppad_cxx_flags (no longer used ?)
490AC_SUBST(cppad_cxx_flags, "-g -O0")
491
492dnl autotools version does not support installing deprecated features
493AC_SUBST(cppad_deprecated_01,  0)
494
495dnl autotools version does not colpack
496AC_SUBST(cppad_has_colpack, 0)
497
498dnl autotools version will assumes mkstemp is available.
499AC_SUBST(cppad_has_mkstemp, 1)
500AC_SUBST(cppad_has_tmpnam_s, 0)
501
502dnl autotools version cannot use c++11 compiler
503dnl so supress corresponding features
504AC_SUBST(cppad_has_nullptr, 0)
505AC_SUBST(cppad_has_rvalue, 0)
506AC_SUBST(cppad_has_cstdint_8_to_64, 0)
507AC_SUBST(cppad_cplusplus_201100_ok, 0)
508AC_SUBST(cppad_has_steady_clock, 0)
509
510dnl Determine if size_t has same size as unsigned int
511AC_CHECK_SIZEOF([size_t])
512AC_CHECK_SIZEOF([unsigned int])
513if test "$ac_cv_sizeof_size_t" != "$ac_cv_sizeof_unsigned_int" ; then
514        AC_SUBST(cppad_size_t_not_unsigned_int, 1)
515else
516        AC_SUBST(cppad_size_t_not_unsigned_int, 0)
517fi
518
519dnl Determine which definition we are using for CPPAD_TESTVECTOR
520if test "$stdvector$boostvector$eigenvector" = "nonono" ; then
521        AC_SUBST(cppad_cppadvector, 1)
522else
523        AC_SUBST(cppad_cppadvector, 0)
524fi
525
526dnl the gettimeofday check automatically generates a yes / no configure msg
527AC_CHECK_FUNC(
528        gettimeofday,
529        [gettimeofday="yes"],
530        [gettimeofday="no"]
531)
532if test "$gettimeofday" = "yes" ; then
533        AC_SUBST(cppad_has_gettimeofday, 1)
534else
535        AC_SUBST(cppad_has_gettimeofday, 0)
536fi
537
538dnl Use LIBTOOL for cppad_ipopt ?
539dnl AC_PROG_LIBTOOL
540
541dnl Determine if ranlib is present and where it is if present (set RANLIB)
542AC_PROG_RANLIB
543
544AC_MSG_CHECKING([whether using Microsoft C++ compiler])
545AM_CONDITIONAL(CppAD_MS_COMPILER, test "$CXX" == "cl" || test "$CXX" == "icl")
546if test "$CXX" == "cl" || test "$CXX" == "icl"; then
547        AC_MSG_RESULT([yes])
548else
549        AC_MSG_RESULT([no])
550fi
551
552
553
554dnl Have configure check source directory to see if cppad/cppad.hpp is there
555AC_CONFIG_SRCDIR(cppad/cppad.hpp)
556
557dnl AC_PROG_CP outputs CPP as command to run C preprocessor
558AC_PROG_CPP
559
560dnl Do nothing if complier supports inline, otherwise try to find a subsitute
561dnl definition or, if cannot, define inline as empty
562AC_C_INLINE
563
564dnl determine FCLIBS, flags necessary for linking C++ with modern fortran
565AC_FC_LIBRARY_LDFLAGS
566
567dnl absolute path corresponding to top_builddig and top_srcdir in makefile.am
568dnl (used by cppad-uninstalled.pc.in).
569abs_top_builddir=`pwd`
570AC_SUBST(ABS_TOP_BUILDDIR, "$abs_top_builddir")
571abs_top_srcdir=`cd $srcdir ; pwd`
572AC_SUBST(ABS_TOP_SRCDIR, "$abs_top_srcdir")
573dnl --------------------------------------------------------------------------
574dnl Check for C libraries
575
576dnl check for pthread library
577AC_CHECK_LIB(
578        [pthread],
579        [pthread_barrier_wait],
580        [pthread="yes"],
581        [pthread="no"]
582)
583AM_CONDITIONAL(CppAD_PTHREAD, test "$pthread" = "yes")
584if test "$pthread" == "yes" ; then
585        AC_SUBST(PTHREAD_LIB,"-lpthread")
586else
587        AC_SUBST(PTHREAD_LIB,"")
588fi
589
590dnl check for dl library
591AC_SUBST(DL_LIB, "")
592AC_CHECK_LIB(
593        [dl],
594        [dlopen],
595        [DL_LIB="-ldl"],
596        [DL_LIB=""]
597)
598dnl --------------------------------------------------------------------------
599dnl check for boost thread library
600AC_LANG_PUSH([C++])
601LDFLAGS_save=$LDFLAGS
602CXXFLAGS_save=$CXXFLAGS
603boost_thread_found='no'
604if test "$BOOST_DIR" != '' ; then
605        CXXFLAGS="-I$BOOST_DIR/include $CXXFLAGS"
606fi
607if test "$BOOST_DIR" == '' && test "$boost_thread_found" == 'no' ; then
608        bthread_lib='-lboost_thread-mt'
609        LDFLAGS="$LDFLAGS_save $bthread_lib"
610        AC_LINK_IFELSE(
611                [AC_LANG_PROGRAM(
612                        [# include <boost/thread.hpp>],
613                        [boost::barrier wait(1);]
614                )],
615                [boost_thread_found='yes'],
616                [boost_thread_found='no']
617        )
618fi
619if test "$BOOST_DIR" != '' && test "$boost_thread_found" == 'no' ; then
620        bthread_lib="$BOOST_DIR/lib/libboost_thread-mt.so"
621        LDFLAGS="$LDFLAGS_save $bthread_lib"
622        AC_LINK_IFELSE(
623                [AC_LANG_PROGRAM(
624                        [# include <boost/thread.hpp>],
625                        [boost::barrier wait(1);]
626                )],
627                [boost_thread_found='yes'],
628                [boost_thread_found='no']
629        )
630fi
631if test "$BOOST_DIR" != '' && test "$boost_thread_found" == 'no' ; then
632        bthread_lib="$BOOST_DIR/lib/libboost_thread-mt.a"
633        LDFLAGS="$LDFLAGS_save $bthread_lib"
634        AC_LINK_IFELSE(
635                [AC_LANG_PROGRAM(
636                        [# include <boost/thread.hpp>],
637                        [boost::barrier wait(1);]
638                )],
639                [boost_thread_found='yes'],
640                [boost_thread_found='no']
641        )
642fi
643if test "$BOOST_DIR" == '' && test "$boost_thread_found" == 'no' ; then
644        bthread_lib='-lboost_thread'
645        LDFLAGS="$LDFLAGS_save $bthread_lib"
646        AC_LINK_IFELSE(
647                [AC_LANG_PROGRAM(
648                        [# include <boost/thread.hpp>],
649                        [boost::barrier wait(1);]
650                )],
651                [boost_thread_found='yes'],
652                [boost_thread_found='no']
653        )
654fi
655if test "$BOOST_DIR" != '' && test "$boost_thread_found" == 'no' ; then
656        bthread_lib="$BOOST_DIR/lib/libboost_thread.so"
657        LDFLAGS="$LDFLAGS_save $bthread_lib"
658        AC_LINK_IFELSE(
659                [AC_LANG_PROGRAM(
660                        [# include <boost/thread.hpp>],
661                        [boost::barrier wait(1);]
662                )],
663                [boost_thread_found='yes'],
664                [boost_thread_found='no']
665        )
666fi
667if test "$BOOST_DIR" != '' && test "$boost_thread_found" == 'no' ; then
668        bthread_lib="$BOOST_DIR/lib/libboost_thread.a"
669        LDFLAGS="$LDFLAGS_save $bthread_lib"
670        AC_LINK_IFELSE(
671                [AC_LANG_PROGRAM(
672                        [# include <boost/thread.hpp>],
673                        [boost::barrier wait(1);]
674                )],
675                [boost_thread_found='yes'],
676                [boost_thread_found='no']
677        )
678fi
679AM_CONDITIONAL(CppAD_BTHREAD, test "$boost_thread_found" = 'yes')
680if test "$boost_thread_found" == 'yes' ; then
681        AC_SUBST(BTHREAD_LIB,"$bthread_lib")
682        AC_MSG_RESULT([boost::thread library... yes])
683else
684        AC_SUBST(BTHREAD_LIB,'')
685        AC_MSG_RESULT([boost::thread library... no])
686fi
687LDFLAGS=$LDFLAGS_save
688CXXFLAGS=$CXXFLAGS_save
689AC_LANG_POP([C++])
690#
691dnl --------------------------------------------------------------------------
692dnl Library directories
693if test -e $IPOPT_DIR/lib/coin ; then
694        IPOPT_LIBS="-L $IPOPT_DIR/lib/coin -L $IPOPT_DIR/lib/coin/ThirdParty"
695        IPOPT_LD_PATH="$IPOPT_DIR/lib/coin:$IPOPT_DIR/lib/coin/ThirdParty"
696else
697        IPOPT_LIBS="-L $IPOPT_DIR/lib"
698        IPOPT_LD_PATH="$IPOPT_DIR/lib"
699fi
700AC_SUBST(CPPAD_IPOPT_LD_PATH, "$IPOPT_LD_PATH")
701#
702AC_SUBST(CPPAD_IPOPT_LIBS, "$IPOPT_LIBS -lipopt")
703if test "$have_pkg_config" == "yes"; then
704        dnl set CPPAD_IPOPT_LIBS
705        PKG_CONFIG_PATH="$IPOPT_DIR/lib/pkgconfig:$IPOPT_DIR/share/pkgconfig"
706        PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$IPOPT_DIR/lib64/pkgconfig"
707        export PKG_CONFIG_PATH
708        if pkg-config --libs ipopt >& /dev/null ; then
709                CPPAD_IPOPT_LIBS=`pkg-config --libs ipopt`
710        else
711                dnl check for blas library
712                AC_LANG_PUSH([Fortran])
713                AC_CHECK_LIB(
714                        [blas],
715                        [ddot],
716                        [CPPAD_IPOPT_LIBS="$CPPAD_IPOPT_LIBS -lblas"],
717                )
718                dnl check for lapack library
719                AC_CHECK_LIB(
720                        [lapack],
721                        [dgesv],
722                        [CPPAD_IPOPT_LIBS="$CPPAD_IPOPT_LIBS -llapack"],
723                )
724                AC_LANG_POP([Fortran])
725        fi
726else
727        dnl check for blas library
728        AC_LANG_PUSH([Fortran])
729        AC_CHECK_LIB(
730                [blas],
731                [ddot],
732                [CPPAD_IPOPT_LIBS="$CPPAD_IPOPT_LIBS -lblas"],
733        )
734        dnl check for lapack library
735        AC_CHECK_LIB(
736                [lapack],
737                [dgesv],
738                [CPPAD_IPOPT_LIBS="$CPPAD_IPOPT_LIBS -llapack"],
739        )
740        AC_LANG_POP([Fortran])
741fi
742AC_MSG_RESULT([cppad_ipopt_nlp libraries: $CPPAD_IPOPT_LIBS])
743dnl --------------------------------------------------------------------------
744dnl Names set here so same cppad.pc.in works for both with cmake and autoconf.
745dnl (note that autoconf configuration does not allow for Colpack).
746dnl
747AC_SUBST(cppad_description, "Differentiation of C++ Algorithms")
748AC_SUBST(cppad_version, ${PACKAGE_VERSION} )
749AC_SUBST(cppad_url, "http://www.coin-or.org/CppAD")
750if test "$prefix" == "NONE" ; then
751        cppad_pkgconfig_cflags_value="-I$HOME/include"
752        cppad_pkgconfig_libs_value="-L$HOME/lib"
753else
754        cppad_pkgconfig_cflags_value="-I$prefix/include"
755        cppad_pkgconfig_libs_value="-L$prefix/lib"
756fi
757if test "$POSTFIX_DIR" != "" ; then
758        cppad_pkgconfig_cflags_value="$cppad_pkgconfig_cflags_value/$POSTFIX_DIR"
759        cppad_pkgconfig_libs_value="$cppad_pkgconfig_libs_value/$POSTFIX_DIR"
760fi
761if test "$IPOPT_DIR" == "" ; then
762        cppad_pkgconfig_libs_value=""
763        cppad_pkgconfig_requires_value=""
764else
765        cppad_pkgconfig_libs_value="$cppad_pkgconfig_libs_value -lcppad_ipopt"
766        cppad_pkgconfig_requires_value="ipopt"
767fi
768AC_SUBST(cppad_pkgconfig_cflags,   "$cppad_pkgconfig_cflags_value")
769AC_SUBST(cppad_pkgconfig_libs,     "$cppad_pkgconfig_libs_value")
770AC_SUBST(cppad_pkgconfig_requires, "$cppad_pkgconfig_requires_value")
771AC_SUBST(cppad_prefix,             "$prefix")
772AC_SUBST(cppad_abs_includedir,     "$includedir")
773dnl
774dnl names set here so cppad.pc-uninstalled works both with cmake and autoconf
775AC_SUBST(cppad_SOURCE_DIR,  ${ABS_TOP_SRCDIR} )
776dnl
777dnl names set here so */test_one.sh.in works both with cmake and autoconf
778dnl (no longer used ?)
779AC_SUBST(adolc_prefix,      ${ADOLC_DIR} )
780AC_SUBST(eigen_prefix,      ${EIGEN_DIR} )
781AC_SUBST(ipopt_prefix,      ${IPOPT_DIR} )
782dnl
783dnl -----------------------------------------------------------------------
784dnl AC_CONFIG_FILES(file-list) for each file in the list, configure will
785dnl read file.in, do its substitutions, and create file
786AC_CONFIG_FILES([
787        cppad/configure.hpp
788        cppad_ipopt/example/test.sh
789        cppad_ipopt/speed/test.sh
790        cppad_ipopt/test/test.sh
791        example/ipopt_solve/test.sh
792        pkgconfig/cppad.pc
793        pkgconfig/cppad-uninstalled.pc
794
795        makefile
796        cppad_ipopt/src/makefile
797        cppad_ipopt/example/makefile
798        cppad_ipopt/speed/makefile
799        cppad_ipopt/test/makefile
800        example/general/makefile
801        example/atomic/makefile
802        example/deprecated/makefile
803        example/ipopt_solve/makefile
804        example/optimize/makefile
805        example/sparse/makefile
806        example/utility/makefile
807        example/get_started/makefile
808        introduction/makefile
809        example/multi_thread/makefile
810        example/multi_thread/test_multi/makefile
811        example/print_for/makefile
812        speed/adolc/makefile
813        speed/cppad/makefile
814        speed/double/makefile
815        speed/example/makefile
816        speed/fadbad/makefile
817        speed/profile/makefile
818        speed/profile/gprof.sed
819        speed/sacado/makefile
820        speed/src/makefile
821        test_more/compare_c/makefile
822        test_more/general/makefile
823])
824dnl END AC_CONFIG_FILES
825
826dnl scripts that set library path before running test
827AC_CONFIG_COMMANDS(
828        [example_ipopt_solve_test.sh],
829        [chmod +x example/ipopt_solve/test.sh],
830)       []
831AC_CONFIG_COMMANDS(
832        [cppad_ipopt_example_test.sh],
833        [chmod +x cppad_ipopt/example/test.sh],
834)       []
835AC_CONFIG_COMMANDS(
836        [cppad_ipopt_speed_test.sh],
837        [chmod +x cppad_ipopt/speed/test.sh],
838        []
839)
840AC_CONFIG_COMMANDS(
841        [cppad_ipopt_test_test.sh],
842        [chmod +x cppad_ipopt/test/test.sh],
843        []
844)
845
846dnl create all the requested output files
847AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.