source: trunk/configure.ac @ 3805

Last change on this file since 3805 was 3805, checked in by bradbell, 4 years ago

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 624601e5e709d2872b5873f628fae76d5f575a9b
end hash code: 256147abd1ffb46688686cc6cd53908c9a64d957

commit 256147abd1ffb46688686cc6cd53908c9a64d957
Author: Brad Bell <bradbell@…>
Date: Tue Mar 22 12:56:16 2016 -0700

Change atomic_ode.cpp -> checkpoint_ode.cpp,
and atomic_extended_ode.cpp -> checkpoint_extended_ode.cpp.

commit 42eb37c2c38a377bf165ea2dcdd9721d251da800
Author: Brad Bell <bradbell@…>
Date: Tue Mar 22 09:05:32 2016 -0700

Add the eigen_mat_mul.cpp example (still under construction).


ode.cpp: minor corrections to typos in documentation.

commit 6126e82c2a9b3f10d15ee792bf9d32796eb9561c
Author: Brad Bell <bradbell@…>
Date: Tue Mar 22 04:57:55 2016 -0700

Reduce level of indent on public and private commands in atomic examples.

commit 50b8a65b81a0d4e3b0d9d03b188966eb5b366bec
Author: Brad Bell <bradbell@…>
Date: Tue Mar 22 04:46:22 2016 -0700

  1. Advance version to 20160322.
  2. Move atomic_mat_mul_xam.cpp -> atomic_mat_mul.cpp.

commit bb5a5300f882891dafff643ab6899a131fa477b0
Author: Brad Bell <bradbell@…>
Date: Mon Mar 21 05:40:28 2016 -0700

test_one.sh.in: use path to file instead of dir file.
mat_mul.hpp: add missing virtual (did not matter).

commit 955919bc43857a7f9b953af96be30f0cf524ae1c
Merge: ceb9087 3eece08
Author: Brad Bell <bradbell@…>
Date: Sun Mar 20 12:52:01 2016 -0700

Do not know how master got out of sync with local copy, but this merge
does not see to have any changes.

commit ceb9087c686d99279687134dc0af4da0150a0bc5
Author: Brad Bell <bradbell@…>
Date: Sun Mar 20 11:23:46 2016 -0700

Use utility/set_union to simplify atomic examples and tests.

commit 60e9db895ee11bddfb02b1e2f8a96b9dd8a01e49
Author: Brad Bell <bradbell@…>
Date: Sun Mar 20 11:02:21 2016 -0700

  1. Sort some lists.
  2. Add some references to set_union (missing in previous commit).

commit 3eece08b8e9af5f9cf2633bc300c4e5477acd2b1
Author: Brad Bell <bradbell@…>
Date: Sun Mar 20 10:00:56 2016 -0700

  1. Sort some lists.
  2. Add some references to set_union (missing in previous commit).

commit 309e461bf32d95b9330f65bbffaf4fa24d5f11d6
Author: Brad Bell <bradbell@…>
Date: Sun Mar 20 09:34:14 2016 -0700

Add utility/set_union.hpp.

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