Mercurial > forge
annotate main/sparsersb/src/configure.base @ 12395:ae50074dd6ff octave-forge
activated and documented the autotuning and plot features available with librsb-1.1.
the autotuning feature is still experimental.
author | michelemartone |
---|---|
date | Tue, 11 Mar 2014 08:08:15 +0000 |
parents | 2b71b294a790 |
children | b8f0148a86f1 |
rev | line source |
---|---|
8849 | 1 dnl The configure script is generated by autogen.sh from configure.base |
2 dnl and the various configure.add files in the source tree. Edit | |
3 dnl configure.base and reprocess rather than modifying ./configure. | |
4 | |
5 dnl autoconf 2.13 certainly doesn't work! What is the minimum requirement? | |
11878
ffd8edaaa76f
packaging oriented notes and suggestions from carandraug.
michelemartone
parents:
8923
diff
changeset
|
6 AC_PREREQ([2.67]) |
8849 | 7 |
11878
ffd8edaaa76f
packaging oriented notes and suggestions from carandraug.
michelemartone
parents:
8923
diff
changeset
|
8 AC_INIT([sparsersb package], [1.0.0]) |
ffd8edaaa76f
packaging oriented notes and suggestions from carandraug.
michelemartone
parents:
8923
diff
changeset
|
9 dnl |
ffd8edaaa76f
packaging oriented notes and suggestions from carandraug.
michelemartone
parents:
8923
diff
changeset
|
10 dnl AC_CHECK_HEADERS([rsb.h], [], [AC_MSG_ERROR([missing the rsb library])]) |
ffd8edaaa76f
packaging oriented notes and suggestions from carandraug.
michelemartone
parents:
8923
diff
changeset
|
11 dnl AC_OUTPUT |
ffd8edaaa76f
packaging oriented notes and suggestions from carandraug.
michelemartone
parents:
8923
diff
changeset
|
12 dnl |
ffd8edaaa76f
packaging oriented notes and suggestions from carandraug.
michelemartone
parents:
8923
diff
changeset
|
13 dnl TODO: shall clean up all from here on |
ffd8edaaa76f
packaging oriented notes and suggestions from carandraug.
michelemartone
parents:
8923
diff
changeset
|
14 dnl |
8849 | 15 PACKAGE=octave-forge |
16 MAJOR_VERSION=0 | |
17 MINOR_VERSION=1 | |
18 PATCH_LEVEL=0 | |
19 | |
20 dnl Kill caching --- this ought to be the default | |
21 define([AC_CACHE_LOAD], )dnl | |
22 define([AC_CACHE_SAVE], )dnl | |
23 | |
24 dnl uncomment to put support files in another directory | |
25 dnl AC_CONFIG_AUX_DIR(admin) | |
26 | |
27 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL | |
28 AC_SUBST(PACKAGE) | |
29 AC_SUBST(VERSION) | |
30 | |
31 dnl need to find admin files, so keep track of the top dir. | |
32 TOPDIR=`pwd` | |
33 AC_SUBST(TOPDIR) | |
34 | |
35 dnl if mkoctfile doesn't work, then we need the following: | |
36 dnl AC_PROG_CXX | |
37 dnl AC_PROG_F77 | |
38 | |
39 dnl Need C compiler regardless so define it in a way that | |
40 dnl makes autoconf happy and we can override whatever we | |
41 dnl need with mkoctfile -p. | |
42 dnl XXX FIXME XXX should use mkoctfile to get CC and CFLAGS | |
43 AC_PROG_CC | |
44 | |
45 dnl XXX FIXME XXX need tests for -p -c -s in mkoctfile. | |
46 | |
47 dnl ******************************************************************* | |
48 dnl Sort out mkoctfile version number and install paths | |
49 | |
50 dnl XXX FIXME XXX latest octave has octave-config so we don't | |
51 dnl need to discover things here. Doesn't have --exe-site-dir | |
52 dnl but defines --oct-site-dir and --m-site-dir | |
53 | |
54 dnl Check for mkoctfile | |
55 AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile) | |
56 test -z "$MKOCTFILE" && AC_MSG_WARN([no mkoctfile found on path]) | |
57 | |
58 AC_SUBST(ver) | |
59 AC_SUBST(subver) | |
60 AC_SUBST(mpath) | |
61 AC_SUBST(opath) | |
62 AC_SUBST(xpath) | |
63 AC_SUBST(altpath) | |
64 AC_SUBST(altmpath) | |
65 AC_SUBST(altopath) | |
66 AC_SUBST(LIBRSB_LIBS) | |
12058
2b71b294a790
added a further linkable library variable to the autogen.sh: SPARSERSB_LIBS.
michelemartone
parents:
11878
diff
changeset
|
67 AC_SUBST(SPARSERSB_LIBS) |
8849 | 68 AC_SUBST(LIBRSB_CXXFLAGS) |
8923
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
69 AC_SUBST(RSBOI_CXXFLAGS) |
8849 | 70 |
8923
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
71 AC_ARG_WITH(verbosity-level, |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
72 [ --with-verbosity-level verbosity level (0,1,..)], |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
73 [ RSBOI_VERBOSE_CONFIG=$withval ]) |
8849 | 74 AC_ARG_WITH(path, |
75 [ --with-path install path prefix], | |
76 [ path=$withval ]) | |
77 AC_ARG_WITH(mpath, | |
78 [ --with-mpath override path for m-files], | |
79 [mpath=$withval]) | |
80 AC_ARG_WITH(opath, | |
81 [ --with-opath override path for oct-files], | |
82 [opath=$withval]) | |
83 AC_ARG_WITH(xpath, | |
84 [ --with-xpath override path for executables], | |
85 [xpath=$withval]) | |
86 AC_ARG_WITH(altpath, | |
87 [ --with-altpath alternative functions install path prefix], | |
88 [ altpath=$withval ]) | |
89 AC_ARG_WITH(altmpath, | |
90 [ --with-altmpath override path for alternative m-files], | |
91 [altmpath=$withval]) | |
92 AC_ARG_WITH(altopath, | |
93 [ --with-altopath override path for alternative oct-files], | |
94 [altopath=$withval]) | |
95 AC_ARG_WITH([swig], | |
96 [AS_HELP_STRING([--with-swig],[use swig wrapper generator [no]])], | |
97 [with_swig=$withval], | |
98 [with_swig=no]) | |
99 | |
100 if test -n "$path" ; then | |
101 test -z "$mpath" && mpath=$path | |
102 test -z "$opath" && opath=$path/oct | |
103 test -z "$xpath" && xpath=$path/bin | |
104 test -z "$altpath" && altpath=$path-alternatives | |
105 fi | |
106 | |
107 if test -n "$altpath" ; then | |
108 test -z "$altmpath" && altmpath=$altpath | |
109 test -z "$altopath" && altopath=$altpath/oct | |
110 fi | |
111 | |
112 dnl Don't query if path/ver are given in the configure environment | |
113 #if test -z "$mpath" || test -z "$opath" || test -z "$xpath" || test -z "$altmpath" || test -z "$altopath" || test -z "$ver" ; then | |
114 if test -z "$mpath" || test -z "$opath" || test -z "$xpath" || test -z "$ver" ; then | |
115 dnl Construct program to get mkoctfile version and local install paths | |
116 cat > conftest.cc <<EOF | |
117 #include <octave/config.h> | |
118 #include <octave/version.h> | |
119 #include <octave/defaults.h> | |
120 | |
121 #define INFOV "\nINFOV=" OCTAVE_VERSION "\n" | |
122 | |
123 #define INFOH "\nINFOH=" OCTAVE_CANONICAL_HOST_TYPE "\n" | |
124 | |
125 #ifdef OCTAVE_LOCALVERFCNFILEDIR | |
126 # define INFOM "\nINFOM=" OCTAVE_LOCALVERFCNFILEDIR "\n" | |
127 #else | |
128 # define INFOM "\nINFOM=" OCTAVE_LOCALFCNFILEPATH "\n" | |
129 #endif | |
130 | |
131 #ifdef OCTAVE_LOCALVEROCTFILEDIR | |
132 # define INFOO "\nINFOO=" OCTAVE_LOCALVEROCTFILEDIR "\n" | |
133 #else | |
134 # define INFOO "\nINFOO=" OCTAVE_LOCALOCTFILEPATH "\n" | |
135 #endif | |
136 | |
137 #ifdef OCTAVE_LOCALVERARCHLIBDIR | |
138 # define INFOX "\nINFOX=" OCTAVE_LOCALVERARCHLIBDIR "\n" | |
139 #else | |
140 # define INFOX "\nINFOX=" OCTAVE_LOCALARCHLIBDIR "\n" | |
141 #endif | |
142 | |
143 const char *infom = INFOM; | |
144 const char *infoo = INFOO; | |
145 const char *infox = INFOX; | |
146 const char *infoh = INFOH; | |
147 const char *infov = INFOV; | |
148 EOF | |
149 | |
150 dnl Compile program perhaps with a special version of mkoctfile | |
151 $MKOCTFILE conftest.cc || AC_MSG_ERROR(Could not run $MKOCTFILE) | |
152 | |
153 dnl Strip the config info from the compiled file | |
154 eval `strings conftest.o | grep "^INFO.=" | sed -e "s,//.*$,,"` | |
155 rm -rf conftest* | |
156 | |
157 dnl set the appropriate variables if they are not already set | |
158 ver=`echo $INFOV | sed -e "s/\.//" -e "s/\..*$//"` | |
159 subver=`echo $INFOV | sed -e "[s/^[^.]*[.][^.]*[.]//]"` | |
160 alt_mbase=`echo $INFOM | sed -e "[s,\/[^\/]*$,,]"` | |
161 alt_obase=`echo $INFOO | sed -e "[s,/site.*$,/site,]"` | |
162 test -z "$mpath" && mpath=$INFOM/octave-forge | |
163 test -z "$opath" && opath=$INFOO/octave-forge | |
164 test -z "$xpath" && xpath=$INFOX | |
165 test -z "$altmpath" && altmpath=$alt_mbase/octave-forge-alternatives/m | |
166 test -z "$altopath" && altopath=$alt_obase/octave-forge-alternatives/oct/$INFOH | |
167 fi | |
168 | |
169 dnl ******************************************************************* | |
170 | |
171 dnl XXX FIXME XXX Should we allow the user to override these? | |
172 dnl Do we even need them? The individual makefiles can call mkoctfile -p | |
173 dnl themselves, so the only reason to keep them is for configure, and | |
174 dnl for those things which are not built using mkoctfile (e.g., aurecord) | |
175 dnl but it is not clear we should be using octave compile flags for those. | |
176 | |
177 dnl C compiler and flags | |
178 AC_MSG_RESULT([retrieving compile and link flags from $MKOCTFILE]) | |
179 CC=`$MKOCTFILE -p CC` | |
180 CFLAGS=`$MKOCTFILE -p CFLAGS` | |
181 CPPFLAGS=`$MKOCTFILE -p CPPFLAGS` | |
182 CPICFLAG=`$MKOCTFILE -p CPICFLAG` | |
183 LDFLAGS=`$MKOCTFILE -p LDFLAGS` | |
184 LIBS=`$MKOCTFILE -p LIBS` | |
185 # add -fPIC or equivalent flags | |
186 FPICFLAG=`$MKOCTFILE -p FPICFLAG` | |
187 CPICFLAG=`$MKOCTFILE -p CPICFLAG` | |
188 FFLAGS="$FFLAGS $FPICFLAG" | |
189 CFLAGS="$CFLAGS $CPICFLAG" | |
190 AC_SUBST(CC) | |
191 AC_SUBST(CFLAGS) | |
192 AC_SUBST(CPPFLAGS) | |
193 AC_SUBST(CPICFLAG) | |
8923
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
194 RSBOI_CXXFLAGS="" |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
195 if test x$RSBOI_VERBOSE_CONFIG != x ; then |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
196 RSBOI_CXXFLAGS="$RSBOI_CXXFLAGS -D''RSBOI_VERBOSE_CONFIG=$RSBOI_VERBOSE_CONFIG"; |
ba575291987f
sparsersb: added the --with-verbosity-level configure switch, to activate sparsersb (debug) verbosity at build time.
michelemartone
parents:
8882
diff
changeset
|
197 fi |
8849 | 198 |
199 dnl Fortran compiler and flags | |
200 F77=`$MKOCTFILE -p F77` | |
201 FFLAGS=`$MKOCTFILE -p FFLAGS` | |
202 FPICFLAG=`$MKOCTFILE -p FPICFLAG` | |
203 AC_SUBST(F77) | |
204 AC_SUBST(FFLAGS) | |
205 AC_SUBST(FPICFLAG) | |
206 | |
207 dnl C++ compiler and flags | |
208 CXX=`$MKOCTFILE -p CXX` | |
209 CXXFLAGS=`$MKOCTFILE -p CXXFLAGS` | |
210 CXXPICFLAG=`$MKOCTFILE -p CXXPICFLAG` | |
211 CXXFLAGS="$CXXFLAGS $CXXPICFLAG" | |
212 AC_SUBST(CXX) | |
213 AC_SUBST(CXXFLAGS) | |
214 AC_SUBST(CXXPICFLAG) | |
215 | |
216 dnl ******************************************************************* | |
217 | |
218 dnl Check for features of your version of mkoctfile. | |
219 dnl All checks should be designed so that the default | |
220 dnl action if the tests are not performed is to do whatever | |
221 dnl is appropriate for the most recent version of Octave. | |
222 | |
223 dnl Define the following macro: | |
224 dnl OF_CHECK_LIB(lib,fn,true,false,helpers) | |
225 dnl This is just like AC_CHECK_LIB, but it doesn't update LIBS | |
226 AC_DEFUN(OF_CHECK_LIB, | |
227 [save_LIBS="$LIBS" | |
228 AC_CHECK_LIB($1,$2,$3,$4,$5) | |
229 LIBS="$save_LIBS" | |
230 ]) | |
231 | |
232 dnl Define the following macro: | |
233 dnl TRY_MKOCTFILE(msg,program,action_if_true,action_if_false) | |
234 dnl | |
235 AC_DEFUN(TRY_MKOCTFILE, | |
236 [AC_MSG_CHECKING($1) | |
237 cat > conftest.cc << EOF | |
238 #include <octave/config.h> | |
239 $2 | |
240 EOF | |
241 ac_try="$MKOCTFILE -c conftest.cc" | |
242 if AC_TRY_EVAL(ac_try) ; then | |
243 AC_MSG_RESULT(yes) | |
244 $3 | |
245 else | |
246 AC_MSG_RESULT(no) | |
247 $4 | |
248 fi | |
249 ]) | |
250 | |
251 dnl | |
252 dnl Check if F77_FUNC works with MKOCTFILE | |
253 dnl | |
254 TRY_MKOCTFILE([for F77_FUNC], | |
255 [int F77_FUNC (hello, HELLO) (const int &n);],, | |
256 [MKOCTFILE="$MKOCTFILE -DF77_FUNC=F77_FCN"]) | |
257 | |
258 dnl | |
259 dnl Check if octave still uses SLList.h | |
260 dnl | |
261 TRY_MKOCTFILE([for SLList.h],[#include <octave/SLList.h>], | |
262 [MKOCTFILE="$MKOCTFILE -DHAVE_SLLIST_H"],) | |
263 | |
264 dnl | |
265 dnl Check if octave has lo_ieee_nan_value | |
266 dnl | |
267 TRY_MKOCTFILE([for lo_ieee_nan_value], | |
268 [ #include <octave/lo-ieee.h> | |
269 int test(void) { lo_ieee_nan_value(); }],, | |
270 [MKOCTFILE="$MKOCTFILE -DUSE_OCTAVE_NAN"]) | |
271 | |
272 dnl | |
273 dnl Check if octave is needs octave_idx_type | |
274 dnl | |
8882
c47ac161e75d
sparsersb: commented out a (probably) redundant (octave_idx_type) symbol redefinition in configure.base.
michelemartone
parents:
8849
diff
changeset
|
275 dnl TRY_MKOCTFILE([for octave_idx_type], |
c47ac161e75d
sparsersb: commented out a (probably) redundant (octave_idx_type) symbol redefinition in configure.base.
michelemartone
parents:
8849
diff
changeset
|
276 dnl [#include <octave/oct-types.h> |
c47ac161e75d
sparsersb: commented out a (probably) redundant (octave_idx_type) symbol redefinition in configure.base.
michelemartone
parents:
8849
diff
changeset
|
277 dnl octave_idx_type test(void) { octave_idx_type idx = 1; return idx; }],, |
c47ac161e75d
sparsersb: commented out a (probably) redundant (octave_idx_type) symbol redefinition in configure.base.
michelemartone
parents:
8849
diff
changeset
|
278 dnl [MKOCTFILE="$MKOCTFILE -Doctave_idx_type=int"]) |
8849 | 279 |
280 dnl | |
281 dnl Check if octave uses quit.h | |
282 dnl | |
283 TRY_MKOCTFILE([for quit.h],[#include <octave/quit.h>],, | |
284 [MKOCTFILE="$MKOCTFILE -DNEED_OCTAVE_QUIT"]) | |
285 | |
286 dnl ********************************************************** | |
287 | |
288 dnl Evaluate an expression in octave | |
289 dnl | |
290 dnl OCTAVE_EVAL(expr,var) -> var=expr | |
291 dnl | |
292 AC_DEFUN(OCTAVE_EVAL, | |
293 [AC_MSG_CHECKING([for $1 in Octave]) | |
294 $2=`echo "disp($1)" | $OCTAVE -qf` | |
295 AC_MSG_RESULT($$2) | |
296 AC_SUBST($2) | |
297 ]) | |
298 | |
299 dnl Check status of an octave variable | |
300 dnl | |
301 dnl OCTAVE_CHECK_EXIST(variable,action_if_true,action_if_false) | |
302 dnl | |
303 AC_DEFUN(OCTAVE_CHECK_EXIST, | |
304 [AC_MSG_CHECKING([for $1 in Octave]) | |
305 if test `echo 'disp(exist("$1"))' | $OCTAVE -qf`X != 0X ; then | |
306 AC_MSG_RESULT(yes) | |
307 $2 | |
308 else | |
309 AC_MSG_RESULT(no) | |
310 $3 | |
311 fi | |
312 ]) | |
313 | |
314 dnl should check that $(OCTAVE) --version matches $(MKOCTFILE) --version | |
315 AC_CHECK_PROG(OCTAVE,octave,octave) | |
316 OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION) | |
317 | |
318 dnl grab canonical host type so we can write system specific install stuff | |
319 OCTAVE_EVAL(octave_config_info('canonical_host_type'),canonical_host_type) | |
320 | |
321 dnl grab SHLEXT from octave config | |
322 OCTAVE_EVAL(octave_config_info('SHLEXT'),SHLEXT) | |
323 | |
324 AC_PROG_LN_S | |
325 | |
326 AC_PROG_RANLIB | |
327 | |
328 dnl Use $(COPY_FLAGS) to set options for cp when installing .oct files. | |
329 COPY_FLAGS="-Rfp" | |
330 case "$canonical_host_type" in | |
331 *-*-linux*) | |
332 COPY_FLAGS="-fdp" | |
333 ;; | |
334 esac | |
335 AC_SUBST(COPY_FLAGS) | |
336 | |
337 OTHERLIBS= | |
338 OF_CHECK_LIB(m,sin,[OTHERLIBS=-lm]) | |
339 AC_SUBST(OTHERLIBS) | |
340 | |
341 OCTAVE_EVAL(octave_config_info('AR'),AR) | |
342 OCTAVE_EVAL(octave_config_info('ARFLAGS'),ARFLAGS) | |
343 | |
344 CPPFLAGS="$CPPFLAGS -DSTATIC_LINKED" | |
345 | |
346 dnl Use $(STRIP) in the makefile to strip executables. If not found, | |
347 dnl STRIP expands to ':', which in the makefile does nothing. | |
348 dnl Don't need this for .oct files since mkoctfile handles them directly | |
349 STRIP=${STRIP-strip} | |
350 AC_CHECK_PROG(STRIP,$STRIP,$STRIP,:) | |
351 | |
352 dnl Strip on windows, don't strip on Mac OS/X or IRIX | |
353 dnl For the rest, you can force strip using MKOCTFILE="mkoctfile -s" | |
354 dnl or avoid strip using STRIP=: before ./configure | |
355 case "$canonical_host_type" in | |
356 powerpc-apple-darwin*|*-sgi-*) | |
357 STRIP=: | |
358 ;; | |
359 *-cygwin-*|*-mingw-*) | |
360 MKOCTFILE="$MKOCTFILE -s" | |
361 ;; | |
362 esac | |
363 | |
364 dnl check for swig and test that it supports octave | |
365 SWIG="" | |
366 if test x"$with_swig" = "xyes"; then | |
367 AC_PATH_PROG(SWIG,swig) | |
368 test -z "$SWIG" && AC_MSG_ERROR(swig not found on path) | |
369 cat > conftest.i <<EOF | |
370 %module conftest | |
371 EOF | |
372 $SWIG -c++ -octave conftest.i || AC_MSG_ERROR(swig doesn't support octave modules) | |
373 rm -f conftest.* | |
374 fi | |
375 | |
376 CONFIGURE_OUTPUTS="Makeconf" | |
377 STATUS_MSG=" | |
378 octave commands will install into the following directories: | |
379 m-files: $mpath | |
380 oct-files: $opath | |
381 binaries: $xpath | |
382 alternatives: | |
383 m-files: $altmpath | |
384 oct-files: $altopath | |
385 | |
386 shell commands will install into the following directories: | |
387 binaries: $bindir | |
388 man pages: $mandir | |
389 libraries: $libdir | |
390 headers: $includedir | |
391 | |
392 octave-forge is configured with | |
12395
ae50074dd6ff
activated and documented the autotuning and plot features available with librsb-1.1.
michelemartone
parents:
12058
diff
changeset
|
393 CXX: $CXX |
ae50074dd6ff
activated and documented the autotuning and plot features available with librsb-1.1.
michelemartone
parents:
12058
diff
changeset
|
394 CXXFLAGS: $CXXFLAGS |
8849 | 395 octave: $OCTAVE (version $OCTAVE_VERSION) |
396 mkoctfile: $MKOCTFILE for Octave $subver | |
397 swig: $SWIG" |