source: branches/MPI/configure.ac @ 240

Last change on this file since 240 was 240, checked in by kulshres, 8 years ago

merge mpi sources from gitclone

The mpi support has been tested only in linux/unix environments.
No support at the moment for Visual Studio or any other systems

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

The following commits are merged:

commit 311273b86bba6700332c32dc384132e840fddebe
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 9 13:59:57 2011 +0200

correct inclusion of headers

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

commit 045e1543da434ac50d1a353bd6c076b60edccd3a
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 9 13:14:42 2011 +0200

remove unbalanced barrier

it is not needed there anyway.

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

commit cfba8b1e574e0758d5877f4eff60a9279a165a28
Author: Benjamin Letschert <letschi@…>
Date: Mon Jun 6 16:35:53 2011 +0200

Correct checking if defined mpi/mpi.h or mpi.h

commit 846b5ff6f470731bc19a5d29a4a4ade8391118e1
Author: Benjamin Letschert <letschi@…>
Date: Mon Jun 6 15:23:16 2011 +0200

Adding mpi-parallel drivers and interfaces for C

Signed-off-by: Benjamin Letschert <letschi@…>

commit 50be816100ac42d9df820fec78e36f8dafe4a6e6
Author: Benjamin Letschert <letschi@…>
Date: Mon Jun 6 12:41:23 2011 +0200

Changed send/recv to bcast/reduce for efficiency.

commit c388ac049f05e2db03afc358dbf698223e3f6643
Author: Benjamin Letschert <letschi@…>
Date: Mon Jun 6 12:39:58 2011 +0200

Refactored forward and reverse interfaces into their own file.

Signed-off-by: Benjamin Letschert <letschi@…>

commit c3894d61704520129b79bfd340adfe00a3ed6394
Author: Benjamin Letschert <letschi@…>
Date: Wed Jun 1 15:52:49 2011 +0200

Adding broadcast and reduce functionality to parallel adol-c

commit 8f1c2534d0868aa8ededa2b954337bda43e09f46
Author: Benjamin Letschert <letschi@…>
Date: Wed Jun 1 14:07:42 2011 +0200

Bugfix for index and nonlinear index domains by sending data

commit 6080e85cd973eb782cf019b58ddadf110aee4232
Author: Benjamin Letschert <letschi@…>
Date: Fri May 27 12:40:54 2011 +0200

correct checking for C++ inside adolc_mpi.h

commit c64771e2fc4a95664a747a9f68f8dcca8c324a57
Author: Benjamin Letschert <letschi@…>
Date: Thu May 26 14:40:22 2011 +0200

Change Index Elements into locints in uni5_for.c

commit fd8f8f4c7f67104cb3ea0c66474fc2c0eeb41997
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Mar 23 13:55:00 2011 +0100

typo in the source of recv in parallel sparse_hess

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

commit 113ca4dc1694e57210b1a8db9c2625c0d2d13239
Author: Maria Brune <brunem@…>
Date: Wed Mar 23 13:06:40 2011 +0100

add MPICPPFLAGS for compilation in sparse subdirectory too

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

commit f2ebec2a1b0787fd669db4baf0ee6a28a9ca8ff7
Author: Maria Brune <brunem@…>
Date: Wed Mar 23 12:53:04 2011 +0100

correct the conditional compilation for mpi

these are leftovers from

commit 81a8d19bb425c3526d939933f243e525ac99e0c9
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Mar 8 16:37:00 2011 +0100

allow user to give path to mpi headers and libraries

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

commit ddbebc1b0028b17b50892c181160e9168cfc176e
Author: Maria Brune <brunem@…>
Date: Fri Mar 18 17:27:59 2011 +0100

Handle the pattern only case in all processes

for sparse_jac with options[2] == -1 and for sparse_hess with
repeat == -1, only the pattern is computed and stored. The Jacobian
or the Hessian itself is not propagated. This should be handled in
all processes, otherwise the id != 0 processes will continue to try
to propogate derivatives and hang in a send/recv.

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

commit 4af90111e63efbc92e9bc41d8060941e06f5f426
Author: Maria Brune <brunem@…>
Date: Fri Mar 18 17:25:27 2011 +0100

Errors are fatal in parallel case

in case the error happens only in one process, all other processes
will hang. So make the errors fatal so that we abort.

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

commit 89d8e7d8d676304e1bccb8742b8cb20e2e27e702
Author: Benjamin Letschert <letschi@…>
Date: Wed Mar 9 14:56:14 2011 +0100

get rid of compiler warning about deprecated conversions

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

commit 81a8d19bb425c3526d939933f243e525ac99e0c9
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Mar 8 16:37:00 2011 +0100

allow user to give path to mpi headers and libraries

there are new flags --with-mpi-includedir=PATH --with-mpi-libdir=PATH
for providing these two paths for compilation in case mpi is not
installed in a default location.

commit f3cd62c952c2d67ae766b30b8aeb23053a606f62
Author: Benjamin Letschert <letschi@…>
Date: Mon Feb 28 12:21:38 2011 +0100

Avoid potential segmentation fault

commit ced5627653ae6faf36d033667a58d6a8f6ff685a
Author: Benjamin Letschert <letschi@…>
Date: Fri Feb 25 12:40:21 2011 +0100

Remove unused variable

commit 57c288ffdf600ffc5316ab09b9d38a90d84505be
Author: Benjamin Letschert <letschi@…>
Date: Fri Feb 25 12:35:08 2011 +0100

Remove code that was already commented out

commit f5e1baaea72caa4b57ec46f1d0375aab594f643f
Author: Benjamin Letschert <letschi@…>
Date: Fri Feb 25 12:32:33 2011 +0100

Add missing index variable declaration

commit e9b954c010231ed8570af52b8e235fe5c84be85b
Author: Benjamin Letschert <letschi@…>
Date: Fri Feb 25 12:31:44 2011 +0100

Make it more explicitly clear that MPI is used.

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

commit f9c0f75d0c7b818f25023a33873ebe99c93e1810
Author: Benjamin Letschert <letschi@…>
Date: Fri Feb 25 12:30:17 2011 +0100

Adding parallel computing for sparse_hess and sparse_jac

hess_pat and jac_pat are also computed in parallel by ind_dom and nonl_dom

commit 2b02eddaf9c2334150334b63fe4b927fdece858c
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Feb 16 15:32:57 2011 +0100

Set flag to check whether mpi was actually initialized

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

commit d9d36d14f34163e16d91e0f10236e38298f03fd6
Author: Benjamin Letschert <letschi@…>
Date: Fri Feb 11 21:29:22 2011 +0100

Update and fix operations send_data and receive_data in fo_rev.c, ho_rev.c and uni5_for.c

commit 553f47ddcb015209ae667d5415855cda8e68274e
Author: Benjamin Letschert <letschi@…>
Date: Thu Feb 3 14:19:48 2011 +0100

Adding parallel zos_forward, fos_forward, fos_reverse, hos_reverse and fov_reverse

added at adolc_mpi.h and adolc_mpi.cpp

commit 9171fd1e1221e1fdc954deb7b1443867262ea1cf
Author: Benjamin Letschert <letschi@…>
Date: Thu Feb 3 14:10:07 2011 +0100

Adding parallel computing jacobian

new function jacobian in adolc_mpi.h and adolc_mpi.cpp
fixing a bug for jacobian in fov_reverse and hos_reverse

commit 95df1770f7026d11ec5c801299ae93c1657a112d
Author: Benjamin Letschert <letschi@…>
Date: Thu Jan 27 16:51:11 2011 +0100

add missing send in hos_reverse

commit 5afa0be6e103b204042f91703b9ee0e42c648f1c
Author: Benjamin Letschert <letschi@…>
Date: Thu Jan 27 16:50:26 2011 +0100

fov_forward and fov_reverse parallel

commit cf560a6f828ca43c25471da240c12c3b5df889cb
Author: Benny <letschi@letschi-NF61S-M2A.(none)>
Date: Wed Jan 19 20:37:41 2011 +0100

ADOLC_MPI-Barrier-function added to ADOLC-MPI

adding new tape entry "barrier_op"
modified files: adolc_mpi.h adolc_mpi.cpp uni5_for.c fo_rev.c ho_rev.c oplate.h tapedoc.c

commit 9a02525e6baada5332ab3a71119c9ad3ae262d33
Author: Benny <letschi@letschi-NF61S-M2A.(none)>
Date: Wed Jan 19 19:38:54 2011 +0100

Parallel computing hessian

Added source for parallel computing hessian matrix by using MPI-Routines
adding Send and Receive Operations for hos_reverse

commit 7767f1e0ae4337f92e60e5d7d9b6f275c9bb8ef7
Author: Benny <letschi@letschi-NF61S-M2A.(none)>
Date: Wed Jan 19 19:19:23 2011 +0100

Update gradiant parallel computing

Adjoint Tailorbuffer entries are added together

commit a0f3bc4260eda3fca02cc8d65d8cf6675d9efd75
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Nov 30 11:44:00 2010 +0100

do not free user provided pointers

since setTapeInfo{Jac,Hess}Sparse() calls freeSparse{Jac,Hess}Infos()
any pointers stored in the tapeInfos.s[JH]infos structure will be freed.
This means we should do deep copy of the pattern in set_HP provided by the
user. similarly we should return a deep copied pointer in get_HP, as the
user may free it whenever they want.

similar use of deep copying before any setTapeInfosHessSparse() call
should be done in order to avoid saving a free'd pointer again. Only HP
is important at the moment, everything else is NULL or just allocated.

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

commit 7c60e5beeb147be3dea3d429c77e12c1a3d0d343
Author: Benjamin Letschert <letschi@…>
Date: Thu Nov 18 12:56:45 2010 +0100

Update configuration for install MPI and deleting TapelessMode? for MPI
change Makefile to install adolc_mpi.h only if mpi ist installed
delete TapelessMode? by data transmission for mpi

commit 5fcf2d78f7d22c9192006ce337139f0d15d11733
Author: Benjamin Letschert <letschi@…>
Date: Thu Nov 18 12:56:45 2010 +0100

Changing MPI-Compiling
Change to Compile ADOL-C-MPI-functions only if MPI is installed on main system

commit 8897f767abae126accaa345cd7fa39fbb4142ab9
Author: Benjamin Letschert <letschi@…>
Date: Tue Nov 16 11:21:18 2010 +0100

First use of MPI

Simple MPI-Functions included for parallel computing;
tested for fos-, zos-forward and fos-reverse method to compute parallel gradient
in speelpennings function

Signed-off-by: Benjamin Letschert <letschi@…>

  • Property svn:keywords set to Author Date Id Revision
File size: 20.1 KB
Line 
1##############################################################################
2# configure.ac -- Process this file with autoconf to produce configure
3# Revision: $Id: configure.ac 240 2011-06-09 12:17:02Z 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], [2])
12define([ADOLC_LVL], [0])
13
14AC_PREREQ(2.57)
15AC_INIT(adolc,
16        ADOLC_VER.ADOLC_SUB.ADOLC_LVL-trunk-mpi,
17        [adol-c@list.coin-or.org])
18AC_REVISION($Revision: 240 $)
19AC_CONFIG_SRCDIR([ADOL-C/src/adolc.h])
20AC_CONFIG_AUX_DIR(autoconf)
21AC_CONFIG_HEADERS([ADOL-C/src/config.h])
22AC_PREFIX_DEFAULT(${HOME}/adolc_base)
23AM_INIT_AUTOMAKE([dist-bzip2])
24
25if test "x$CFLAGS" == x ; then
26    ac_shell_cflags="not_set"
27else
28    ac_shell_cflags="$CFLAGS"
29fi
30if test "x$CXXFLAGS" == x ; then
31    ac_shell_cxxflags="not_set"
32else
33    ac_shell_cxxflags="$CXXFLAGS"
34fi
35
36# checks for programs
37AC_PROG_CXX
38AC_PROG_CC
39AC_PROG_CPP
40AC_PROG_INSTALL
41AC_PROG_LN_S
42AC_PROG_MAKE_SET
43AC_LIBTOOL_WIN32_DLL
44AC_PROG_LIBTOOL
45DOLT
46
47AC_CHECK_SIZEOF([void *])
48if test "x$ac_cv_sizeof_void_p" = "x8" ; then
49   _lib=lib64
50else
51   _lib=lib
52fi
53libdir='${prefix}/${_lib}'
54AC_SUBST(_lib)
55AC_SUBST(libdir)
56
57# checks for header files
58AC_HEADER_STDC
59AC_HEADER_TIME
60AC_HEADER_STDBOOL
61AC_CHECK_HEADERS([stddef.h stdlib.h stdio.h string.h unistd.h sys/timeb.h])
62
63# checks for types
64AC_C_CONST
65AC_C_INLINE
66AC_TYPE_SIZE_T
67AC_STRUCT_TM
68
69# Checks for library functions
70AC_FUNC_MALLOC
71AC_FUNC_REALLOC
72AC_CHECK_FUNCS([floor ftime pow sqrt strchr strtol])
73
74# substitutions
75AC_SUBST(ac_aux_dir)
76
77# Checks for libraries
78AC_CHECK_LIB([m], [pow])
79
80# ADOL-C configuration
81AC_DEFINE(ADOLC_VERSION,ADOLC_VER,[ADOL-C Version])
82AC_DEFINE(ADOLC_SUBVERSION,ADOLC_SUB,[ADOL-C Subversion])
83AC_DEFINE(ADOLC_PATCHLEVEL,ADOLC_LVL,[ADOL-C Patchlevel])
84ADOLC_VERSION=ADOLC_VER
85ADOLC_SUBVERSION=ADOLC_SUB
86ADOLC_PATCHLEVEL=ADOLC_LVL
87AC_SUBST(ADOLC_VERSION)
88AC_SUBST(ADOLC_SUBVERSION)
89AC_SUBST(ADOLC_PATCHLEVEL)
90
91AC_MSG_CHECKING(whether to use ADOL-C debug mode)
92AC_ARG_ENABLE(debug,
93              [
94AS_HELP_STRING([--enable-debug],[enable ADOL-C debug mode [default=no]])],
95  [AC_DEFINE(ADOLC_DEBUG,1,[ADOL-C debug mode])
96   AC_MSG_RESULT(yes)
97   adolc_debug="yes"],
98  [AC_MSG_RESULT(no)
99   adolc_debug="no"])
100
101AC_MSG_CHECKING(whether to use ADOL-C hard debug mode)
102AC_ARG_ENABLE(harddebug,
103              [
104AS_HELP_STRING([--enable-harddebug],[enable ADOL-C hard debug mode
105 [default=no]])],
106  [AC_DEFINE(ADOLC_HARDDEBUG,1,[ADOL-C hard debug mode])
107   AC_DEFINE(ADOLC_DEBUG,1,[ADOL-C debug mode])
108   AC_MSG_RESULT(yes)
109   adolc_harddebug="yes"],
110  [AC_MSG_RESULT(no)
111   adolc_harddebug="no"])
112
113AC_MSG_CHECKING(whether standard adouble constructor shall zero value)
114AC_ARG_ENABLE(stdczero,
115              [
116AS_HELP_STRING([--enable-stdczero],[adouble standard constructor zeros value
117(at the cost of performance) [default=no]])],
118  [AC_DEFINE(ADOLC_ADOUBLE_STDCZERO,1,[ADOL-C adouble zeroing mode])
119   AC_MSG_RESULT(yes)
120   adolc_stdczero="yes"],
121  [AC_MSG_RESULT(no)
122   adolc_stdczero="no"])
123
124AC_MSG_CHECKING(whether errno is thread save)
125AC_ARG_ENABLE(tserrno,
126              [
127AS_HELP_STRING([--enable-tserrno],[use errno as thread number cache [default=no]])],
128  [AC_DEFINE(ADOLC_THREADSAVE_ERRNO,1,[ADOL-C thread save errno mode])
129   AC_MSG_RESULT(yes)
130   adolc_tserrno="yes"],
131  [AC_MSG_RESULT(no)
132   adolc_tserrno="no"])
133
134AC_MSG_CHECKING(whether external function call forces backup of all adoubles)
135AC_ARG_ENABLE(safe_extern,
136              [
137AS_HELP_STRING([--enable-safe-extern],[backup all adoubles before calling an external function [default=no]])],
138  [AC_DEFINE(ADOLC_SAFE_EXTERN,1,[ADOL-C safe extern mode])
139   AC_MSG_RESULT(yes)
140   adolc_safe_extern="yes"],
141  [AC_MSG_RESULT(no)
142   adolc_safe_extern="no"])
143
144# ADOL-C Sparse facility
145AC_MSG_CHECKING(whether to build sparse drivers)
146AC_ARG_ENABLE(sparse,
147            [
148AS_HELP_STRING([--enable-sparse],[build sparse drivers [default=disabled]])],
149            [sparse=$enableval
150             AC_MSG_RESULT(yes)],
151            [sparse="no"
152             AC_MSG_RESULT(no)])
153
154test "x${ac_pwd}" = x && ac_pwd=`pwd`
155abs_srcdir=`readlink -f ${ac_pwd}/${srcdir}`
156AC_ARG_WITH(colpack,
157        [
158AS_HELP_STRING([--with-colpack],[path to the colpack library and headers [default=${srcdir}/ThirdParty/ColPack]])],
159                [colpack=$withval],
160                [colpack=${abs_srcdir}/ThirdParty/ColPack])
161
162if test "x${_lib}" != xlib ; then
163   dirlist="${_lib} lib build/${_lib} build/lib"
164else
165   dirlist="${_lib} build/${_lib}"
166fi
167
168AC_LANG_PUSH([C++])
169for dir in $dirlist ; do
170    unset ac_cv_header_ColPackHeaders_h
171    COLPACK_CFLAGS="-I$colpack/$dir/../include"
172    COLPACK_LIBDIR="$colpack/$dir"
173    COLPACK_LIBS="-L$COLPACK_LIBDIR -lColPack -Wl,-rpath,$COLPACK_LIBDIR"
174    save_CPPFLAGS="$CPPFLAGS"
175    save_LIBS="$LIBS"
176    CPPFLAGS="$CPPFLAGS $COLPACK_CFLAGS"
177    LIBS="$COLPACK_LIBS $LIBS"
178    AC_MSG_CHECKING(for ColPack in $COLPACK_LIBDIR)
179    AC_CHECK_HEADER([ColPackHeaders.h],[have_colpackheaders=yes],[have_colpackheaders=no])
180    if test x$have_colpackheaders = xyes ; then
181        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ColPackHeaders.h>],
182                          [ColPack::GraphColoring g])],
183                       [have_colpack=yes
184                        AC_MSG_RESULT(linking with -lColPack succeeded)],
185                       [have_colpack=no,
186                        AC_MSG_RESULT(linking with -lColPack failed)])
187    else
188        have_colpack=no
189    fi
190    CPPFLAGS="$save_CPPFLAGS"
191    LIBS="$save_LIBS"
192    if test x$have_colpack = xyes ; then
193        break
194    fi
195done
196AC_LANG_POP([C++])
197AM_CONDITIONAL(HAVE_LIBCOLPACK,[test x$have_colpack = xyes])
198if test x$have_colpack = xyes; then
199   # test if the directories exists and what is the real path
200   # if not then we found ColPack in some standard location
201   # and these variables are useless
202   COLPACK_LIBDIR=`readlink -f $COLPACK_LIBDIR`
203   if test -n $COLPACK_LIBDIR ; then
204      colpack_incdir=`readlink -f $COLPACK_LIBDIR/../include`
205      if test -n $colpack_incdir ; then
206         COLPACK_CFLAGS="-I$colpack_incdir"
207      else
208         COLPACK_CFLAGS=""
209      fi
210      COLPACK_LIBS="-L$COLPACK_LIBDIR -lColPack -Wl,-rpath,$COLPACK_LIBDIR"
211   else
212      COLPACK_CFLAGS=""
213      COLPACK_LIBS=""
214   fi
215   # if the real path to ColPack is inside the ${srcdir}
216   # then we should statically link all ColPack objects inside libadolc
217   # it is likely that the srcdir is not needed anymore after make install
218   # and thus deleted thus no more ColPack to dynamically link to
219   # an external ColPack path is less likely to be removed
220   if echo $COLPACK_LIBDIR | grep -q ^${abs_srcdir} ; then
221       echo will link ColPack static as it was found in the source directory
222       test -d $COLPACK_LIBDIR/.tmp && rm -rf $COLPACK_LIBDIR/.tmp
223       mkdir -p $COLPACK_LIBDIR/.tmp/
224       mkdir -p $COLPACK_LIBDIR/.tmp/.libs
225       ( cd $COLPACK_LIBDIR/.tmp/ ; $AR x ../libColPack.a ; cp *.o .libs/
226         for i in *.o ; do j=`echo $i | sed 's/\.o/\.lo/' `
227                 cat >$j <<EOF
228# $j - a libtool object file
229# Generated by doltcompile, not libtool
230pic_object='.libs/$i'
231non_pic_object='$i'
232EOF
233        done
234        )
235       COLPACK_LIBS=`find "$COLPACK_LIBDIR/.tmp" -name \*.lo -printf "%p "`
236   fi
237   sparse=yes
238   echo "will build sparse drivers as linking with -lColPack succeeded"
239fi
240AM_CONDITIONAL(SPARSE,[test x${sparse} = xyes])
241
242if test x$sparse = xyes && test x$have_colpack = xyes; then
243        AC_DEFINE(HAVE_LIBCOLPACK,[1],[Define 1 if ColPack is available])
244else
245        COLPACK_CFLAGS=""
246        COLPACK_LIBS=""
247fi
248AC_SUBST(COLPACK_CFLAGS)
249AC_SUBST(COLPACK_LIBS)
250
251# ADOL-C with mpi
252AC_ARG_WITH(mpi-includedir,[AS_HELP_STRING([--with-mpi-includedir],[path to mpi headers [default=autodetect]])], [mpiinc=$withval], [mpiinc=auto])
253AC_ARG_WITH(mpi-libdir,[AS_HELP_STRING([--with-mpi-libdir],[path to mpi libs [default=autodetect]])], [mpilibdir=$withval], [mpilibdir=auto])
254
255if test x"$mpiinc" = xauto ; then
256MPICPPFLAGS=""
257else
258MPICPPFLAGS="-I${mpiinc}"
259fi
260if test x"$mpilibdir" = xauto ; then
261MPILIBS=""
262else
263MPILIBS="-L${mpilibdir}"
264fi
265
266save_CPPFLAGS="$CPPFLAGS"
267save_LIBS="$LIBS"
268CPPFLAGS="$CPPFLAGS $MPICPPFLAGS"
269LIBS="$LIBS $MPILIBS"
270AC_CHECK_HEADERS([mpi/mpi.h mpi.h],[
271AC_DEFINE(HAVE_MPI,1,[MPI is enabled])
272if test x = x"$LIBMPI"; then
273AC_CHECK_LIB(mpi, MPI_Init, [LIBMPI="-lmpi"])
274fi
275if test x = x"$LIBMPI"; then
276AC_CHECK_LIB(mpich, MPI_Init, [LIBMPI="-lmpich"])
277fi
278break
279])
280CPPFLAGS="$save_CPPFLAGS"
281LIBS="$save_LIBS"
282
283AC_SUBST(MPICPPFLAGS)
284AC_SUBST(MPILIBS)
285AC_SUBST(LIBMPI)
286AM_CONDITIONAL(HAVE_MPI,[test x != x"$LIBMPI"])
287if test x != x"$LIBMPI" ; then
288mpi=yes
289else
290mpi=no
291fi
292
293# ADOL-C Examples
294AC_MSG_CHECKING(whether to build documented examples)
295AC_ARG_ENABLE(docexa,
296            [
297AS_HELP_STRING([--enable-docexa],[build documented examples [default=disabled]])],
298            [docexa=$enableval
299             AC_MSG_RESULT(yes)],
300            [docexa="no"
301             AC_MSG_RESULT(no)])
302AM_CONDITIONAL(DOCEXA,[test x${docexa} = xyes])
303
304AC_MSG_CHECKING(whether to build additional examples)
305AC_ARG_ENABLE(addexa,
306            [AS_HELP_STRING([--enable-addexa],
307                            [build additional examples [default=disabled]])],
308            [addexa=$enableval
309             AC_MSG_RESULT(yes)],
310            [addexa="no"
311             AC_MSG_RESULT(no)])
312AM_CONDITIONAL(ADDEXA,[test x${addexa} = xyes])
313
314AC_MSG_CHECKING(whether to build parallel example)
315AC_ARG_ENABLE(parexa,
316            [AS_HELP_STRING([--enable-parexa],
317                            [build parallel example [default=disabled], if enabled -with-openmp-flag=FLAG required])],
318            [parexa=$enableval
319             AC_MSG_RESULT(yes)],
320            [parexa="no"
321             AC_MSG_RESULT(no)])
322AM_CONDITIONAL(PAREXA,[test x${parexa} = xyes])
323
324# ADOL-C Compilation flags
325AC_MSG_CHECKING(which flag to use to enable OpenMP)
326AC_ARG_WITH(openmp-flag,
327            [AS_HELP_STRING([--with-openmp-flag=FLAG],
328                            [use FLAG to enable OpenMP at compile time [default=none]])],
329            [ac_adolc_openmpflag=$withval
330             msg_result=$withval
331             AC_MSG_RESULT($ac_adolc_openmpflag)],
332            [ac_adolc_openmpflag=""
333             msg_result="none"
334             AC_MSG_RESULT($ac_adolc_openmpflag)])
335
336AC_MSG_CHECKING(which CFLAGS to use)
337AC_ARG_WITH(cflags,
338            [AS_HELP_STRING([--with-cflags=FLAGS],
339                            [use CFLAGS=FLAGS (default: -O2)])],
340            [ac_adolc_cflags="$withval"
341             if test x${adolc_debug} == xyes ||
342                test x${adolc_harddebug} == xyes ; then
343                ac_adolc_cflags="$ac_adolc_cflags -g -O0"
344             fi
345             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
346             AC_SUBST(ac_adolc_cflags)
347             AC_MSG_RESULT($ac_adolc_cflags)],
348            [if test "$ac_shell_cflags" = "not_set"; then
349                ac_adolc_cflags="-O2"
350                if test x${adolc_debug} == xyes ||
351                   test x${adolc_harddebug} == xyes ; then
352                   ac_adolc_cflags="-g -O3 -Wall -ansi"
353                fi
354             else
355                ac_adolc_cflags="$CFLAGS"
356             fi
357             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
358
359             AC_SUBST(ac_adolc_cflags)
360             AC_MSG_RESULT($ac_adolc_cflags)])
361
362AC_MSG_CHECKING(which CXXFLAGS to use)
363AC_ARG_WITH(cxxflags,
364            [AS_HELP_STRING([--with-cxxflags=FLAGS],
365                            [use CXXFLAGS=FLAGS (default: -O2)])],
366            [ac_adolc_cxxflags="$withval"
367             if test x${adolc_debug} == xyes ||
368                test x${adolc_harddebug} == xyes ; then
369                ac_adolc_cxxflags="$ac_adolc_cxxflags -g -O0"
370             fi
371             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
372             AC_SUBST(ac_adolc_cxxflags)
373             AC_MSG_RESULT($ac_adolc_cxxflags)],
374            [if test "$ac_shell_cxxflags" = "not_set"; then
375                ac_adolc_cxxflags="-O2"
376                if test x${adolc_debug} == xyes ||
377                   test x${adolc_harddebug} == xyes ; then
378                   ac_adolc_cxxflags="-g -O0 -Wall"
379                fi
380             else
381                ac_adolc_cxxflags="$CXXFLAGS"
382             fi
383             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
384            AC_SUBST(ac_adolc_cxxflags)
385             AC_MSG_RESULT($ac_adolc_cxxflags)])
386
387###########################################################################
388#                      COIN_PATCH_LIBTOOL_CYGWIN                          #
389###########################################################################
390
391# Patches to libtool for cygwin. Lots for cl, a few for GCC.
392# For cl:
393# - cygpath is not correctly quoted in fix_srcfile_path
394# - paths generated for .lib files is not run through cygpath -w
395
396#
397# REQUIRED FOR COMPILATION WITH CYGWIN !!!
398#
399 
400
401AC_DEFUN([AC_COIN_PATCH_LIBTOOL_CYGWIN],
402[ case "$CXX" in
403    cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
404      AC_MSG_NOTICE(Applying patches to libtool for cl compiler)
405      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
406          -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
407          -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
408          -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
409          -e 's%lib /OUT:%lib -OUT:%' \
410          -e "s%cygpath -w%$CYGPATH_W%" \
411          -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%' \
412          -e 's/$AR t/lib -nologo -list/' \
413          -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
414          -e 's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
415          -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"%' \
416      libtool > conftest.bla
417
418      mv conftest.bla libtool
419      chmod 755 libtool
420      ;;
421    *)
422      AC_MSG_NOTICE(Applying patches to libtool for GNU compiler)
423      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
424          -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
425          -e 's|libext="lib"|libext="a"|' \
426      libtool > conftest.bla
427
428      mv conftest.bla libtool
429      chmod 755 libtool
430      ;;
431  esac ]) # COIN_PATCH_LIBTOOL_CYGWIN
432 
433
434SHAVE_INIT([autoconf],[enable])
435
436# output
437AC_CONFIG_FILES(Makefile
438                autoconf/shave-libtool
439                autoconf/shave
440                ADOL-C/Makefile
441                ADOL-C/src/Makefile
442                ADOL-C/src/drivers/Makefile
443                ADOL-C/src/sparse/Makefile
444                ADOL-C/src/tapedoc/Makefile
445                ADOL-C/doc/version.tex
446                ADOL-C/examples/Makefile
447                ADOL-C/examples/additional_examples/Makefile
448                ADOL-C/examples/additional_examples/clock/Makefile
449                ADOL-C/examples/additional_examples/checkpointing/Makefile
450                ADOL-C/examples/additional_examples/ext_diff_func/Makefile
451                ADOL-C/examples/additional_examples/fixpoint_exam/Makefile
452                ADOL-C/examples/additional_examples/hessmat/Makefile
453                ADOL-C/examples/additional_examples/lufact/Makefile
454                ADOL-C/examples/additional_examples/openmp_exam/Makefile
455                ADOL-C/examples/additional_examples/scal/Makefile
456                ADOL-C/examples/additional_examples/speelpenning/Makefile
457                ADOL-C/examples/additional_examples/taylor/Makefile
458                ADOL-C/examples/additional_examples/detexam/Makefile
459                ADOL-C/examples/additional_examples/helm/Makefile
460                ADOL-C/examples/additional_examples/lighthouse/Makefile
461                ADOL-C/examples/additional_examples/ode/Makefile
462                ADOL-C/examples/additional_examples/sparse/Makefile
463                ADOL-C/examples/additional_examples/tapesave/Makefile
464                ADOL-C/examples/additional_examples/pow/Makefile
465                ADOL-C/examples/additional_examples/timing/Makefile
466                ADOL-C/test/Makefile
467                MSVisualStudio/v10/sparse/config.h
468                MSVisualStudio/v10/nosparse/config.h
469                MSVisualStudio/v10/x64/sparse/config.h
470                MSVisualStudio/v10/x64/nosparse/config.h
471                adolc.spec
472)
473
474AC_OUTPUT
475
476#call libtool for cygwin
477AC_COIN_PATCH_LIBTOOL_CYGWIN
478warn=false
479# echo configuration
480echo \
481"
482-----------------------------------------------------------------------------
483Configuration:
484
485  C compiler:                       ${CC}
486  C++ compiler:                     ${CXX}
487  Linker:                           ${LD}
488  Source code location:             `pwd`
489  Install path:                     ${prefix}
490 
491  CFLAGS:                           ${ac_adolc_cflags}
492  CXXFLAGS:                         ${ac_adolc_cxxflags}
493
494  Use ADOL-C debug mode:            ${adolc_debug}
495  Use ADOL-C hard debug mode:       ${adolc_harddebug}
496  Use ADOL-C adouble zeroing mode:  ${adolc_stdczero}"
497
498if [[ "x${ac_adolc_openmpflag}" != "x" ]] ; then
499    echo \
500"  Access thread number via errno:   ${adolc_tserrno}"
501fi
502
503echo \
504"  Use ADOL-C safe extern mode:      ${adolc_safe_extern}
505
506  Build sparse drivers:             ${sparse}
507  Build with ColPack:               ${have_colpack}"
508if test x$sparse = xyes && test x$have_colpack = xno; then
509    echo -e \
510"  \033@<:@1;31mCompressed sparse structures will not be available
511  Only sparsity patterns can be computed\033@<:@0m"
512    warn=true
513fi
514echo \
515"  Build with MPI:                   ${mpi}"
516echo
517
518echo \
519"  Build documented examples:        ${docexa}
520  Build additional examples:        ${addexa}
521
522  See ADOL-C/src/config.h for further configuration information.
523-----------------------------------------------------------------------------"
524
525# check for make install problems resulting from missing write permission
526pdir=${prefix}
527writable=true
528while test "x${pdir}" != "x/" ; do
529    if test -e ${pdir} && test ! -w ${pdir}; then
530        writable=false
531        break
532    elif test ! -e ${pdir} ; then
533        pdir=`dirname ${pdir}`
534    else
535        break
536    fi
537done
538if test "x${pdir}" == "x/" ; then
539    writable=false
540fi
541if ! ${writable} ; then
542    echo -e \
543"  \033@<:@1;31mPrefix ${prefix} not writable
544  please run ./configure --prefix=DIR
545  with a writable directory path otherwise administrator privilages
546  will be required to run \`make install'\033@<:@0m"
547    warn=true
548fi
549
550case ${prefix} in
551   ${HOME}|${HOME}/*)
552if $warn ; then
553    for (( i=5; i>0; i-- )); do
554        echo -ne "\rPlease read the above messages carefully, continuing in ${i} seconds"
555        sleep 1
556    done
557    echo -e "\rPlease read the above messages carefully                                 "
558fi
559echo \
560"
561*****************************************************************************
562
563  To successfully compile and run programs using the ADOL-C shared library do
564  the following things:
565     compiling:
566        * add \"-I${prefix}/include\" to your compiler call
567     linking:
568        * add \"-L${prefix}/${_lib} -ladolc\" to your linker call
569        * extend your linker call by \"-Wl,--rpath -Wl,${prefix}/${_lib}\"
570          (if you wish to skip the point \"executing\")
571     executing (do one of the following things):
572        * add ${prefix}/${_lib} to your LD_LIBRARY_PATH variable
573        * ask your system administrator for adding ${prefix}/${_lib} to
574          the global file containing library search paths (/etc/ld.so.conf)
575
576     (or use the static library by replacing
577        \"-L${prefix}/${_lib} -ladolc\" with
578        \"${prefix}/${_lib}/libadolc.a\" when linking)
579
580  See README for instructions on how to change to a nonlocal installation!
581
582*****************************************************************************
583"
584;;
585esac
Note: See TracBrowser for help on using the repository browser.