summaryrefslogtreecommitdiff
blob: 541da2a2c65313b04fcb3d2c9ab6b5080f10f66d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
diff -Nur ADOL-C-2.1.12.orig/ADOL-C/src/Makefile.am ADOL-C-2.1.12/ADOL-C/src/Makefile.am
--- ADOL-C-2.1.12.orig/ADOL-C/src/Makefile.am	2011-03-28 00:28:00.000000000 +0100
+++ ADOL-C-2.1.12/ADOL-C/src/Makefile.am	2011-03-30 05:49:17.000000000 +0100
@@ -19,7 +19,6 @@
 endif
 
 AM_CPPFLAGS          = -I$(top_srcdir)/ADOL-C 
-
 INCLUDES             = -I$(top_builddir)/ADOL-C
 
 if SPARSE
@@ -63,8 +62,7 @@
                        int_reverse_s.c int_reverse_t.c 
 
 libadolc_la_LIBADD   = drivers/libdrivers.la sparse/libsparse.la \
-                       tapedoc/libtapedoc.la
-libadolc_la_LDFLAGS  += @COLPACK_LIBS@
+                       tapedoc/libtapedoc.la @COLPACK_LIBS@
 else
 libadolc_la_SOURCES  = adalloc.c malloc.c adouble.cpp \
                        convolut.c fortutils.c\
diff -Nur ADOL-C-2.1.12.orig/ADOL-C/test/Makefile.am ADOL-C-2.1.12/ADOL-C/test/Makefile.am
--- ADOL-C-2.1.12.orig/ADOL-C/test/Makefile.am	2011-03-28 00:28:00.000000000 +0100
+++ ADOL-C-2.1.12/ADOL-C/test/Makefile.am	2011-03-30 04:45:33.000000000 +0100
@@ -10,7 +10,7 @@
 ## 
 ##############################################################################
 
-noinst_PROGRAMS         = powexam speelpenning fminmax
+check_PROGRAMS         = powexam speelpenning fminmax
 
 speelpenning_SOURCES    = speelpenning.cpp
 
diff -Nur ADOL-C-2.1.12.orig/configure.ac ADOL-C-2.1.12/configure.ac
--- ADOL-C-2.1.12.orig/configure.ac	2011-03-28 00:28:00.000000000 +0100
+++ ADOL-C-2.1.12/configure.ac	2011-03-30 05:05:10.000000000 +0100
@@ -50,7 +50,7 @@
 else
    _lib=lib
 fi
-libdir='${prefix}/${_lib}'
+libdir="${prefix}/${_lib}"
 AC_SUBST(_lib)
 AC_SUBST(libdir)
 
@@ -160,17 +160,18 @@
 		[colpack=${abs_srcdir}/ThirdParty/ColPack])
 
 if test "x${_lib}" != xlib ; then
-   dirlist="${_lib} lib build/${_lib} build/lib"
+   dirlist="${libdir} ${_lib} lib build/${_lib} build/lib"
 else
-   dirlist="${_lib} build/${_lib}"
+   dirlist="${libdir} ${_lib} build/${_lib}"
 fi
 
+if test x$colpack != xno; then
 AC_LANG_PUSH([C++])
 for dir in $dirlist ; do
     unset ac_cv_header_ColPackHeaders_h
-    COLPACK_CFLAGS="-I$colpack/$dir/../include"
-    COLPACK_LIBDIR="$colpack/$dir"
-    COLPACK_LIBS="-L$COLPACK_LIBDIR -lColPack -Wl,-rpath,$COLPACK_LIBDIR"
+    COLPACK_CFLAGS="-I$dir/../include/ColPack"
+    COLPACK_LIBDIR="$dir"
+    COLPACK_LIBS="-L$COLPACK_LIBDIR -lColPack"
     save_CPPFLAGS="$CPPFLAGS"
     save_LIBS="$LIBS"
     CPPFLAGS="$CPPFLAGS $COLPACK_CFLAGS"
@@ -194,6 +195,10 @@
     fi
 done
 AC_LANG_POP([C++])
+else
+	have_colpack=no
+fi
+
 AM_CONDITIONAL(HAVE_LIBCOLPACK,[test x$have_colpack = xyes])
 if test x$have_colpack = xyes; then 
    # test if the directories exists and what is the real path
@@ -201,13 +206,13 @@
    # and these variables are useless
    COLPACK_LIBDIR=`readlink -f $COLPACK_LIBDIR`
    if test -n $COLPACK_LIBDIR ; then
-      colpack_incdir=`readlink -f $COLPACK_LIBDIR/../include`
+      colpack_incdir=`readlink -f $COLPACK_LIBDIR/../include/ColPack`
       if test -n $colpack_incdir ; then
       	 COLPACK_CFLAGS="-I$colpack_incdir"
       else
 	 COLPACK_CFLAGS=""
       fi
-      COLPACK_LIBS="-L$COLPACK_LIBDIR -lColPack -Wl,-rpath,$COLPACK_LIBDIR"
+      COLPACK_LIBS="-L$COLPACK_LIBDIR -lColPack"
    else
       COLPACK_CFLAGS=""
       COLPACK_LIBS=""
@@ -272,7 +277,7 @@
 AC_MSG_CHECKING(whether to build parallel example)
 AC_ARG_ENABLE(parexa,
             [AS_HELP_STRING([--enable-parexa],
-                            [build parallel example [default=disabled], if enabled -with-openmp-flag=FLAG required])],
+                            [build parallel example [default=disabled], if enabled, --enable-openmp required])],
             [parexa=$enableval
              AC_MSG_RESULT(yes)],
             [parexa="no"
@@ -280,16 +285,7 @@
 AM_CONDITIONAL(PAREXA,[test x${parexa} = xyes])
 
 # ADOL-C Compilation flags
-AC_MSG_CHECKING(which flag to use to enable OpenMP)
-AC_ARG_WITH(openmp-flag,
-            [AS_HELP_STRING([--with-openmp-flag=FLAG],
-                            [use FLAG to enable OpenMP at compile time [default=none]])],
-            [ac_adolc_openmpflag=$withval
-             msg_result=$withval
-             AC_MSG_RESULT($ac_adolc_openmpflag)],
-            [ac_adolc_openmpflag=""
-             msg_result="none"
-             AC_MSG_RESULT($ac_adolc_openmpflag)])
+AC_OPENMP
 
 AC_MSG_CHECKING(which CFLAGS to use)
 AC_ARG_WITH(cflags,
@@ -300,7 +296,7 @@
                 test x${adolc_harddebug} == xyes ; then
                 ac_adolc_cflags="$ac_adolc_cflags -g -O0"
              fi
-             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
+             ac_adolc_cflags="$ac_adolc_cflags $OPENMP_CFLAGS"
              AC_SUBST(ac_adolc_cflags)
              AC_MSG_RESULT($ac_adolc_cflags)],
             [if test "$ac_shell_cflags" = "not_set"; then
@@ -312,7 +308,7 @@
              else
                 ac_adolc_cflags="$CFLAGS"
              fi
-             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
+             ac_adolc_cflags="$ac_adolc_cflags $OPENMP_CFLAGS"
 
              AC_SUBST(ac_adolc_cflags)
              AC_MSG_RESULT($ac_adolc_cflags)])
@@ -326,7 +322,7 @@
                 test x${adolc_harddebug} == xyes ; then
                 ac_adolc_cxxflags="$ac_adolc_cxxflags -g -O0"
              fi
-             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
+             ac_adolc_cxxflags="$ac_adolc_cxxflags $OPENMP_CFLAGS"
              AC_SUBST(ac_adolc_cxxflags)
              AC_MSG_RESULT($ac_adolc_cxxflags)],
             [if test "$ac_shell_cxxflags" = "not_set"; then
@@ -338,7 +334,7 @@
              else
                 ac_adolc_cxxflags="$CXXFLAGS"
              fi
-             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
+             ac_adolc_cxxflags="$ac_adolc_cxxflags $OPENMP_CFLAGS"
             AC_SUBST(ac_adolc_cxxflags)
              AC_MSG_RESULT($ac_adolc_cxxflags)])
 
@@ -453,7 +449,7 @@
   Use ADOL-C hard debug mode:       ${adolc_harddebug}
   Use ADOL-C adouble zeroing mode:  ${adolc_stdczero}"
 
-if [[ "x${ac_adolc_openmpflag}" != "x" ]] ; then
+if [[ "x${OPENMP_CFLAGS}" != "x" ]] ; then
     echo \
 "  Access thread number via errno:   ${adolc_tserrno}"
 fi