source: stable/20130000/configure.ac @ 2757

Last change on this file since 2757 was 2757, checked in by bradbell, 7 years ago
  1. Relevant part of bug fix to limits.cpp in trunk

between revision 2755 and 2756.

  1. Advance release number from 1 to 2.
  • Property svn:keywords set to Id
File size: 22.2 KB
Line 
1dnl $Id: configure.ac 2757 2013-02-27 20:10:22Z bradbell $
2dnl ---------------------------------------------------------------------------
3dnl CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 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, 20130000.2, cppad@list.coin-or.org)
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 --------------------------------------------------------------------------
29dnl Check for programs
30
31AC_CHECK_PROG(have_pkg_config, [pkg-config], [yes], [no])
32AM_CONDITIONAL(CppAD_PKG_CONFIG, test "$have_pkg_config" = "yes")
33
34AC_CHECK_PROG(have_ar, [ar], [yes], [no])
35AM_CONDITIONAL(CppAD_HAVE_AR, test "$have_ar" = "yes")
36if test "$have_ar" = "no"; then
37        AC_MSG_WARN(
38        [cannot build any libraries because ar is missing, speed/* is not used]
39        )
40fi
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
104dnl --------------------------------------------------------------------------
105AC_MSG_NOTICE([******  Check command line arguments that are used ***********])
106dnl the prefix directory corresponding to CppAD -------------------------
107dnl The following seems to work but NONE is not in autoconf specifications
108AC_MSG_CHECKING([--prefix])
109if test "$prefix" = "NONE" ; then
110        AC_MSG_RESULT([$HOME])
111else
112        AC_MSG_RESULT([$prefix])
113fi
114
115dnl Are we installing the documentation -----------------------------------
116dnl cygwin begin delete:
117AC_MSG_CHECKING([--with-Documentation])
118AC_ARG_WITH(Documentation,
119        AC_HELP_STRING([--with-Documentation], [default is no]),
120        [Documentation="yes"],
121        [Documentation="no"]
122)
123AM_CONDITIONAL(CppAD_DOCUMENTATION, test "$Documentation" = "yes")
124AC_MSG_RESULT([$Documentation])
125dnl cygwin end delete:
126dnl cygwin replace: AM_CONDITIONAL(CppAD_DOCUMENTATION, test "yes" = "yes")
127
128dnl Are we using standard vectors ----------------------------------------
129AC_MSG_CHECKING([--with-stdvector])
130AC_ARG_WITH(stdvector,
131        AC_HELP_STRING([--with-stdvector], [default is no]),
132        [stdvector="yes"],
133        [stdvector="no"]
134)
135if test "$stdvector" = "yes" ; then
136        AC_SUBST(CPPAD_STDVECTOR, 1)
137else
138        AC_SUBST(CPPAD_STDVECTOR, 0)
139fi
140AC_MSG_RESULT([$stdvector])
141
142dnl Are we using boost vectors ----------------------------------------
143AC_MSG_CHECKING([--with-boostvector])
144AC_ARG_WITH(boostvector,
145        AC_HELP_STRING([--with-boostvector], [default is no]),
146        [boostvector="yes"],
147        [boostvector="no"]
148)
149AC_MSG_RESULT([$boostvector])
150if test "$boostvector" = "yes" ; then
151        if test "$stdvector" != "no" ; then
152                AC_MSG_ERROR([cannot --with both stdvector and boostvector])
153        fi
154        AC_SUBST(CPPAD_BOOSTVECTOR, 1)
155else
156        AC_SUBST(CPPAD_BOOSTVECTOR, 0)
157fi
158
159dnl Are we using eigen vectors ----------------------------------------
160AC_MSG_CHECKING([--with-eigenvector])
161AC_ARG_WITH(eigenvector,
162        AC_HELP_STRING([--with-eigenvector], [default is no]),
163        [eigenvector="yes"],
164        [eigenvector="no"]
165)
166AC_MSG_RESULT([$eigenvector])
167if test "$eigenvector" = "yes" ; then
168        if test "$stdvector" != "no" ; then
169                AC_MSG_ERROR([cannot --with both stdvector and eigenvector])
170        fi
171        if test "$boostvector" != "no" ; then
172                AC_MSG_ERROR([cannot --with both boostvector and eigenvector])
173        fi
174        AC_SUBST(CPPAD_EIGENVECTOR, 1)
175else
176        AC_SUBST(CPPAD_EIGENVECTOR, 0)
177fi
178
179dnl Are we using sparse_set or sparse_list ----------------------------
180AC_MSG_CHECKING([--with-sparse_set])
181AC_ARG_WITH(sparse_set,
182        AC_HELP_STRING([--with-sparse_set], [default is not specified]),
183        [sparse_set="yes"],
184        [sparse_set="no"]
185)
186AC_MSG_RESULT([$sparse_set])
187dnl
188AC_MSG_CHECKING([--with-sparse_list])
189AC_ARG_WITH(sparse_list,
190        AC_HELP_STRING([--with-sparse_list], [default is not specified]),
191        [sparse_list="yes"],
192        [sparse_list="no"]
193)
194AC_MSG_RESULT([$sparse_list])
195if test "$sparse_set" = "yes" ; then
196        if test "$sparse_list" == "yes" ; then
197                AC_MSG_ERROR([cannot --with both sparse_set and sparse_list])
198        fi
199        AC_SUBST(CPPAD_INTERNAL_SPARSE_SET, sparse_set)
200else
201        AC_SUBST(CPPAD_INTERNAL_SPARSE_SET, sparse_list)
202fi
203
204dnl The postfix directiory corresponding to CppAD ------------------------
205AC_MSG_CHECKING([POSTFIX_DIR])
206AC_ARG_VAR(POSTFIX_DIR,
207        [postfix directory for CppAD installation]
208)
209AM_CONDITIONAL(CppAD_POSTFIX, test "$POSTFIX_DIR" != "")
210if test "$POSTFIX_DIR" != "" ; then
211        AC_MSG_RESULT([$POSTFIX_DIR])
212else
213        AC_MSG_RESULT([no])
214fi
215
216dnl The prefix corresponding to the installation of Adolc ---------------
217AC_MSG_CHECKING([ADOLC_DIR])
218AC_ARG_VAR(ADOLC_DIR,
219        [value of configure prefix directory during Adolc install]
220)
221AM_CONDITIONAL(CppAD_ADOLC, test "$ADOLC_DIR" != "")
222if test "$ADOLC_DIR" != "" ; then
223        AC_MSG_RESULT([$ADOLC_DIR])
224        if test "$have_ar" = "no"; then
225                AC_MSG_ERROR([ar is missing and ADOLC_DIR is present])
226        fi
227else
228        AC_MSG_RESULT([no])
229fi
230
231dnl The prefix corresponding to the installation of Eigen ---------------
232AC_MSG_CHECKING([EIGEN_DIR])
233AC_ARG_VAR(EIGEN_DIR,
234        [value of configure prefix directory during Eigen install]
235)
236AM_CONDITIONAL(CppAD_EIGEN_DIR, test "$EIGEN_DIR" != "")
237if test "$EIGEN_DIR" != "" ; then
238        AC_MSG_RESULT([$EIGEN_DIR])
239        AC_SUBST(EIGEN_INCLUDE, [-I$EIGEN_DIR/include])
240else
241        AC_MSG_RESULT([no])
242        AC_SUBST(EIGEN_INCLUDE, [])
243fi
244
245dnl The directory corresponding to the installation of FADBAD -----------
246AC_MSG_CHECKING([FADBAD_DIR])
247AC_ARG_VAR(FADBAD_DIR,
248        [parent directory directly above FADBAD++ directory]
249)
250AM_CONDITIONAL(CppAD_FADBAD, test "$FADBAD_DIR" != "")
251if test "$FADBAD_DIR" != "" ; then
252        AC_MSG_RESULT([$FADBAD_DIR])
253        if test "$have_ar" = "no"; then
254                AC_MSG_ERROR([ar is missing and FADBAD_DIR is present])
255        fi
256else
257        AC_MSG_RESULT([no])
258fi
259
260dnl The directory corresponding to the installation of SACADO -----------
261AC_MSG_CHECKING([SACADO_DIR])
262AC_ARG_VAR(SACADO_DIR,
263        [value of the configure prefix directory during Sacado install]
264)
265AM_CONDITIONAL(CppAD_SACADO, test "$SACADO_DIR" != "")
266if test "$SACADO_DIR" != "" ; then
267        AC_MSG_RESULT([$SACADO_DIR])
268        if test "$have_ar" = "no"; then
269                AC_MSG_ERROR([ar is missing and SACADO_DIR is present])
270        fi
271else
272        AC_MSG_RESULT([no])
273fi
274
275dnl The directory corresponding to the installation of IPOPT -----------
276AC_MSG_CHECKING([IPOPT_DIR])
277AC_ARG_VAR(IPOPT_DIR,
278        [value of the configure prefix directory during Ipopt install]
279)
280AM_CONDITIONAL(CppAD_IPOPT, test "$IPOPT_DIR" != "")
281if test "$IPOPT_DIR" != "" ; then
282        AC_MSG_RESULT([$IPOPT_DIR])
283        if test "$have_ar" = "no"; then
284                AC_MSG_ERROR([ar is missing and IPOPT_DIR is present])
285        fi
286else
287        AC_MSG_RESULT([no])
288fi
289
290dnl The directory corresponding to the installation of BOOST ------------
291AC_MSG_CHECKING([BOOST_DIR])
292AC_ARG_VAR(BOOST_DIR,
293        [parent directory directly above boost directory]
294)
295AM_CONDITIONAL(CppAD_BOOST_DIR, test "$BOOST_DIR" != "")
296if test "$BOOST_DIR" != "" ; then
297        AC_MSG_RESULT([$BOOST_DIR])
298        AC_SUBST(BOOST_INCLUDE, [-I$BOOST_DIR/include])
299else
300        AC_MSG_RESULT([no])
301        AC_SUBST(BOOST_INCLUDE,[])
302fi
303
304dnl The C++ compiler flags CXX_FLAGS -------------------------------------
305dnl see AC_SUBST(CXXFLAGS, "") next to AC_PROG_CXX
306#
307AC_MSG_CHECKING([CXX_FLAGS])
308AC_ARG_VAR(CXX_FLAGS,
309        [ CXXFLAGS is ignored, use CXX_FLAGS for compiler flags]
310)
311# cxx_flags for fadbad and eigen
312if test "$CXX_FLAGS" != "" ; then
313        AC_MSG_RESULT([$CXX_FLAGS])
314        cxx_flags_fadbad=`echo "$CXX_FLAGS" | sed -e 's|-Wshadow||'`
315        cxx_flags_eigen="$cxx_flags_fadbda -Wno-long-long"
316else
317        AC_MSG_RESULT([no])
318        cxx_flags_fadbad=""
319        cxx_flags_eigen=""
320fi
321AC_SUBST(CXX_FLAGS_FADBAD, "$cxx_flags_fadbad")
322AC_SUBST(CXX_FLAGS_EIGEN,  "$cxx_flags_eigen")
323
324dnl The compiler OpenMP flags OPENMP_FLAGS ----------------------------------
325AC_MSG_CHECKING([OPENMP_FLAGS])
326AC_ARG_VAR(OPENMP_FLAGS,
327        [ flags that instruct compiler to interpret OpenMP directrives ]
328)
329if test "$OPENMP_FLAGS" != "" ; then
330        AC_MSG_RESULT([$OPENMP_FLAGS])
331else
332        AC_MSG_RESULT([no])
333fi
334AM_CONDITIONAL(CppAD_OPENMP, test "$OPENMP_FLAGS" != "")
335
336dnl The compiler OpenMP flags MAX_NUM_THREADS -------------------------------
337AC_MSG_CHECKING([MAX_NUM_THREADS])
338AC_ARG_VAR(MAX_NUM_THREADS,
339        [ maximum number of threads that can be used with CppAD ]
340)
341if test "$MAX_NUM_THREADS" != "" ; then
342        AC_MSG_RESULT([$MAX_NUM_THREADS])
343        if test "$MAX_NUM_THREADS" -lt "4" ; then
344                AC_MSG_ERROR(
345                        [ MAX_NUM_THREADS=$MAX_NUM_THREADS is less than 4 ]
346                )
347        fi
348        max_num_threads="$MAX_NUM_THREADS"
349else
350        max_num_threads="48"
351        AC_MSG_RESULT([no, using default value $max_num_threads])
352fi
353AC_SUBST(CPPAD_MAX_NUM_THREADS_DEFAULT, [$max_num_threads])
354
355dnl type used for addresses in AD tapes [ default = unsigned int ] -----------
356AC_MSG_CHECKING([TAPE_ADDR_TYPE])
357AC_ARG_VAR(TAPE_ADDR_TYPE, [type used for addresses in AD tapes])
358if test "$TAPE_ADDR_TYPE" == "" ; then
359        addr_t="unsigned int"
360else
361        addr_t="$TAPE_ADDR_TYPE"
362fi
363AC_SUBST(CPPAD_TAPE_ADDR_TYPE, [$addr_t])
364AC_MSG_RESULT([$addr_t])
365ok="no"
366if test "$addr_t" == "size_t" ; then
367        ok="yes"
368fi
369if test "$addr_t" == "int" ; then
370        AC_MSG_WARN(
371                [TAPE_ADDR_TYPE=int is for CppAD developers (not users)]
372        )
373        ok="yes"
374fi
375if test "$addr_t" == "unsigned int" ; then
376        ok="yes"
377fi
378if test "$addr_t" == "unsigned short int" ; then
379        ok="yes"
380fi
381if test "$ok" == "no" ; then
382        AC_MSG_ERROR(
383                [$addr_t is not a valid choice for TAPE_ADDR_TYPE]
384        )
385fi
386
387dnl type used for tape identifier [ default = unsigned int ] -----------
388AC_MSG_CHECKING([TAPE_ID_TYPE])
389AC_ARG_VAR(TAPE_ID_TYPE, [type used for addresses in AD tapes])
390if test "$TAPE_ID_TYPE" == "" ; then
391        tape_id_t="unsigned int"
392else
393        tape_id_t="$TAPE_ID_TYPE"
394fi
395AC_SUBST(CPPAD_TAPE_ID_TYPE, [$tape_id_t])
396AC_MSG_RESULT([$tape_id_t])
397ok="no"
398if test "$tape_id_t" == "size_t" ; then
399        ok="yes"
400fi
401if test "$tape_id_t" == "int" ; then
402        AC_MSG_WARN(
403                [TAPE_ID_TYPE=int is for CppAD developers (not users)]
404        )
405        ok="yes"
406fi
407if test "$tape_id_t" == "unsigned int" ; then
408        ok="yes"
409fi
410if test "$tape_id_t" == "unsigned short int" ; then
411        ok="yes"
412fi
413if test "$ok" == "no" ; then
414        AC_MSG_ERROR(
415                [$tape_id_t is not a valid choice for TAPE_ID_TYPE]
416        )
417fi
418AC_MSG_NOTICE([********** End Checking Command Line arguments ***************])
419
420dnl Determine if size_t has same size as unsigned int
421AC_CHECK_SIZEOF([size_t])
422AC_CHECK_SIZEOF([unsigned int])
423if test "$ac_cv_size_t" == "$ac_cv_unsigned_int" ; then
424        AC_SUBST(CPPAD_SIZE_T_SAME_UNSIGNED_INT, 1)
425else
426        AC_SUBST(CPPAD_SIZE_T_SAME_UNSIGNED_INT, 0)
427fi
428
429dnl Determine which definition we are using for CPPAD_TESTVECTOR
430if test "$stdvector$boostvector$eigenvector" = "nonono" ; then
431        AC_SUBST(CPPAD_CPPADVECTOR, 1)
432else
433        AC_SUBST(CPPAD_CPPADVECTOR, 0)
434fi
435
436dnl the gettimeofday check automatically generates a yes / no configure msg
437AC_CHECK_FUNC(
438        gettimeofday,
439        [gettimeofday="yes"],
440        [gettimeofday="no"]
441)
442if test "$gettimeofday" = "yes" ; then
443        AC_SUBST(CPPAD_GETTIMEOFDAY, 1)
444else
445        AC_SUBST(CPPAD_GETTIMEOFDAY, 0)
446fi
447
448dnl Run any macros required for proper operation of generated makefiles
449dnl nostdinc: Do not define standard include directories in generated makefiles
450AM_INIT_AUTOMAKE(nostdinc)
451
452dnl Use LIBTOOL for cppad_ipopt ?
453dnl AC_PROG_LIBTOOL
454
455dnl Determine if ranlib is present and where it is if present (set RANLIB)
456AC_PROG_RANLIB
457
458dnl AC_PROG_CXX([compiler-search-list]) outputs CXX as C++ compiler to use
459AC_PROG_CXX
460AC_MSG_CHECKING([whether using Microsoft C++ compiler])
461AM_CONDITIONAL(CppAD_MS_COMPILER, test "$CXX" == "cl" || test "$CXX" == "icl")
462if test "$CXX" == "cl" || test "$CXX" == "icl"; then
463        AC_MSG_RESULT([yes])
464else
465        AC_MSG_RESULT([no])
466fi
467dnl erase any setting of CXXFLAGS, see CXX_FLAGS documentation
468AC_SUBST(CXXFLAGS, "")
469
470
471dnl AC_PROG_CC([compiler-search-list]) outputs CC as C++ compiler to use
472AC_PROG_CC
473AC_MSG_CHECKING([whether using Microsoft C++ compiler])
474dnl erase any setting of CFLAGS
475AC_SUBST(CFLAGS, "")
476
477dnl Have configure check source directory to see if cppad/CppAD.h is there
478AC_CONFIG_SRCDIR(cppad/CppAD.h)
479
480dnl AC_PROG_CP outputs CPP as command to run C preprocessor
481AC_PROG_CPP
482
483dnl Do nothing if complier supports inline, otherwise try to find a subsitute
484dnl definition or, if cannot, define inline as empty
485AC_C_INLINE
486
487dnl determine FCLIBS, flags necessary for linking C++ with modern fortran
488AC_FC_LIBRARY_LDFLAGS
489
490dnl absolute path corresponding to top_builddig and top_srcdir in makefile.am
491dnl (used by cppad-uninstalled.pc.in).
492abs_top_builddir=`pwd`
493AC_SUBST(ABS_TOP_BUILDDIR, "$abs_top_builddir")
494abs_top_srcdir=`cd $srcdir ; pwd`
495AC_SUBST(ABS_TOP_SRCDIR, "$abs_top_srcdir")
496dnl --------------------------------------------------------------------------
497dnl Check for C libraries
498
499dnl check for pthread library
500AC_CHECK_LIB(
501        [pthread],
502        [pthread_barrier_wait],
503        [pthread="yes"],
504        [pthread="no"]
505)
506AM_CONDITIONAL(CppAD_PTHREAD, test "$pthread" = "yes")
507if test "$pthread" == "yes" ; then
508        AC_SUBST(PTHREAD_LIB,"-lpthread")
509else
510        AC_SUBST(PTHREAD_LIB,"")
511fi
512
513dnl check for dl library
514AC_SUBST(DL_LIB, "")
515AC_CHECK_LIB(
516        [dl],
517        [dlopen],
518        [DL_LIB="-ldl"],
519        [DL_LIB=""]
520)
521dnl --------------------------------------------------------------------------
522dnl check for boost thread library
523AC_LANG_PUSH([C++])
524LDFLAGS_save=$LDFLAGS
525CXXFLAGS_save=$CXXFLAGS
526boost_thread_found='no'
527if test "$BOOST_DIR" != '' ; then
528        CXXFLAGS="-I$BOOST_DIR/include $CXXFLAGS"
529fi
530if test "$BOOST_DIR" == '' && test "$boost_thread_found" == 'no' ; then
531        bthread_lib='-lboost_thread-mt'
532        LDFLAGS="$LDFLAGS_save $bthread_lib"
533        AC_LINK_IFELSE(
534                [AC_LANG_PROGRAM(
535                        [# include <boost/thread.hpp>],
536                        [boost::barrier wait(1);]
537                )],
538                [boost_thread_found='yes'],
539                [boost_thread_found='no']
540        )
541fi
542if test "$BOOST_DIR" != '' && test "$boost_thread_found" == 'no' ; then
543        bthread_lib="$BOOST_DIR/lib/libboost_thread-mt.so"
544        LDFLAGS="$LDFLAGS_save $bthread_lib"
545        AC_LINK_IFELSE(
546                [AC_LANG_PROGRAM(
547                        [# include <boost/thread.hpp>],
548                        [boost::barrier wait(1);]
549                )],
550                [boost_thread_found='yes'],
551                [boost_thread_found='no']
552        )
553fi
554if test "$BOOST_DIR" != '' && test "$boost_thread_found" == 'no' ; then
555        bthread_lib="$BOOST_DIR/lib/libboost_thread-mt.a"
556        LDFLAGS="$LDFLAGS_save $bthread_lib"
557        AC_LINK_IFELSE(
558                [AC_LANG_PROGRAM(
559                        [# include <boost/thread.hpp>],
560                        [boost::barrier wait(1);]
561                )],
562                [boost_thread_found='yes'],
563                [boost_thread_found='no']
564        )
565fi
566if test "$BOOST_DIR" == '' && test "$boost_thread_found" == 'no' ; then
567        bthread_lib='-lboost_thread'
568        LDFLAGS="$LDFLAGS_save $bthread_lib"
569        AC_LINK_IFELSE(
570                [AC_LANG_PROGRAM(
571                        [# include <boost/thread.hpp>],
572                        [boost::barrier wait(1);]
573                )],
574                [boost_thread_found='yes'],
575                [boost_thread_found='no']
576        )
577fi
578if test "$BOOST_DIR" != '' && test "$boost_thread_found" == 'no' ; then
579        bthread_lib="$BOOST_DIR/lib/libboost_thread.so"
580        LDFLAGS="$LDFLAGS_save $bthread_lib"
581        AC_LINK_IFELSE(
582                [AC_LANG_PROGRAM(
583                        [# include <boost/thread.hpp>],
584                        [boost::barrier wait(1);]
585                )],
586                [boost_thread_found='yes'],
587                [boost_thread_found='no']
588        )
589fi
590if test "$BOOST_DIR" != '' && test "$boost_thread_found" == 'no' ; then
591        bthread_lib="$BOOST_DIR/lib/libboost_thread.a"
592        LDFLAGS="$LDFLAGS_save $bthread_lib"
593        AC_LINK_IFELSE(
594                [AC_LANG_PROGRAM(
595                        [# include <boost/thread.hpp>],
596                        [boost::barrier wait(1);]
597                )],
598                [boost_thread_found='yes'],
599                [boost_thread_found='no']
600        )
601fi
602AM_CONDITIONAL(CppAD_BTHREAD, test "$boost_thread_found" = 'yes')
603if test "$boost_thread_found" == 'yes' ; then
604        AC_SUBST(BTHREAD_LIB,"$bthread_lib")
605        AC_MSG_RESULT([boost::thread library... yes])
606else
607        AC_SUBST(BTHREAD_LIB,'')
608        AC_MSG_RESULT([boost::thread library... no])
609fi
610LDFLAGS=$LDFLAGS_save
611CXXFLAGS=$CXXFLAGS_save
612AC_LANG_POP([C++])
613#
614dnl --------------------------------------------------------------------------
615dnl Library directories
616if test -e $IPOPT_DIR/lib/coin ; then
617        IPOPT_LIBS="-L $IPOPT_DIR/lib/coin -L $IPOPT_DIR/lib/coin/ThirdParty"
618        IPOPT_LD_PATH="$IPOPT_DIR/lib/coin:$IPOPT_DIR/lib/coin/ThirdParty"
619else
620        IPOPT_LIBS="-L $IPOPT_DIR/lib"
621        IPOPT_LD_PATH="$IPOPT_DIR/lib"
622fi
623AC_SUBST(CPPAD_IPOPT_LD_PATH, "$IPOPT_LD_PATH")
624#
625AC_SUBST(CPPAD_IPOPT_LIBS, "$IPOPT_LIBS -lipopt")
626if test "$have_pkg_config" == "yes"; then
627        dnl set CPPAD_IPOPT_LIBS
628        PKG_CONFIG_PATH="$IPOPT_DIR/lib/pkgconfig:$IPOPT_DIR/share/pkgconfig"
629        PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$IPOPT_DIR/lib64/pkgconfig"
630        export PKG_CONFIG_PATH
631        if pkg-config --libs ipopt >& /dev/null ; then
632                CPPAD_IPOPT_LIBS=`pkg-config --libs ipopt`
633        else
634                dnl check for blas library
635                AC_LANG_PUSH([Fortran])
636                AC_CHECK_LIB(
637                        [blas],
638                        [ddot],
639                        [CPPAD_IPOPT_LIBS="$CPPAD_IPOPT_LIBS -lblas"],
640                )
641                dnl check for lapack library
642                AC_CHECK_LIB(
643                        [lapack],
644                        [dgesv],
645                        [CPPAD_IPOPT_LIBS="$CPPAD_IPOPT_LIBS -llapack"],
646                )
647                AC_LANG_POP([Fortran])
648        fi
649else
650        dnl check for blas library
651        AC_LANG_PUSH([Fortran])
652        AC_CHECK_LIB(
653                [blas],
654                [ddot],
655                [CPPAD_IPOPT_LIBS="$CPPAD_IPOPT_LIBS -lblas"],
656        )
657        dnl check for lapack library
658        AC_CHECK_LIB(
659                [lapack],
660                [dgesv],
661                [CPPAD_IPOPT_LIBS="$CPPAD_IPOPT_LIBS -llapack"],
662        )
663        AC_LANG_POP([Fortran])
664fi
665AC_MSG_RESULT([cppad_ipopt_nlp libraries: $CPPAD_IPOPT_LIBS])
666dnl --------------------------------------------------------------------------
667dnl names set here so same cppad.pc.in works for both with cmake and autoconf.
668dnl
669AC_SUBST(cppad_description, "Differentiation of C++ Algorithms")
670AC_SUBST(cppad_version, ${PACKAGE_VERSION} )
671AC_SUBST(cppad_url, "http://www.coin-or.org/CppAD")
672if test "$prefix" == "NONE" ; then
673        cppad_cflags_value="-I$HOME/include"
674        cppad_libs_value="-L$HOME/lib"
675else
676        cppad_cflags_value="-I$prefix/include"
677        cppad_libs_value="-L$prefix/lib"
678fi
679if test "$POSTFIX_DIR" != "" ; then
680        cppad_cflags_value="$cppad_cflags_value/$POSTFIX_DIR"
681        cppad_libs_value="$cppad_libs_value/$POSTFIX_DIR"
682fi
683if test "$IPOPT_DIR" == "" ; then
684        cppad_libs_value=""
685        cppad_requires_value=""
686else
687        cppad_libs_value="$cppad_libs_value -lcppad_ipopt"
688        cppad_requires_value="ipopt"
689fi
690AC_SUBST(cppad_cflags,   "$cppad_cflags_value")
691AC_SUBST(cppad_libs,     "$cppad_libs_value")
692AC_SUBST(cppad_requires, "$cppad_requires_value")
693dnl
694dnl names set here so cppad.pc-uninstalled works both with cmake and autoconf
695AC_SUBST(cppad_SOURCE_DIR,  ${ABS_TOP_SRCDIR} )
696dnl
697dnl names set here so */test_one.sh.in works both with cmake and autoconf
698AC_SUBST(adolc_prefix,      ${ADOLC_DIR} )
699AC_SUBST(eigen_prefix,      ${EIGEN_DIR} )
700AC_SUBST(ipopt_prefix,      ${IPOPT_DIR} )
701dnl
702dnl -----------------------------------------------------------------------
703dnl AC_CONFIG_FILES(file-list) for each file in the list, configure will
704dnl read file.in, do its substitutions, and create file
705AC_CONFIG_FILES([
706        cppad/configure.hpp
707        cppad_ipopt/example/test.sh
708        cppad_ipopt/speed/test.sh
709        cppad_ipopt/test/test.sh
710        example/ipopt_solve/test.sh
711        example/test_one.sh
712        pkgconfig/cppad.pc
713        pkgconfig/cppad-uninstalled.pc
714        test_more/test_one.sh
715
716        makefile
717        compare_c/makefile
718        cppad_ipopt/src/makefile
719        cppad_ipopt/example/makefile
720        cppad_ipopt/speed/makefile
721        cppad_ipopt/test/makefile
722        example/makefile
723        example/ipopt_solve/makefile
724        introduction/get_started/makefile
725        introduction/exp_apx/makefile
726        multi_thread/makefile
727        multi_thread/test_multi/makefile
728        print_for/makefile
729        speed/adolc/makefile
730        speed/cppad/makefile
731        speed/double/makefile
732        speed/example/makefile
733        speed/fadbad/makefile
734        speed/profile/makefile
735        speed/profile/gprof.sed
736        speed/sacado/makefile
737        speed/src/makefile
738        test_more/makefile
739])
740dnl END AC_CONFIG_FILES
741dnl the comment line above is used by ./new_stable.sh
742
743AC_CONFIG_COMMANDS(
744        [example_ipopt_solve_test.sh],
745        [chmod +x example/ipopt_solve/test.sh],
746)       []
747AC_CONFIG_COMMANDS(
748        [cppad_ipopt_example_test.sh],
749        [chmod +x cppad_ipopt/example/test.sh],
750)       []
751AC_CONFIG_COMMANDS(
752        [cppad_ipopt_speed_test.sh],
753        [chmod +x cppad_ipopt/speed/test.sh],
754        []
755)
756AC_CONFIG_COMMANDS(
757        [cppad_ipopt_test_test.sh],
758        [chmod +x cppad_ipopt/test/test.sh],
759        []
760)
761AC_CONFIG_COMMANDS(
762        [example_test_one.sh],
763        [chmod +x example/test_one.sh],
764        []
765)
766AC_CONFIG_COMMANDS(
767        [test_more_test_one.sh],
768        [chmod +x test_more/test_one.sh],
769        []
770)
771
772dnl create all the requested output files
773AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.