source: trunk/configure.ac @ 708

Last change on this file since 708 was 708, checked in by kulshres, 3 years ago

Merge branch 'master' of 'gitclone' into 'svn'

The following changes have been merged:

commit e2291bde44a282a133894b0db350aeb0b92a87db
Author: Mladen Banovic <mladenbanovic2705@…>
Date: Fri Jul 8 10:15:51 2016 +0200

Add methods getNumLiveVar and getNumDir in adtl.h, change counter type in FOR_I_EQ_0_LT_NUMDIR macro to size_t (instead of int). Update chunk size of BOOST pool in adouble_tl.cpp according to adouble::numDir.

commit 2ffb294465b973bfd4bf1f73d84478f8233c0d2f
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 23 12:32:14 2016 +0200

implement missing ref_eq_mult_p und ref_eq_min_p in ho_rev.c

somehow these were left out when parameters were being implemented.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 8cf0e5c1bd36f1dcf3be72cd67de631b2e1d0ee6
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 23 12:31:04 2016 +0200

make sure the result is the last locint written in trace for each operation

since we're trying to generate ascii traces in the future, we'll need this
convention that the last location is the result, and previous locations
are arguments. This has been the case for almost all operations anyway
except for a few new one's that I wrote without keeping this in mind.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 9ae0ff220f37463f2ed85cafc8a626c24e472f2f
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Jun 21 14:16:27 2016 +0200

on some compilers newer boost interferes with AC_FUNC_MALLOC test

so do AC_FUNC_MALLOC and AC_FUNC_REALLOC as usual and check for boost
library later.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit b746f620772cc8cce53e8f350adc6281279caf72
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 20 15:32:22 2016 +0200

make Klaus Röbenack's name UTF-8 instead of ISO-8859-1

These are the only places where we're not simple ASCII or UTF-8 already

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 1171aa3961b5eb46a5d2ee64751c02a393a8a6f5
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri Jun 17 10:42:39 2016 +0200

correct short_ref document about include file

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 2c6b2aac2ef04431ece2c6ff80e574aa2e58814b
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri Jun 17 10:40:34 2016 +0200

correct error message to new semantics

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 506cde73451740bf0a15eff7d4abb158ee719ab0
Author: mflehmig <martin.flehmig@…>
Date: Fri Jun 17 10:14:26 2016 +0200

Fixed include of ADOL-C header.

ADOL-C header was included in old fashion (without adolc directory) for this example.

commit 2a023d3281d3d6d9824bad724a5768e3ee2fff94
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 16 13:50:39 2016 +0200

Try to use boost::pool for allocating advals in traceless vector mode

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 80f1e2019ac1faab96fe06f3e9da47efcc1bcd23
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon May 23 15:13:22 2016 +0200

correct a reference in doc and rebuild

commit d7ab5283afe58bacb2e8739d72ede4e17f4c8081
Author: Mladen Banovic <mladenbanovic2705@…>
Date: Fri May 20 16:42:13 2016 +0200

Update section 7 of adolc-manual related to the Traceless forward differentiation.

commit bedb8e36f959c5272e4610fe504acc83208e5e9d
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue May 17 16:09:36 2016 +0200

macro name correction

commit 92ff596a0331776901df7f172ca347572e3daafd
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue May 17 15:56:17 2016 +0200

Add a warning about using static build of ADOL-C

static build of ADOL-C does not call constructors
for internal global objects, thereby causing
segmentation faults.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

  • Property svn:keywords set to Author Date Id Revision
File size: 22.9 KB
Line 
1##############################################################################
2# configure.ac -- Process this file with autoconf to produce configure
3# Revision: $Id: configure.ac 708 2016-07-12 08:18:44Z kulshres $
4#
5# Copyright (C) Andrea Walther, Andreas Kowarz
6#               
7# contains patches from the COIN OR libtool
8#
9##############################################################################
10define([ADOLC_VER], [2])
11define([ADOLC_SUB], [6])
12define([ADOLC_LVL], [2])
13
14AC_PREREQ(2.67)
15AC_INIT(adolc,
16        ADOLC_VER.ADOLC_SUB.ADOLC_LVL-trunk,
17        [adol-c@list.coin-or.org])
18config_flags="$*"
19AC_REVISION($Revision: 708 $)
20AC_CONFIG_SRCDIR([ADOL-C/src/adouble.cpp])
21AC_CONFIG_AUX_DIR([autoconf])
22AC_CONFIG_MACRO_DIR([autoconf])
23AC_CONFIG_HEADERS([ADOL-C/src/config.h])
24AC_PREFIX_DEFAULT(${HOME}/adolc_base)
25AM_INIT_AUTOMAKE([1.11 dist-bzip2 foreign subdir-objects])
26AM_MAINTAINER_MODE([disable])
27AM_SILENT_RULES([yes])
28
29
30adolclib=adolc
31
32if test "x$CFLAGS" == x ; then
33    ac_shell_cflags="not_set"
34else
35    ac_shell_cflags="$CFLAGS"
36fi
37if test "x$CXXFLAGS" == x ; then
38    ac_shell_cxxflags="not_set"
39else
40    ac_shell_cxxflags="$CXXFLAGS"
41fi
42libdir_set_on_cmd="no"
43for i in $config_flags ; do
44    case $i in
45    -libdir | --libdir | --libdi | --libd | -libdir=* | --libdir=* | --libdi=* | --libd=*)
46            libdir_set_on_cmd="yes"
47            break
48            ;;
49    esac
50done
51
52AM_CONDITIONAL(DARWIN, [test "x${host_os#darwin}" != "x${host_os}"])
53
54AC_MSG_CHECKING(whether to build ADOL-C with adjoinable MPI (AMPI) support)
55AC_ARG_ENABLE(ampi,
56              [AS_HELP_STRING([--enable-ampi],[build ADOL-C with adjoinable MPI (AMPI) support [default=disabled]])],
57              [adolc_ampi_support=$enableval],[adolc_ampi_support=no])
58AC_MSG_RESULT($adolc_ampi_support)
59AM_CONDITIONAL(BUILD_ADOLC_AMPI_SUPPORT,[test x${adolc_ampi_support} = xyes])
60if test x"${adolc_ampi_support}" = xyes ; then
61AC_DEFINE(ADOLC_AMPI_SUPPORT,1,[defined if adjoinable MPI support is to be compiled in])
62fi
63
64LT_PREREQ([2.2.6])
65# checks for programs
66AC_PROG_CXX
67AX_CXX_COMPILE_STDCXX_11(noext,mandatory)
68AC_PROG_CC
69AC_PROG_CC_C_O
70AC_PROG_CC_C99
71AC_PROG_CPP
72AC_PROG_INSTALL
73AC_PROG_LN_S
74AC_PROG_MAKE_SET
75LT_INIT([disable-static win32-dll dlopen])
76
77if test "x$enable_static" != "xno" ; then
78   AC_MSG_WARN([Linking a user program with static ADOL-C library will always result in a segmentation fault])
79fi
80
81MPI_CONF_PRE
82
83AC_CHECK_SIZEOF([void *])
84if test "x$ac_cv_sizeof_void_p" = "x8" ; then
85   _lib=lib64
86else
87   _lib=lib
88fi
89if test "x$libdir_set_on_cmd" = "xno" ; then
90   libdir='${exec_prefix}'/"${_lib}"
91   AC_SUBST(_lib)
92   AC_SUBST(libdir)
93fi
94
95# check for builtin
96ACX_C_BUILTIN_EXPECT
97
98# checks for header files
99AC_HEADER_STDC
100AC_HEADER_TIME
101AC_HEADER_STDBOOL
102AC_CHECK_HEADERS([stddef.h stdlib.h stdio.h string.h unistd.h sys/timeb.h])
103
104# checks for types
105AC_C_CONST
106AC_C_INLINE
107AC_TYPE_SIZE_T
108AC_STRUCT_TM
109
110
111# Checks for libraries and fuctions
112AC_SEARCH_LIBS([pow], [m])
113AC_CHECK_FUNCS([floor fmax fmin ftime pow sqrt strchr strtol trunc])
114
115# substitutions
116AC_SUBST(ac_aux_dir)
117
118# ADOL-C configuration
119AC_DEFINE(ADOLC_VERSION,ADOLC_VER,[ADOL-C Version])
120AC_DEFINE(ADOLC_SUBVERSION,ADOLC_SUB,[ADOL-C Subversion])
121AC_DEFINE(ADOLC_PATCHLEVEL,ADOLC_LVL,[ADOL-C Patchlevel])
122ADOLC_VERSION=ADOLC_VER
123ADOLC_SUBVERSION=ADOLC_SUB
124ADOLC_PATCHLEVEL=ADOLC_LVL
125AC_SUBST(ADOLC_VERSION)
126AC_SUBST(ADOLC_SUBVERSION)
127AC_SUBST(ADOLC_PATCHLEVEL)
128
129# Checks for library functions
130AC_FUNC_MALLOC
131AC_FUNC_REALLOC
132if test x$ac_cv_func_malloc_0_nonnull != xyes ; then
133AC_DEFINE_UNQUOTED([calloc],[rpl_calloc],[Define to rpl_calloc if the replacement function should be used.])
134fi
135
136AC_MSG_CHECKING(whether to use calloc or malloc for memory allocation)
137AC_ARG_ENABLE(use-calloc,[AS_HELP_STRING([--disable-use-calloc],
138  [disable use of calloc and use malloc instead for memory allocation [default=calloc is used]])],
139  [use_calloc=$enableval],[use_calloc=yes])
140
141if test x$use_calloc = xyes ; then
142AC_MSG_RESULT(calloc)
143AC_DEFINE(ADOLC_USE_CALLOC,1,[Use calloc instead of malloc for memory allocation])
144else
145AC_MSG_RESULT(malloc)
146fi
147
148AC_MSG_CHECKING(whether to enable atrig/erf functions)
149AC_ARG_ENABLE(atrig-erf,[AS_HELP_STRING([--enable-atrig-erf],
150  [enable atrig and erf functions in ADOL-C [default=no]])],
151  [use_atrig_erf=$enableval],[use_atrig_erf=no])
152AC_MSG_RESULT($use_atrig_erf)
153
154if test x$use_atrig_erf = xyes ; then
155  ATRIG_ERF="#define ATRIG_ERF 1"
156else
157  ATRIG_ERF="#undef ATRIG_ERF"
158fi
159AC_SUBST(ATRIG_ERF)
160
161AC_MSG_CHECKING(whether to use 32-bit or 64-bit locations)
162AC_ARG_ENABLE(ulong,[AS_HELP_STRING([--enable-ulong],
163  [enable 64-bit locations (only available on 64-bit systems) [default=32-bit]])],
164  [use_ulong=$enableval],[use_ulong=no])
165
166if test x$use_ulong = xyes -a 0$ac_cv_sizeof_void_p -ge 8 ; then
167  UINT_TYPE=uint64_t
168  AC_MSG_RESULT(64-bit)
169else
170  UINT_TYPE=uint32_t
171  AC_MSG_RESULT(32-bit)
172fi
173AC_SUBST(UINT_TYPE)
174
175AC_MSG_CHECKING(whether to use single or double precision)
176AC_ARG_ENABLE(double,[AS_HELP_STRING([--disable-double],
177  [disable double precision arithmetic [untested, default=double is enabled]])],
178  [use_double=$enableval],[use_double=yes])
179
180if test x$use_double = xno ; then
181  REAL_TYPE=float
182  echo
183  echo -n "using ${REAL_TYPE} is not well tested, please report bugs if you find any..."
184else
185  REAL_TYPE=double
186fi
187AC_MSG_RESULT($REAL_TYPE)
188AC_SUBST(REAL_TYPE)
189
190AC_MSG_CHECKING(whether to enable advanced branching operations)
191AC_ARG_ENABLE(advanced-branching, [AS_HELP_STRING([--enable-advanced-branching],
192  [enable advanced branching operations to reduce retaping [default=no].
193The boolean valued comparison operators with two adouble arguments will
194not return boolean results but the active results may be used to automatically
195switch branches in conjunction with condassign or advector (see manual).])],
196  [use_advbranch=$enableval],[use_advbranch=no])
197AC_MSG_RESULT($use_advbranch)
198
199if test x$use_advbranch = xyes ; then
200  ADVBRANCH="#define ADOLC_ADVANCED_BRANCHING 1"
201else
202  ADVBRANCH="#undef ADOLC_ADVANCED_BRANCHING"
203fi
204AC_SUBST(ADVBRANCH)
205AC_SUBST(ADVBRANCH)
206
207AC_MSG_CHECKING(whether to use ADOL-C debug mode)
208AC_ARG_ENABLE(debug,
209              [
210AS_HELP_STRING([--enable-debug],[enable ADOL-C debug mode [default=no]])],
211  [
212  adolc_debug=$enableval
213   AC_MSG_RESULT($adolc_debug)
214   ],
215  [
216   adolc_debug=no
217   AC_MSG_RESULT(no)
218   ])
219
220AC_MSG_CHECKING(whether to use ADOL-C hard debug mode)
221AC_ARG_ENABLE(harddebug,
222              [
223AS_HELP_STRING([--enable-harddebug],[enable ADOL-C hard debug mode
224 [default=no]])],
225  [
226   adolc_harddebug=$enableval
227   AC_MSG_RESULT($adolc_harddebug)
228   ],
229  [
230   adolc_harddebug=no
231   AC_MSG_RESULT(no)
232   ])
233
234if test x$adolc_harddebug == xyes ; then
235adolc_debug=yes
236AC_DEFINE(ADOLC_HARDDEBUG,1,[ADOL-C hard debug mode])
237fi
238
239if test x$adolc_debug == xyes ; then
240AC_DEFINE(ADOLC_DEBUG,1,[ADOL-C debug mode])
241fi
242
243AC_MSG_CHECKING(whether the default adouble constructor should initialize the value to 0)
244AC_ARG_ENABLE(stdczero,
245              [
246AS_HELP_STRING([--disable-stdczero],[adouble default constructor does not initialize the value to zero
247(improves performance but yields incorrect results for implicit array initializations, see manual) [default=enabled]])],
248  [
249  adolc_stdczero=no
250  AC_MSG_RESULT(no)
251  ],
252  [
253  adolc_stdczero=yes
254  AC_MSG_RESULT(yes)
255  ])
256
257if test x$adolc_stdczero == xyes; then
258AC_DEFINE(ADOLC_ADOUBLE_STDCZERO,1,[ADOL-C adouble zeroing mode])
259fi
260
261AC_MSG_CHECKING(whether the adouble variables have a late initialize option for functions like malloc/realloc)
262AC_ARG_ENABLE(lateinit,
263              [
264AS_HELP_STRING([--enable-lateinit],[adouble constructors need to be called. With malloc or realloc that is not the case. With this option the adouble can do a late initialization.) [default=disabled]])],
265  [
266  adolc_late_init=yes
267  AC_MSG_RESULT(yes)
268  ],
269  [
270  adolc_late_init=no
271  AC_MSG_RESULT(no)
272  ])
273
274if test x$adolc_late_init == xyes; then
275AC_DEFINE(ADOLC_ADOUBLE_LATEINIT,1,[ADOL-C adouble late initialization mode])
276fi
277
278AC_MSG_CHECKING(whether errno is thread save)
279AC_ARG_ENABLE(tserrno,
280              [
281AS_HELP_STRING([--enable-tserrno],[use errno as thread number cache [default=no]])],
282  [
283  adolc_tserrno=$enableval
284  AC_MSG_RESULT($adolc_tserrno)
285   ],
286  [
287  adolc_tserrno=no
288  AC_MSG_RESULT(no)
289  ])
290
291if test x$adolc_tserrno == xyes ; then
292AC_DEFINE(ADOLC_THREADSAVE_ERRNO,1,[ADOL-C thread save errno mode])
293fi
294
295AC_MSG_CHECKING(which flag to use to enable OpenMP)
296AC_ARG_WITH(openmp-flag,
297            [AS_HELP_STRING([--with-openmp-flag=FLAG],
298                            [use FLAG to enable OpenMP at compile time [default=none]])],
299            [ac_adolc_openmpflag=$withval
300             AC_MSG_RESULT($ac_adolc_openmpflag)],
301            [ac_adolc_openmpflag=""
302             AC_MSG_RESULT(none)])
303
304AX_BOOST_BASE([1.54],[boost_new=yes],[boost_new=no])
305if test x$boost_new = xyes ; then
306CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
307AC_LANG_PUSH([C++])
308AC_CHECK_HEADERS([boost/pool/pool_alloc.hpp])
309AC_LANG_POP([C++])
310AX_BOOST_SYSTEM
311LDFLAGS="$LDFLAGS $BOOST_LDFLAGS $BOOST_SYSTEM_LIB"
312fi
313
314if test "x$want_boost" = xyes -a "x$boost_new" = xyes -a "x$ac_cv_header_boost_pool_pool_alloc_hpp" = xyes -a "x$link_system" = xyes ; then
315    using_boost_pool=yes
316    USE_BOOST_POOL="#define USE_BOOST_POOL 1"
317else
318    using_boost_pool=no
319    USE_BOOST_POOL="#define USE_BOOST_POOL 0"
320fi
321AC_SUBST(USE_BOOST_POOL)
322
323if test "x$using_boost_pool" = xyes -a "x$ac_adolc_openmpflag" = x ; then
324   AC_DEFINE(BOOST_POOL_NO_MT,1,[Boost pool should not assume multithreading])
325fi
326
327# ADOL-C Sparse facility
328AC_MSG_CHECKING(whether to build sparse drivers)
329AC_ARG_ENABLE(sparse,
330            [
331AS_HELP_STRING([--enable-sparse],[build sparse drivers [default=disabled]])],
332            [sparse=$enableval
333             AC_MSG_RESULT($sparse)],
334            [sparse="no"
335             AC_MSG_RESULT(no)])
336
337COLPACK_CONF
338
339AM_CONDITIONAL(SPARSE,[test x${sparse} = xyes])
340
341if test x$sparse = xyes ; then
342   AC_DEFINE(SPARSE,[1],[Define 1 if sparse derivative propagation is to be enabled])
343fi
344
345# ADOL-C Examples
346AC_MSG_CHECKING(whether to build documented examples)
347AC_ARG_ENABLE(docexa,
348            [
349AS_HELP_STRING([--enable-docexa],[build documented examples [default=disabled]])],
350            [docexa=$enableval
351             AC_MSG_RESULT(yes)],
352            [docexa="no"
353             AC_MSG_RESULT(no)])
354AM_CONDITIONAL(DOCEXA,[test x${docexa} = xyes])
355
356AC_MSG_CHECKING(whether to build additional examples)
357AC_ARG_ENABLE(addexa,
358            [AS_HELP_STRING([--enable-addexa],
359                            [build additional examples [default=disabled]])],
360            [addexa=$enableval
361             AC_MSG_RESULT(yes)],
362            [addexa="no"
363             AC_MSG_RESULT(no)])
364AM_CONDITIONAL(ADDEXA,[test x${addexa} = xyes])
365
366AC_MSG_CHECKING(whether to build parallel example)
367AC_ARG_ENABLE(parexa,
368            [AS_HELP_STRING([--enable-parexa],
369                            [build parallel example [default=disabled], if enabled -with-openmp-flag=FLAG required])],
370            [parexa=$enableval
371             AC_MSG_RESULT(yes)],
372            [parexa="no"
373             AC_MSG_RESULT(no)])
374AM_CONDITIONAL(PAREXA,[test x${parexa} = xyes])
375
376# ADOL-C Compilation flags
377AC_MSG_CHECKING(which CFLAGS to use)
378AC_ARG_WITH(cflags,
379            [AS_HELP_STRING([--with-cflags=FLAGS],
380                            [use CFLAGS=FLAGS (default: -O2)])],
381            [ac_adolc_cflags="$withval"
382             if test x${adolc_debug} == xyes ||
383                test x${adolc_harddebug} == xyes ; then
384                ac_adolc_cflags="$ac_adolc_cflags -g -O0"
385             fi
386             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
387             AC_SUBST(ac_adolc_cflags)
388             AC_MSG_RESULT($ac_adolc_cflags)],
389            [if test "$ac_shell_cflags" = "not_set"; then
390                ac_adolc_cflags="-O2"
391                if test x${adolc_debug} == xyes ||
392                   test x${adolc_harddebug} == xyes ; then
393                   ac_adolc_cflags="-g -O0 -Wall -ansi"
394                fi
395             else
396                ac_adolc_cflags="$CFLAGS"
397             fi
398             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
399
400             AC_SUBST(ac_adolc_cflags)
401             AC_MSG_RESULT($ac_adolc_cflags)])
402
403AC_MSG_CHECKING(which CXXFLAGS to use)
404AC_ARG_WITH(cxxflags,
405            [AS_HELP_STRING([--with-cxxflags=FLAGS],
406                            [use CXXFLAGS=FLAGS (default: -O2)])],
407            [ac_adolc_cxxflags="$withval"
408             if test x${adolc_debug} == xyes ||
409                test x${adolc_harddebug} == xyes ; then
410                ac_adolc_cxxflags="$ac_adolc_cxxflags -g -O0"
411             fi
412             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
413             AC_SUBST(ac_adolc_cxxflags)
414             AC_MSG_RESULT($ac_adolc_cxxflags)],
415            [if test "$ac_shell_cxxflags" = "not_set"; then
416                ac_adolc_cxxflags="-O2"
417                if test x${adolc_debug} == xyes ||
418                   test x${adolc_harddebug} == xyes ; then
419                   ac_adolc_cxxflags="-g -O0 -Wall"
420                fi
421             else
422                ac_adolc_cxxflags="$CXXFLAGS"
423             fi
424             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
425            AC_SUBST(ac_adolc_cxxflags)
426            AC_MSG_RESULT($ac_adolc_cxxflags)])
427
428MPI_CONF_POST
429AMPI_CONF
430
431AC_ARG_WITH(soname,
432            [AS_HELP_STRING([--with-soname=NAME],
433              [user can choose what to call his library here [default: if ampi enabled then adolc_ampi otherwise adolc]])],
434      [adolclib=$withval])
435
436AC_SUBST(adolclib)
437
438AC_MSG_CHECKING(whether tape_doc should compute values as it prints the tape contents)
439AC_ARG_ENABLE(tapedoc_values,
440              [
441                AS_HELP_STRING([--disable-tapedoc-values],
442                               [should the tape_doc routine compute the values as it interprets and prints the tape contents [default=enabled]])],
443  [
444  tapedoc_values=no
445  ],
446  [
447  tapedoc_values=yes
448  ])
449AC_MSG_RESULT($tapedoc_values)
450
451if test x$tapedoc_values == xyes; then
452AC_DEFINE(ADOLC_TAPE_DOC_VALUES,1,[ADOL-C tape_doc routine computes values])
453fi
454
455###########################################################################
456#                      COIN_PATCH_LIBTOOL_CYGWIN                          #
457###########################################################################
458
459# Patches to libtool for cygwin. Lots for cl, a few for GCC.
460# For cl:
461# - cygpath is not correctly quoted in fix_srcfile_path
462# - paths generated for .lib files is not run through cygpath -w
463
464#
465# REQUIRED FOR COMPILATION WITH CYGWIN !!!
466#
467 
468
469AC_DEFUN([AC_COIN_PATCH_LIBTOOL_CYGWIN],
470[ case "$CXX" in
471    clang* | */clang*)
472        # do nothing but don't want to accidentally match the 'cl' patterns below
473        ;;
474    cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
475      AC_MSG_NOTICE(Applying patches to libtool for cl compiler)
476      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
477          -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
478          -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
479          -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
480          -e 's%lib /OUT:%lib -OUT:%' \
481          -e "s%cygpath -w%$CYGPATH_W%" \
482          -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo '"$mydos2unix"'\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
483          -e 's/$AR t/lib -nologo -list/' \
484          -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
485          -e 's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
486          -e 's%old_archive_cmds="lib -OUT:\\$oldlib\\$oldobjs\\$old_deplibs"%old_archive_cmds="if test -r \\$oldlib; then bla=\\"\\$oldlib\\"; else bla=; fi; lib -OUT:\\$oldlib \\\\\\$bla\\$oldobjs\\$old_deplibs"%' \
487      libtool > conftest.bla
488
489      mv conftest.bla libtool
490      chmod 755 libtool
491      ;;
492    *)
493      AC_MSG_NOTICE(Applying patches to libtool for GNU compiler)
494      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
495          -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
496          -e 's|libext="lib"|libext="a"|' \
497      libtool > conftest.bla
498
499      mv conftest.bla libtool
500      chmod 755 libtool
501      ;;
502  esac ]) # COIN_PATCH_LIBTOOL_CYGWIN
503 
504
505# output
506AC_CONFIG_FILES(Makefile
507                ADOL-C/Makefile
508                ADOL-C/include/Makefile
509                ADOL-C/include/adolc/Makefile
510                ADOL-C/include/adolc/internal/adolc_settings.h
511                ADOL-C/include/adolc/drivers/Makefile
512                ADOL-C/include/adolc/internal/Makefile
513                ADOL-C/include/adolc/lie/Makefile
514                ADOL-C/include/adolc/sparse/Makefile
515                ADOL-C/include/adolc/tapedoc/Makefile
516                ADOL-C/src/Makefile
517                ADOL-C/src/drivers/Makefile
518                ADOL-C/src/lie/Makefile
519                ADOL-C/src/sparse/Makefile
520                ADOL-C/src/tapedoc/Makefile
521                ADOL-C/doc/version.tex
522                ADOL-C/examples/Makefile
523                ADOL-C/examples/additional_examples/Makefile
524                ADOL-C/examples/additional_examples/cuda/Makefile
525                ADOL-C/examples/additional_examples/clock/Makefile
526                ADOL-C/examples/additional_examples/checkpointing/Makefile
527                ADOL-C/examples/additional_examples/ext_diff_func/Makefile
528                ADOL-C/examples/additional_examples/fixpoint_exam/Makefile
529                ADOL-C/examples/additional_examples/hessmat/Makefile
530                ADOL-C/examples/additional_examples/lie/Makefile
531                ADOL-C/examples/additional_examples/lufact/Makefile
532                ADOL-C/examples/additional_examples/openmp_exam/Makefile
533                ADOL-C/examples/additional_examples/scal/Makefile
534                ADOL-C/examples/additional_examples/speelpenning/Makefile
535                ADOL-C/examples/additional_examples/taylor/Makefile
536                ADOL-C/examples/additional_examples/detexam/Makefile
537                ADOL-C/examples/additional_examples/helm/Makefile
538                ADOL-C/examples/additional_examples/lighthouse/Makefile
539                ADOL-C/examples/additional_examples/ode/Makefile
540                ADOL-C/examples/additional_examples/sparse/Makefile
541                ADOL-C/examples/additional_examples/tapesave/Makefile
542                ADOL-C/examples/additional_examples/pow/Makefile
543                ADOL-C/examples/additional_examples/timing/Makefile
544                ADOL-C/examples/additional_examples/param/Makefile
545                ADOL-C/test/Makefile
546                MSVisualStudio/v14/sparse/config.h
547                MSVisualStudio/v14/nosparse/config.h
548                MSVisualStudio/v14/x64/sparse/config.h
549                MSVisualStudio/v14/x64/nosparse/config.h
550                adolc.spec
551                adolclib.pc
552)
553
554AC_OUTPUT
555
556#call libtool for cygwin
557AC_COIN_PATCH_LIBTOOL_CYGWIN
558warn=false
559# echo configuration
560echo \
561"
562-----------------------------------------------------------------------------
563Configuration:
564
565  C compiler:                         ${CC}
566  C++ compiler:                       ${CXX}
567  Linker:                             ${LD}
568  Source code location:               `pwd`
569  Install path:                       ${prefix}
570 
571  CFLAGS:                             ${ac_adolc_cflags}
572  CXXFLAGS:                           ${ac_adolc_cxxflags}
573
574  Use Boost pool allocator:           ${using_boost_pool}
575  Use ADOL-C debug mode:              ${adolc_debug}
576  Use ADOL-C hard debug mode:         ${adolc_harddebug}
577  Zero value in adouble default ctor: ${adolc_stdczero}"
578
579if [[ "x${ac_adolc_openmpflag}" != "x" ]] ; then
580    echo \
581"  Access thread number via errno:     ${adolc_tserrno}"
582fi
583
584echo \
585"  Use ADOL-C safe extern mode:        ${adolc_safe_extern}
586  Use ADOL-C late init mode:          ${adolc_late_init}
587
588  Build sparse drivers:               ${sparse}
589  Build with adjoinable MPI support:  ${adolc_ampi_support}
590  Build with ColPack:                 ${have_colpack}"
591if test x$sparse = xyes && test x$have_colpack = xno; then
592    echo -e \
593"  \033@<:@1;31mCompressed sparse structures will not be available
594  Only sparsity patterns can be computed\033@<:@0m"
595    warn=true
596fi
597echo
598
599echo \
600"  Build documented examples:          ${docexa}
601  Build additional examples:          ${addexa}
602  tape_doc routine computes values:   ${tapedoc_values}
603
604  See ADOL-C/src/config.h for further configuration information.
605-----------------------------------------------------------------------------"
606
607# check for make install problems resulting from missing write permission
608pdir=${prefix}
609writable=true
610while test "x${pdir}" != "x/" ; do
611    if test -e ${pdir} && test ! -w ${pdir}; then
612        writable=false
613        break
614    elif test ! -e ${pdir} ; then
615        pdir=`dirname ${pdir}`
616    else
617        break
618    fi
619done
620if test "x${pdir}" == "x/" ; then
621    writable=false
622fi
623if ! ${writable} ; then
624    echo -e \
625"  \033@<:@1;31mPrefix ${prefix} not writable
626  please run ./configure --prefix=DIR
627  with a writable directory path otherwise administrator privileges
628  will be required to run \`make install'\033@<:@0m"
629    warn=true
630fi
631
632case ${prefix} in
633   ${HOME}|${HOME}/*)
634if $warn ; then
635    for (( i=5; i>0; i-- )); do
636        echo -ne "\rPlease read the above messages carefully, continuing in ${i} seconds"
637        sleep 1
638    done
639    echo -e "\rPlease read the above messages carefully                                 "
640fi
641echo \
642"
643*****************************************************************************
644
645  To successfully compile and run programs using the ADOL-C shared library do
646  the following things:
647     compiling:
648        * add \"-I${prefix}/include\" to your compiler call
649     linking:
650        * add \"-L${libdir} -l$adolclib\" to your linker call
651        * extend your linker call by \"-Wl,--rpath -Wl,${libdir}\"
652          (if you wish to skip the point \"executing\")
653     executing (do one of the following things):
654        * add ${libdir} to your LD_LIBRARY_PATH variable
655        * ask your system administrator for adding ${libdir} to
656          the global file containing library search paths (/etc/ld.so.conf)
657
658     (or use the static library by replacing
659        \"-L${libdir} -l$adolclib\" with
660        \"${libdir}/lib$adolclib.a\" when linking)
661
662  See README for instructions on how to change to a nonlocal installation!
663
664*****************************************************************************
665"
666;;
667esac
668if test "x$enable_static" != "xno" ; then
669echo \
670" Linking a user program with a static ADOL-C library will always result
671  in a segmentation fault. Please always use the shared library.
672*****************************************************************************
673"
674fi
Note: See TracBrowser for help on using the repository browser.