source: trunk/configure.ac @ 762

Last change on this file since 762 was 762, checked in by mbanovic, 5 months ago

Merged branch "medipacksupport" from "git" into "svn"

The following commits were merged:

commit 0d1b5eec2cca8afdeea3cdffa196efb6cfd60a53
Merge: 72d114b 33bfdb5
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Nov 5 10:03:04 2018 +0000

Merge branch 'medipackSupport' into 'medipacksupport'

Medipack support

See merge request adol-c/adol-c!26

commit 33bfdb5a006c782489bfef1b651ca3bdbceefaf2
Merge: ac55eab cf82982
Author: Max Sagebaum <max.sagebaum@…>
Date: Tue Oct 30 11:19:31 2018 +0100

Merge branch 'medipackSupport' into temp

commit ac55eab9dd8cb8c84926ee56456076392a047c1a
Merge: 72d114b caaac60
Author: Max Sagebaum <max.sagebaum@…>
Date: Tue Oct 30 11:14:09 2018 +0100

Merge remote-tracking branch 'origin/master' into temp

commit cf82982421aaa7d83405ffa3d0c9b6ef88251d0c
Merge: 6aeca20 caaac60
Author: Max Sagebaum <max.sagebaum@…>
Date: Tue Oct 30 11:13:25 2018 +0100

Merge remote-tracking branch 'origin/master' into medipackSupport

commit 6aeca205c2448b4bbc915eb76153ebde19448573
Author: Max Sagebaum <max.sagebaum@…>
Date: Tue Oct 23 22:30:28 2018 +0200

Added suport for ZOS, FOS, FOV forward and reverse.

commit caaac60da4c61b370d106c68064d38c42a7cb6e3
Merge: cc2e0b3 70fc288
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Oct 8 08:53:40 2018 +0000

Merge branch 'fix_adtl_hov_refcntr' into 'master'

Fix undefined reference to adtl_hov::refcounter::refcnt

See merge request adol-c/adol-c!24

commit 70fc288b9ab95b16d3179fcf239ee2208ae1a2c4
Author: Jean-Paul Pelteret <jppelteret@…>
Date: Mon Oct 1 20:53:03 2018 +0200

Fix undefined reference to adtl_hov::refcounter::refcnt

commit cc2e0b3154fb6e62580def4501c4cf3f3d8e32ef
Merge: d7400f5 7c7f24b
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Oct 1 12:26:39 2018 +0000

Merge branch 'docu' into 'master'

Refactor tapeless to traceless

See merge request adol-c/adol-c!23

commit ca397962cde23bde80e03924893e09c84d8728bf
Merge: 9cbc432 d7400f5
Author: Max Sagebaum <max.sagebaum@…>
Date: Fri Sep 28 10:07:41 2018 +0200

Merge remote-tracking branch 'origin/master' into medipackSupport

commit 9cbc4324e0d3e19f97ba5c5474121f0189e60f83
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Sep 27 14:38:30 2018 +0200

Missing MeDiPack? initialization on trace_on.

commit 76c30290365830d2370a354af949f3bf42df3885
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Sep 27 09:55:42 2018 +0200

Null pointer fix for initialization.

commit 7c7f24b25479870d58ff19d78a6e394ca28ddb58
Author: mflehmig <martin.schroschk@…>
Date: Thu Sep 20 13:16:06 2018 +0200

Refactor tapeless to traceless

As far as I can see, the official wording is traceless forward mode.
Additonally, the latex label and refs changed to 'traceless'.

commit 72d114b7ac42b8ac493030cedd1df8c9746ba5d4
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Oct 19 09:25:19 2017 +0200

Added support for MeDiPack? library.

Enable it with the configure options:
--enable-medipack --with-medipack=<path to MeDiPack?>

Tutorial on a how to use will follow.

commit b4ca76279d28407f29901d40953d02a0c5c9140e
Author: Max Sagebaum <max.sagebaum@…>
Date: Mon May 7 14:45:13 2018 +0200

Added support for cbrt function.

commit bc7b8ca61865058fac097410fd94a44fba281131
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Mar 1 10:31:18 2018 +0100

Changes for new interface.

commit cd1e82778c8540221b24559d5097bf6d00597e19
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Nov 16 14:31:07 2017 +0100

Changes to new MeDiPack? interface for adjoint values.

commit 55bcb0ffd5a9496817bffac0bd2c9489ed8ce992
Author: Max Sagebaum <max.sagebaum@…>
Date: Thu Oct 19 09:25:19 2017 +0200

Added support for MeDiPack? library.

Enable it with the configure options:
--enable-medipack --with-medipack=<path to MeDiPack?>

Tutorial on a how to use will follow.

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