Debian Codegraph @

debian/external_deps/fetk/punc/configure.ac

raw
1 dnl ##########################################################################
2 dnl PUNC = < Portable Understructure for Numerical Computing >
3 dnl Copyright (C) 1994-- Michael Holst
4 dnl
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
9 dnl
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 dnl Lesser General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library; if not, write to the Free Software
17 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 dnl
19 dnl rcsid="INTENTIONALLY LEFT BLANK"
20 dnl ##########################################################################
21
22 dnl ##########################################################################
23 dnl File: configure.ac
24 dnl
25 dnl Purpose: configure.ac script for PUNC (Portable Understructure for
26 dnl Numerical Computing).
27 dnl
28 dnl Author: Michael Holst
29 dnl ##########################################################################
30
31 dnl 0. autoconf initialization
32 AC_INIT(punc, 1.0, [email protected])
33 AC_CONFIG_SRCDIR(src/aaa_inc/punc/punc.h)
34 AC_CONFIG_HEADERS(src/aaa_inc/punccf.h)
35 AC_CONFIG_AUX_DIR(config)
36 AC_PREFIX_DEFAULT(${HOME})
37 AC_CANONICAL_BUILD
38 AC_CANONICAL_HOST
39 AC_CANONICAL_TARGET
40
41 dnl 1. automake initialization
42 AM_INIT_AUTOMAKE([foreign])
43 FETK_VERSION="1:0:0"
44 AC_SUBST(FETK_VERSION)
45 AM_MAINTAINER_MODE
46
47 dnl 2. checks for programs
48 AC_LANG_C
49 AC_PROG_CC
50 AC_PROG_CPP
51 AC_DISABLE_STATIC
52 AM_PROG_LIBTOOL
53
54 dnl 3. checks for libraries
55 AC_CHECK_LIB(m,pow,[math_lib="-lm"],[math_lib=""])
56 AC_SUBST(math_lib)
57 AC_CHECK_LIB(iberty,strerrno,[liberty_lib="-liberty"],[liberty_lib=""])
58 AC_SUBST(liberty_lib)
59 nsl_lib="";
60 AC_CHECK_FUNC(gethostbyname,[try_nsl=""],[try_nsl="yes"])
61 if test -n "${try_nsl}"; then
62 AC_CHECK_LIB(nsl,gethostbyname,[nsl_lib="-lnsl"],[nsl_lib=""])
63 fi
64 AC_SUBST(nsl_lib)
65 socket_lib="";
66 AC_CHECK_FUNC(connect,[try_socket=""],[try_socket="yes"])
67 if test -n "${try_socket}"; then
68 AC_CHECK_LIB(socket,connect,[socket_lib="-lsocket"],[socket_lib=""])
69 fi
70 AC_SUBST(socket_lib)
71 thread_lib="";
72 AC_CHECK_FUNC(thr_create,[try_thread=""],[try_thread="yes"])
73 if test -n "${try_thread}"; then
74 AC_CHECK_LIB(thread,thr_create,[thread_lib="-lthread"],[thread_lib=""])
75 fi
76 AC_SUBST(thread_lib)
77
78 dnl 4. checks for header files
79 dnl 5. checks for typedefs
80 dnl 6. checks for structures
81 dnl 7. checks for compiler characteristics
82 dnl 8. checks for library functions
83 dnl 9. checks for system services
84 dnl 10. checks for anything else
85
86 dnl # ------------------------------------------------
87 dnl # CHECK WHETHER TO DISABLE CPU-VENDOR-HOST TRIPLET
88 dnl # ------------------------------------------------
89 fetk_cpu_vendor_os="";
90 AC_MSG_CHECKING([whether you want to disable the CPU-VENDOR-OS install triplet])
91 AC_ARG_ENABLE(triplet,
92 [ --disable-triplet disable CPU-VENDOR-OS install triplet [[default=no]]],
93 [ triplet_kill="yes"],
94 [ triplet_kill="" ]
95 )
96 if test "${triplet_kill}" = yes; then
97 AC_MSG_RESULT([yes])
98 fetk_cpu_vendor_os="";
99 else
100 AC_MSG_RESULT([no])
101 fetk_cpu_vendor_os="${host_cpu}-${host_vendor}-${host_os}";
102 fi
103 AC_SUBST(fetk_cpu_vendor_os)
104
105 dnl # ---------------------------------------------------
106 dnl # HANDLE VARIOUS ARCHITECTURE-SPECIFIC CONFIGURATIONS
107 dnl # ---------------------------------------------------
108 if test "${host_os}" = "cygwin"; then
109 AC_DEFINE(HAVE_CYGWIN)
110 fi
111
112 dnl # ---------------------------
113 dnl # HANDLE THE READLINE LIBRARY
114 dnl # ---------------------------
115 rl_lib="";
116 AC_MSG_CHECKING([whether your environment defines FETK_RL_LIBRARY])
117 if test -n "${FETK_RL_LIBRARY}"; then
118 AC_MSG_RESULT([yes])
119 rl_lib_path="-L${FETK_RL_LIBRARY} ";
120 else
121 AC_MSG_RESULT([no])
122 rl_lib_path="";
123 fi
124 LDFLAGS_SAVE=${LDFLAGS};
125 LDFLAGS=${rl_lib_path};
126 AC_CHECK_LIB(ncurses,tgetnum,
127 [ncurses_lib="-lncurses"],
128 [ncurses_lib=""],
129 [${math_lib}])
130 AC_CHECK_LIB(readline,readline,
131 [rl_use="yes";rl_lib="${rl_lib_path}-lreadline ${ncurses_lib}"],
132 [rl_use="";rl_lib=""],
133 [${rl_lib_path} ${ncurses_lib} ${math_lib}])
134 if test -n "${rl_use}"; then
135 AC_CHECK_LIB(readline,add_history,
136 [rl_use="yes";rl_lib="${rl_lib_path}-lreadline ${ncurses_lib}"],
137 [rl_use="";rl_lib=""],
138 [${rl_lib_path} ${ncurses_lib} ${math_lib}])
139 fi
140 LDFLAGS=${LDFLAGS_SAVE};
141 AC_SUBST(rl_lib)
142
143 dnl # ----------------------
144 dnl # HANDLE THE MPI LIBRARY
145 dnl # ----------------------
146 mpi_lib="";
147 AC_MSG_CHECKING([whether your environment defines FETK_MPI_LIBRARY])
148 if test -n "${FETK_MPI_LIBRARY}"; then
149 AC_MSG_RESULT([yes])
150 mpi_lib_path="-L${FETK_MPI_LIBRARY} ";
151 else
152 AC_MSG_RESULT([no])
153 mpi_lib_path="";
154 fi
155 LDFLAGS_SAVE=${LDFLAGS};
156 LDFLAGS=${mpi_lib_path};
157 mpi_use="";
158 AC_CHECK_LIB(mpi,main,
159 [mpi_use="yes";mpi_lib="${mpi_lib_path}-lmpi"],
160 [mpi_use="";mpi_lib=""],${mpi_lib_path})
161 if test -z "${mpi_use}"; then
162 AC_CHECK_LIB(mpich,main,
163 [mpi_use="yes";mpi_lib="${mpi_lib_path}-lmpich"],
164 [mpi_use="";mpi_lib=""],${mpi_lib_path})
165 fi
166 LDFLAGS=${LDFLAGS_SAVE};
167 AC_SUBST(mpi_lib)
168
169 dnl # -----------------------
170 dnl # HANDLE SYMBOL EMBEDDING
171 dnl # -----------------------
172 AC_MSG_CHECKING([whether EMBED macro can be used without compilation errors])
173 AC_TRY_COMPILE(,
174 [#define EMBED(rctag) \
175 static const char* rctag; \
176 static void* use_rcsid=(0 ? &use_rcsid : (void*)&rcsid);
177 EMBED(rcsid)],
178 [embed_ok=yes;AC_DEFINE(HAVE_EMBED)],[embed_ok=no])
179 AC_MSG_RESULT(${embed_ok})
180
181 AC_MSG_RESULT([---------- begin processing PUNC configure options --------])
182
183 dnl # ------------------------
184 dnl # HANDLE DEBUG COMPILATION
185 dnl # ------------------------
186 AC_MSG_CHECKING([whether you want debug compilation])
187 AC_ARG_ENABLE(vdebug,
188 [ --enable-vdebug enable debug compilation [default=no]],
189 [ vdebug_use="yes" ],
190 [ vdebug_use="" ]
191 )
192 if test -z "${vdebug_use}"; then
193 AC_MSG_RESULT([no])
194 else
195 AC_MSG_RESULT([yes])
196 AC_DEFINE(HAVE_DEBUG)
197 fi
198
199 dnl # --------------------------------
200 dnl # HANDLE ANSI/PEDANTIC COMPILATION
201 dnl # --------------------------------
202 AC_MSG_CHECKING([whether you want pedantic ANSI compilation])
203 AC_ARG_ENABLE(pansi,
204 [ --enable-pansi enable pedantic ANSI compilation],
205 [ pansi_use="yes" ],
206 [ pansi_use="" ]
207 )
208 if test -z "${pansi_use}"; then
209 AC_MSG_RESULT([no])
210 wall=""
211 wall_pedantic=""
212 wall_pedantic_ansi=""
213 pedantic_ansi=""
214 else
215 AC_MSG_RESULT([yes])
216 wall="-Wall"
217 wall_pedantic="-Wall -pedantic"
218 wall_pedantic_ansi="-Wall -pedantic -ansi"
219 pedantic_ansi="-pedantic -ansi"
220 fi
221 AC_SUBST(wall)
222 AC_SUBST(wall_pedantic)
223 AC_SUBST(wall_pedantic_ansi)
224 AC_SUBST(pedantic_ansi)
225
226 dnl # ----------------
227 dnl # HANDLE PROFILING
228 dnl # ----------------
229 AC_MSG_CHECKING([whether you want profiling])
230 AC_ARG_ENABLE(gprof,
231 [ --enable-gprof enable gprof profiling [default=no]],
232 [ gprof_use="yes" ],
233 [ gprof_use="" ]
234 )
235 if test -z "${gprof_use}"; then
236 AC_MSG_RESULT([no])
237 profile=""
238 profile_lib=""
239 else
240 AC_MSG_RESULT([yes])
241 profile="-pg"
242 profile_lib="-pg"
243 fi
244 AC_SUBST(profile)
245 AC_SUBST(profile_lib)
246
247 dnl # ---------------------------------
248 dnl # HANDLE THE ELECTRIC FENCE LIBRARY
249 dnl # ---------------------------------
250 AC_MSG_CHECKING([whether you want ElectricFence])
251 AC_ARG_ENABLE(efence,
252 [ --enable-efence enable ElectricFence malloc lib [default=no]],
253 [ efence_use="yes" ],
254 [ efence_use="" ]
255 )
256 if test -z "${efence_use}"; then
257 AC_MSG_RESULT([no])
258 zfence="";
259 zfence_lib="";
260 else
261 AC_MSG_RESULT([yes ...poking around for it])
262 AC_CHECK_LIB(efence,main,
263 [efence_use="yes";zfence="zfence";zfence_lib="-lefence"],
264 [efence_use="";zfence="";zfence_lib=""])
265 fi
266 AC_SUBST(zfence)
267 AC_SUBST(zfence_lib)
268
269 dnl # -----------------------
270 dnl # HANDLE THE VF2C LIBRARY
271 dnl # -----------------------
272
273 dnl # Check for forced build of VF2C
274 vf2c_lib="";
275 vf2c="";
276 AC_MSG_CHECKING([whether you want force build of VF2C lib])
277 AC_ARG_ENABLE(vf2cforce,
278 [ --enable-vf2cforce force building of VF2C library [default=no]],
279 [ vf2c="vf2c" ],
280 [ vf2c="" ],
281 )
282
283 dnl # Look for VF2C if required
284 if test -n "${vf2c}"; then
285 AC_MSG_RESULT([yes])
286 else
287 AC_MSG_RESULT([no ...poking around])
288
289 dnl # VF2C library location ENV specification
290 AC_MSG_CHECKING([whether your environment defines FETK_VF2C_LIBRARY])
291 if test -n "${FETK_VF2C_LIBRARY}"; then
292 AC_MSG_RESULT([yes])
293 vf2c_lib_path="-L${FETK_VF2C_LIBRARY} ";
294 else
295 AC_MSG_RESULT([no])
296 vf2c_lib_path="-L${FETK_LIBRARY} ";
297 fi
298
299 dnl # Setup temp LDFLAGS and look for VF2C library
300 LDFLAGS_SAVE=${LDFLAGS};
301 LDFLAGS=${vf2c_lib_path};
302 vf2c_use="";
303 AC_CHECK_LIB(vf2c,d_abs,
304 [vf2c_use="yes";vf2c_lib="${vf2c_lib_path}-lvf2c"],
305 [vf2c_use="";vf2c_lib=""],
306 [${vf2c_lib_path}-lvf2c])
307 if test -z "${vf2c_use}"; then
308 AC_MSG_RESULT([** VF2C library missing ...will BUILD **])
309 vf2c="vf2c";
310 else
311 AC_MSG_RESULT([** VF2C library found ...will USE **])
312 vf2c="";
313 fi
314
315 dnl # Return LDFLAGS to normal
316 LDFLAGS=${LDFLAGS_SAVE};
317 fi
318
319 dnl # Final decisions on VF2C
320 AC_SUBST(vf2c_lib)
321 AC_SUBST(vf2c)
322 AM_CONDITIONAL(BUILD_VF2C, test x$vf2c = xvf2c)
323
324 dnl # -----------------------
325 dnl # HANDLE THE BLAS LIBRARY
326 dnl # -----------------------
327
328 dnl # Check for forced build of BLAS
329 blas_lib="";
330 blas="";
331 AC_MSG_CHECKING([whether you want force build of BLAS lib])
332 AC_ARG_ENABLE(blasforce,
333 [ --enable-blasforce force building of BLAS library [default=no]],
334 [ blas="blas" ],
335 [ blas="" ],
336 )
337
338 dnl # Look for BLAS if required
339 if test -n "${blas}"; then
340 AC_MSG_RESULT([yes])
341 else
342 AC_MSG_RESULT([no ...poking around])
343
344 dnl # BLAS library location ENV specification
345 AC_MSG_CHECKING([whether your environment defines FETK_BLAS_LIBRARY])
346 if test -n "${FETK_BLAS_LIBRARY}"; then
347 AC_MSG_RESULT([yes])
348 blas_lib_path="-L${FETK_BLAS_LIBRARY} ";
349 else
350 AC_MSG_RESULT([no])
351 blas_lib_path="-L${FETK_LIBRARY} ";
352 fi
353
354 dnl # Setup temp LDFLAGS and look for BLAS library
355 LDFLAGS_SAVE=${LDFLAGS};
356 LDFLAGS=${blas_lib_path};
357 blas_use="";
358 AC_CHECK_LIB(blas,dscal_,
359 [blas_use="yes";blas_lib="${blas_lib_path}-lblas"],
360 [blas_use="";blas_lib=""],
361 [${blas_lib_path}-lblas -lvf2c])
362 if test -z "${blas_use}"; then
363 AC_MSG_RESULT([** BLAS library missing ...will BUILD **])
364 blas="blas";
365 else
366 AC_MSG_RESULT([** BLAS library found ...will USE **])
367 blas="";
368 fi
369
370 dnl # Return LDFLAGS to normal
371 LDFLAGS=${LDFLAGS_SAVE};
372 fi
373
374 dnl # Final decisions on BLAS
375 AC_SUBST(blas_lib)
376 AC_SUBST(blas)
377 AM_CONDITIONAL(BUILD_BLAS, test x$blas = xblas)
378
379 dnl # -------------------------
380 dnl # HANDLE THE LAPACK LIBRARY
381 dnl # -------------------------
382
383 dnl # Check for forced build of LAPACK
384 lapack_lib="";
385 lapack="";
386 AC_MSG_CHECKING([whether you want force build of LAPACK lib])
387 AC_ARG_ENABLE(lapackforce,
388 [ --enable-lapackforce force building of LAPACK library [default=no]],
389 [ lapack="lapack" ],
390 [ lapack="" ],
391 )
392
393 dnl # Look for LAPACK if required
394 if test -n "${lapack}"; then
395 AC_MSG_RESULT([yes])
396 else
397 AC_MSG_RESULT([no])
398 dnl AC_MSG_RESULT([no ...poking around])
399 dnl
400 dnl dnl # LAPACK library location ENV specification
401 dnl AC_MSG_CHECKING([whether your environment defines FETK_LAPACK_LIBRARY])
402 dnl if test -n "${FETK_LAPACK_LIBRARY}"; then
403 dnl AC_MSG_RESULT([yes])
404 dnl lapack_lib_path="-L${FETK_LAPACK_LIBRARY} ";
405 dnl else
406 dnl AC_MSG_RESULT([no])
407 dnl lapack_lib_path="-L${FETK_LIBRARY} ";
408 dnl fi
409 dnl
410 dnl dnl # Setup temp LDFLAGS and look for LAPACK library
411 dnl LDFLAGS_SAVE=${LDFLAGS};
412 dnl LDFLAGS=${lapack_lib_path};
413 dnl lapack_use="";
414 dnl AC_CHECK_LIB(lapack,dsysv_,
415 dnl [lapack_use="yes";lapack_lib="${lapack_lib_path}-llapack"],
416 dnl [lapack_use="";lapack_lib=""],
417 dnl [${lapack_lib_path}-llapack ${blas_lib} -lvf2c])
418 dnl if test -z "${lapack_use}"; then
419 dnl AC_MSG_RESULT([** LAPACK library missing ...will BUILD **])
420 dnl lapack="lapack";
421 dnl else
422 dnl AC_MSG_RESULT([** LAPACK library found ...will USE **])
423 dnl lapack="";
424 dnl fi
425 dnl
426 dnl dnl # Return LDFLAGS to normal
427 dnl LDFLAGS=${LDFLAGS_SAVE};
428 fi
429
430 dnl # Final decisions on LAPACK
431 AC_SUBST(lapack_lib)
432 AC_SUBST(lapack)
433 AM_CONDITIONAL(BUILD_LAPACK, test x$lapack = xlapack)
434
435 dnl # --------------------------
436 dnl # HANDLE THE AMD LIBRARY
437 dnl # --------------------------
438
439 dnl # Check for forced build of AMD
440 amd_lib="";
441 amd="";
442 AC_MSG_CHECKING([whether you want force build of AMD lib])
443 AC_ARG_ENABLE(amdforce,
444 [ --enable-amdforce force building of AMD library [default=no]],
445 [ amd="amd" ],
446 [ amd="" ],
447 )
448
449 dnl # Look for AMD if required
450 if test -n "${amd}"; then
451 AC_MSG_RESULT([yes])
452 else
453 AC_MSG_RESULT([no ...poking around])
454
455 dnl # AMD library location ENV specification
456 AC_MSG_CHECKING([whether your environment defines FETK_AMD_LIBRARY])
457 if test -n "${FETK_AMD_LIBRARY}"; then
458 AC_MSG_RESULT([yes])
459 amd_lib_path="-L${FETK_AMD_LIBRARY} ";
460 else
461 AC_MSG_RESULT([no])
462 amd_lib_path="-L${FETK_LIBRARY} ";
463 fi
464
465 dnl # Setup temp LDFLAGS and look for AMD library
466 LDFLAGS_SAVE=${LDFLAGS};
467 LDFLAGS=${amd_lib_path};
468 amd_use="";
469 AC_CHECK_LIB(amd,AMD_order,
470 [amd_use="yes";amd_lib="${amd_lib_path}-lamd"],
471 [amd_use="";amd_lib=""],
472 [${amd_lib_path}-lamd ${blas_lib} -lvf2c])
473 if test -z "${amd_use}"; then
474 AC_MSG_RESULT([** AMD library missing ...will BUILD **])
475 amd="amd";
476 else
477 AC_MSG_RESULT([** AMD library found ...will USE **])
478 amd="";
479 fi
480
481 dnl # Return LDFLAGS to normal
482 LDFLAGS=${LDFLAGS_SAVE};
483 fi
484
485 dnl # Final decisions on AMD
486 AC_SUBST(amd_lib)
487 AC_SUBST(amd)
488 AM_CONDITIONAL(BUILD_AMD, test x$amd = xamd)
489
490 dnl # --------------------------
491 dnl # HANDLE THE UMFPACK LIBRARY
492 dnl # --------------------------
493
494 dnl # Check for forced build of UMFPACK
495 umfpack_lib="";
496 umfpack="";
497 AC_MSG_CHECKING([whether you want force build of UMFPACK lib])
498 AC_ARG_ENABLE(umfpackforce,
499 [ --enable-umfpackforce force building of UMFPACK library [default=no]],
500 [ umfpack="umfpack" ],
501 [ umfpack="" ],
502 )
503
504 dnl # Look for UMFPACK if required
505 if test -n "${umfpack}"; then
506 AC_MSG_RESULT([yes])
507 else
508 AC_MSG_RESULT([no ...poking around])
509
510 dnl # UMFPACK library location ENV specification
511 AC_MSG_CHECKING([whether your environment defines FETK_UMFPACK_LIBRARY])
512 if test -n "${FETK_UMFPACK_LIBRARY}"; then
513 AC_MSG_RESULT([yes])
514 umfpack_lib_path="-L${FETK_UMFPACK_LIBRARY} ";
515 else
516 AC_MSG_RESULT([no])
517 umfpack_lib_path="-L${FETK_LIBRARY} ";
518 fi
519
520 dnl # Setup temp LDFLAGS and look for UMFPACK library
521 LDFLAGS_SAVE=${LDFLAGS};
522 LDFLAGS=${umfpack_lib_path};
523 umfpack_use="";
524 AC_CHECK_LIB(umfpack,UMFPACK_numeric,
525 [umfpack_use="yes";umfpack_lib="${umfpack_lib_path}-lumfpack"],
526 [umfpack_use="";umfpack_lib=""],
527 [${umfpack_lib_path}-lumfpack ${blas_lib} -lvf2c])
528 if test -z "${umfpack_use}"; then
529 AC_MSG_RESULT([** UMFPACK library missing ...will BUILD **])
530 umfpack="umfpack";
531 else
532 AC_MSG_RESULT([** UMFPACK library found ...will USE **])
533 umfpack="";
534 fi
535
536 dnl # Return LDFLAGS to normal
537 LDFLAGS=${LDFLAGS_SAVE};
538 fi
539
540 dnl # Final decisions on UMFPACK
541 AC_SUBST(umfpack_lib)
542 AC_SUBST(umfpack)
543 AM_CONDITIONAL(BUILD_UMFPACK, test x$umfpack = xumfpack)
544
545 dnl # --------------------------
546 dnl # HANDLE THE SUPERLU LIBRARY
547 dnl # --------------------------
548
549 dnl # Check for forced build of SUPERLU
550 superlu_lib="";
551 superlu="";
552 AC_MSG_CHECKING([whether you want force build of SUPERLU lib])
553 AC_ARG_ENABLE(superluforce,
554 [ --enable-superluforce force building of SUPERLU library [default=no]],
555 [ superlu="superlu" ],
556 [ superlu="" ],
557 )
558
559 dnl # Look for SUPERLU if required
560 if test -n "${superlu}"; then
561 AC_MSG_RESULT([yes])
562 else
563 AC_MSG_RESULT([no ...poking around])
564
565 dnl # SUPERLU library location ENV specification
566 AC_MSG_CHECKING([whether your environment defines FETK_SUPERLU_LIBRARY])
567 if test -n "${FETK_SUPERLU_LIBRARY}"; then
568 AC_MSG_RESULT([yes])
569 superlu_lib_path="-L${FETK_SUPERLU_LIBRARY} ";
570 else
571 AC_MSG_RESULT([no])
572 superlu_lib_path="-L${FETK_LIBRARY} ";
573 fi
574
575 dnl # Setup temp LDFLAGS and look for SUPERLU library
576 LDFLAGS_SAVE=${LDFLAGS};
577 LDFLAGS=${superlu_lib_path};
578 superlu_use="";
579 AC_CHECK_LIB(superlu,Destroy_SuperMatrix_Store,
580 [superlu_use="yes";superlu_lib="${superlu_lib_path}-lsuperlu"],
581 [superlu_use="";superlu_lib=""],
582 [${superlu_lib_path}-lsuperlu ${lapack_lib} ${blas_lib} -lvf2c])
583 if test -z "${superlu_use}"; then
584 AC_MSG_RESULT([** SUPERLU library missing ...will BUILD **])
585 superlu="superlu";
586 else
587 AC_MSG_RESULT([** SUPERLU library found ...will USE **])
588 superlu="";
589 fi
590
591 dnl # Return LDFLAGS to normal
592 LDFLAGS=${LDFLAGS_SAVE};
593 fi
594
595 dnl # Final decisions on SUPERLU
596 AC_SUBST(superlu_lib)
597 AC_SUBST(superlu)
598 AM_CONDITIONAL(BUILD_SUPERLU, test x$superlu = xsuperlu)
599
600 dnl # -------------------------
601 dnl # HANDLE THE ARPACK LIBRARY
602 dnl # -------------------------
603
604 dnl # Check for forced build of ARPACK
605 arpack_lib="";
606 arpack="";
607 AC_MSG_CHECKING([whether you want force build of ARPACK lib])
608 AC_ARG_ENABLE(arpackforce,
609 [ --enable-arpackforce force building of ARPACK library [default=no]],
610 [ arpack="arpack" ],
611 [ arpack="" ],
612 )
613
614 dnl # Look for ARPACK if required
615 if test -n "${arpack}"; then
616 AC_MSG_RESULT([yes])
617 else
618 AC_MSG_RESULT([no])
619 dnl AC_MSG_RESULT([no ...poking around])
620 dnl
621 dnl dnl # ARPACK library location ENV specification
622 dnl AC_MSG_CHECKING([whether your environment defines FETK_ARPACK_LIBRARY])
623 dnl if test -n "${FETK_ARPACK_LIBRARY}"; then
624 dnl AC_MSG_RESULT([yes])
625 dnl arpack_lib_path="-L${FETK_ARPACK_LIBRARY} ";
626 dnl else
627 dnl AC_MSG_RESULT([no])
628 dnl arpack_lib_path="-L${FETK_LIBRARY} ";
629 dnl fi
630 dnl
631 dnl dnl # Setup temp LDFLAGS and look for ARPACK library
632 dnl LDFLAGS_SAVE=${LDFLAGS};
633 dnl LDFLAGS=${arpack_lib_path};
634 dnl arpack_use="";
635 dnl AC_CHECK_LIB(arpack,dsgets_,
636 dnl [arpack_use="yes";arpack_lib="${arpack_lib_path}-larpack"],
637 dnl [arpack_use="";arpack_lib=""],
638 dnl [${arpack_lib_path}-larpack ${blas_lib} -lvf2c])
639 dnl if test -z "${arpack_use}"; then
640 dnl AC_MSG_RESULT([** ARPACK library missing ...will BUILD **])
641 dnl arpack="arpack";
642 dnl else
643 dnl AC_MSG_RESULT([** ARPACK library found ...will USE **])
644 dnl arpack="";
645 dnl fi
646 dnl
647 dnl dnl # Return LDFLAGS to normal
648 dnl LDFLAGS=${LDFLAGS_SAVE};
649 fi
650
651 dnl # Final decisions on ARPACK
652 AC_SUBST(arpack_lib)
653 AC_SUBST(arpack)
654 AM_CONDITIONAL(BUILD_ARPACK, test x$arpack = xarpack)
655
656 dnl # -------------------------
657 dnl # HANDLE THE CGCODE LIBRARY
658 dnl # -------------------------
659
660 dnl # Check for forced build of CGCODE
661 cgcode_lib="";
662 cgcode="";
663 AC_MSG_CHECKING([whether you want force build of CGCODE lib])
664 AC_ARG_ENABLE(cgcodeforce,
665 [ --enable-cgcodeforce force building of CGCODE library [default=no]],
666 [ cgcode="cgcode" ],
667 [ cgcode="" ],
668 )
669
670 dnl # Look for CGCODE if required
671 if test -n "${cgcode}"; then
672 AC_MSG_RESULT([yes])
673 else
674 AC_MSG_RESULT([no])
675 dnl AC_MSG_RESULT([no ...poking around])
676 dnl
677 dnl dnl # CGCODE library location ENV specification
678 dnl AC_MSG_CHECKING([whether your environment defines FETK_CGCODE_LIBRARY])
679 dnl if test -n "${FETK_CGCODE_LIBRARY}"; then
680 dnl AC_MSG_RESULT([yes])
681 dnl cgcode_lib_path="-L${FETK_CGCODE_LIBRARY} ";
682 dnl else
683 dnl AC_MSG_RESULT([no])
684 dnl cgcode_lib_path="-L${FETK_LIBRARY} ";
685 dnl fi
686 dnl
687 dnl dnl # Setup temp LDFLAGS and look for CGCODE library
688 dnl LDFLAGS_SAVE=${LDFLAGS};
689 dnl LDFLAGS=${cgcode_lib_path};
690 dnl cgcode_use="";
691 dnl AC_CHECK_LIB(cgcode,scgdrv_,
692 dnl [cgcode_use="yes";cgcode_lib="${cgcode_lib_path}-lcgcode"],
693 dnl [cgcode_use="";cgcode_lib=""],
694 dnl [${cgcode_lib_path}-lcgcode ${blas_lib} -lvf2c])
695 dnl if test -z "${cgcode_use}"; then
696 dnl AC_MSG_RESULT([** CGCODE library missing ...will BUILD **])
697 dnl cgcode="cgcode";
698 dnl else
699 dnl AC_MSG_RESULT([** CGCODE library found ...will USE **])
700 dnl cgcode="";
701 dnl fi
702 dnl
703 dnl dnl # Return LDFLAGS to normal
704 dnl LDFLAGS=${LDFLAGS_SAVE};
705 fi
706
707 dnl # Final decisions on CGCODE
708 AC_SUBST(cgcode_lib)
709 AC_SUBST(cgcode)
710 AM_CONDITIONAL(BUILD_CGCODE, test x$cgcode = xcgcode)
711
712 dnl # ----------------------
713 dnl # HANDLE THE PMG LIBRARY
714 dnl # ----------------------
715
716 dnl # Check for forced build of PMG
717 pmg_lib="";
718 pmg="";
719 AC_MSG_CHECKING([whether you want force build of PMG lib])
720 AC_ARG_ENABLE(pmgforce,
721 [ --enable-pmgforce force building of PMG library [default=no]],
722 [ pmg="pmg" ],
723 [ pmg="" ],
724 )
725
726 dnl # Look for PMG if required
727 if test -n "${pmg}"; then
728 AC_MSG_RESULT([yes])
729 else
730 AC_MSG_RESULT([no])
731 dnl AC_MSG_RESULT([no ...poking around])
732 dnl
733 dnl dnl # PMG library location ENV specification
734 dnl AC_MSG_CHECKING([whether your environment defines FETK_PMG_LIBRARY])
735 dnl if test -n "${FETK_PMG_LIBRARY}"; then
736 dnl AC_MSG_RESULT([yes])
737 dnl pmg_lib_path="-L${FETK_PMG_LIBRARY} ";
738 dnl else
739 dnl AC_MSG_RESULT([no])
740 dnl pmg_lib_path="-L${FETK_LIBRARY} ";
741 dnl fi
742 dnl
743 dnl dnl # Setup temp LDFLAGS and look for PMG library
744 dnl LDFLAGS_SAVE=${LDFLAGS};
745 dnl LDFLAGS=${pmg_lib_path};
746 dnl pmg_use="";
747 dnl AC_CHECK_LIB(pmg,buildg_,
748 dnl [pmg_use="yes";pmg_lib="${pmg_lib_path}-lpmg"],
749 dnl [pmg_use="";pmg_lib=""],
750 dnl [${pmg_lib_path}-lpmg ${blas_lib} -lvf2c])
751 dnl if test -z "${pmg_use}"; then
752 dnl AC_MSG_RESULT([** PMG library missing ...will BUILD **])
753 dnl pmg="pmg";
754 dnl else
755 dnl AC_MSG_RESULT([** PMG library found ...will USE **])
756 dnl pmg="";
757 dnl fi
758 dnl
759 dnl dnl # Return LDFLAGS to normal
760 dnl LDFLAGS=${LDFLAGS_SAVE};
761 fi
762
763 dnl # Final decisions on PMG
764 AC_SUBST(pmg_lib)
765 AC_SUBST(pmg)
766 AM_CONDITIONAL(BUILD_PMG, test x$pmg = xpmg)
767
768 AC_MSG_RESULT([----------- end processing PUNC configure options ---------])
769
770 AC_MSG_RESULT([---------- begin configuring for MALOC linkage ------------])
771
772 dnl # ------------------------
773 dnl # HANDLE THE MALOC LIBRARY
774 dnl # ------------------------
775
776 dnl # MALOC header location ENV specification
777 AC_MSG_CHECKING([whether your environment defines FETK_INCLUDE])
778 if test -n "${FETK_INCLUDE}"; then
779 AC_MSG_RESULT([yes])
780 maloc_inc_path="-I${FETK_INCLUDE} ";
781 else
782 AC_MSG_RESULT([no])
783 maloc_inc_path="";
784 fi
785
786 dnl # MALOC library location ENV specification
787 AC_MSG_CHECKING([whether your environment defines FETK_LIBRARY])
788 if test -n "${FETK_LIBRARY}"; then
789 AC_MSG_RESULT([yes])
790 maloc_lib_path="-L${FETK_LIBRARY} ";
791 else
792 AC_MSG_RESULT([no])
793 maloc_lib_path="";
794 fi
795
796 dnl # Setup temp LDFLAGS and look for MALOC library/header
797 LDFLAGS_SAVE=${LDFLAGS};
798 CPPFLAGS_SAVE=${CPPFLAGS};
799 LDFLAGS=${maloc_lib_path};
800 CPPFLAGS=${maloc_inc_path};
801 maloc_found="";
802 AC_CHECK_HEADER(maloc/maloc.h,
803 [maloc_found="yes";maloc_inc="${maloc_inc_path}"],
804 [maloc_found="";maloc_inc=""])
805 if test -n "${maloc_found}"; then
806 AC_CHECK_LIB(maloc,maloc_link,
807 [maloc_found="yes";maloc_lib="${maloc_lib_path}-lmaloc"],
808 [maloc_found="";maloc_lib=""],
809 [${maloc_lib_path}-lmaloc ${rl_lib} ${liberty_lib} ${socket_lib} ${nsl_lib} ${thread_lib} ${math_lib} ${zfence_lib} ${profile_lib} ${mpi_lib}])
810 fi
811 if test -z "${maloc_found}"; then
812 AC_MSG_ERROR([MALOC libraries OR headers missing ...EXITING ON ERROR])
813 else
814 AC_MSG_RESULT([MALOC libraries AND headers were found ...rocking on...])
815 fi
816
817 dnl # Return LDFLAGS and CPPFLAGS to normal
818 LDFLAGS=${LDFLAGS_SAVE};
819 CPPFLAGS=${CPPFLAGS_SAVE};
820 AC_SUBST(maloc_lib)
821 AC_SUBST(maloc_inc)
822
823 dnl # Check whether MALOC actually needs the READLINE library
824 AC_CHECK_LIB(maloc,maloc_needs_rl,
825 [rl_use="yes"],
826 [rl_use=""],
827 [${maloc_lib} ${rl_lib} ${liberty_lib} ${socket_lib} ${nsl_lib} ${thread_lib} ${math_lib} ${zfence_lib} ${profile_lib}])
828
829 dnl # Check whether MALOC actually needs the MPI library
830 AC_CHECK_LIB(maloc,maloc_needs_mpi,
831 [mpi_use="yes"],
832 [mpi_use=""],
833 [${maloc_lib} ${mpi_lib} ${rl_lib} ${liberty_lib} ${socket_lib} ${nsl_lib} ${thread_lib} ${math_lib} ${zfence_lib} ${profile_lib}])
834
835 AC_MSG_RESULT([---------- end configuring for MALOC linkage --------------])
836
837 dnl ##########################################################################
838 dnl 11. templates
839 dnl ##########################################################################
840
841 AH_TEMPLATE([HAVE_CYGWIN],
842 [Am I running in a Cygwin/Win32 environment?])
843
844 AH_TEMPLATE([HAVE_EMBED],
845 [Does EMBED macro for embedding rcsid symbols into binaries work?])
846
847 AH_TEMPLATE([HAVE_DEBUG],
848 [Do I compile as a debug version?])
849
850 AH_TOP([
851 /*
852 * ***************************************************************************
853 * PUNC = < Portable Understructure for Numerical Computing >
854 * Copyright (C) 1994-- Michael Holst
855 *
856 * This library is free software; you can redistribute it and/or
857 * modify it under the terms of the GNU Lesser General Public
858 * License as published by the Free Software Foundation; either
859 * version 2.1 of the License, or (at your option) any later version.
860 *
861 * This library is distributed in the hope that it will be useful,
862 * but WITHOUT ANY WARRANTY; without even the implied warranty of
863 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
864 * Lesser General Public License for more details.
865 *
866 * You should have received a copy of the GNU Lesser General Public
867 * License along with this library; if not, write to the Free Software
868 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
869 *
870 * rcsid="INTENTIONALLY LEFT BLANK"
871 * ***************************************************************************
872 */
873
874 /*
875 * ***************************************************************************
876 * File: acconfig.h
877 *
878 * Purpose: Generates the main configuration header "punccf.h" for PUNC.
879 *
880 * Author: Michael Holst
881 * ***************************************************************************
882 */
883
884 #ifndef _PUNCCF_H_
885 #define _PUNCCF_H_
886 ])
887
888 AH_BOTTOM([
889 /*
890 * ***************************************************************************
891 * Undo the damage done by the autoconf tools
892 * ***************************************************************************
893 */
894 #undef HAVE_DLFCN_H
895 #undef HAVE_INTTYPES_H
896 #undef HAVE_MEMORY_H
897 #undef HAVE_STDINT_H
898 #undef HAVE_STDLIB_H
899 #undef HAVE_STRINGS_H
900 #undef HAVE_STRING_H
901 #undef HAVE_SYS_STAT_H
902 #undef HAVE_SYS_TYPES_H
903 #undef HAVE_UNISTD_H
904
905 /*
906 * ***************************************************************************
907 * Define some RCS tag embedding and debug I/O macros
908 * ***************************************************************************
909 */
910
911 /* Embedded RCS tags ("ident filename" prints module versions in filename) */
912 #if defined(HAVE_EMBED)
913 # define VEMBED(rctag) \
914 VPRIVATE const char* rctag; \
915 static void* use_rcsid=(0 ? &use_rcsid : (void*)&rcsid);
916 #else
917 # define VEMBED(rctag)
918 #endif
919
920 /* Produce additional debugging I/O */
921 #if defined(HAVE_DEBUG)
922 # define VDEBUGIO(str) fprintf(stderr,str)
923 #else
924 # define VDEBUGIO(str)
925 #endif
926
927 #endif /* _PUNCCF_H_ */
928 ])
929
930 dnl ##########################################################################
931 dnl 12. Test for doxygen and graphviz
932 dnl ##########################################################################
933
934 cwd=`pwd`
935 cd ${srcdir}
936 TOPDIR=`pwd`
937 cd ${cwd}
938
939 AC_ARG_WITH(doxygen, [AC_HELP_STRING([--with-doxygen],[Doxygen path])],
940 with_doxygen=$withval, with_doxygen=no)
941
942 if test "$with_doxygen" = "no"; then
943 AC_PATH_PROG(doxygen_path, doxygen)
944 if test -z "${doxygen_path}"; then
945 AC_MSG_WARN([Unable to find doxygen!])
946 fi
947 else
948 doxygen_path=$with_doxygen
949 fi
950
951 AC_ARG_WITH(dot, [AC_HELP_STRING([--with-dot],[Dot path])],
952 with_dot=$withval, with_dot=no)
953
954 if test "$with_dot" = "no"; then
955 AC_PATH_PROG(dot_path, dot)
956 if test -z "${dot_path}"; then
957 AC_MSG_WARN([Unable to find dot!])
958 fi
959 else
960 dot_path=$with_dot
961 fi
962
963 if test "$dot_path" = ""; then
964 sed -e 's%@have_dot@%'NO'%' $TOPDIR/doc/doxygen/punc.dox.in > $TOPDIR/doc/doxygen/punc.dox.in.temp
965 sed -e 's%@dot_path@%''%' $TOPDIR/doc/doxygen/punc.dox.in.temp > $TOPDIR/doc/doxygen/punc.dox.in.temp.2
966 else
967 sed -e 's%@have_dot@%'YES'%' $TOPDIR/doc/doxygen/punc.dox.in > $TOPDIR/doc/doxygen/punc.dox.in.temp
968 sed -e 's%@dot_path@%'${dot_path}'%' $TOPDIR/doc/doxygen/punc.dox.in.temp > $TOPDIR/doc/doxygen/punc.dox.in.temp.2
969 fi
970
971 sed -e 's%@topdir@%'${TOPDIR}'%' $TOPDIR/doc/doxygen/punc.dox.in.temp.2 > $TOPDIR/doc/doxygen/punc.dox
972 rm -f $TOPDIR/doc/doxygen/punc.dox.in.temp*
973
974 AM_CONDITIONAL(MAKE_DOC, test "$doxygen_path" != "")
975 AC_SUBST(MAKE_DOC)
976 AC_SUBST(doxygen_path)
977
978 dnl ##########################################################################
979 dnl 13. generate the makefiles
980 dnl ##########################################################################
981
982 AC_OUTPUT([
983 Makefile
984 src/Makefile
985
986 src/base/Makefile
987
988 src/vf2c/Makefile
989 src/blas/Makefile
990 src/lapack/Makefile
991 src/amd/Makefile
992 src/umfpack/Makefile
993 src/superlu/Makefile
994 src/arpack/Makefile
995 src/cgcode/Makefile
996 src/pmg/Makefile
997
998 src/aaa_inc/Makefile
999 src/aaa_inc/punc/Makefile
1000
1001 src/aaa_lib/Makefile
1002
1003 doc/Makefile
1004 doc/doxygen/Makefile
1005 ])
1006