source: ThirdParty/mpqc_open/configure.ac

Candidate_v1.6.1
Last change on this file was 4e8108, checked in by Frederik Heber <heber@…>, 8 years ago

Libtool consolidates and updates itself through LIBTOOL_DEPS for all packages.

  • Property mode set to 100644
File size: 49.2 KB
Line 
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT(MPQC, 2.3.1, [foo@molecuilder.de], [molecuilder], [http://www.molecuilder.de/])
6AC_CONFIG_AUX_DIR([build-aux])
7AC_CONFIG_SRCDIR([src/bin/mpqc/mpqc.cc])
8AC_CONFIG_HEADERS([src/lib/scconfig.h])
9AC_CONFIG_MACRO_DIR([m4])
10
11# Define these substitions here to keep all version information in one place.
12# For information on how to properly maintain the library version information,
13# refer to the libtool manual, section "Updating library version information":
14# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
15AC_SUBST([MPQC_SO_VERSION], [8:0:1])
16AC_SUBST([MPQC_API_VERSION], [2.3.1])
17
18define([sc_mmm_version],[2.3.1])
19define([sc_buildid],[])
20define([sc_so_version],[8:0:1])
21
22dnl Process this file with autoconf to produce a configure script.
23define([AC_CACHE_LOAD], )dnl for debugging configure.in
24define([AC_CACHE_SAVE], )dnl for debugging configure.in
25
26AC_CANONICAL_SYSTEM
27
28AC_DEFINE_UNQUOTED(HOST_ARCH, "$host", ["host"])
29AC_DEFINE_UNQUOTED(TARGET_ARCH, "$target", ["target"])
30
31dnl define([default_prefix_dash],ifelse(sc_buildid, ,[],[-]))
32dnl define([default_prefix],builtin(format,"/usr/local/mpqc/%s%s%s",
33dnl sc_mmm_version,default_prefix_dash,sc_buildid))
34
35SC_MMM_VERSION=sc_mmm_version
36
37SC_SO_VERSION=sc_so_version
38AC_SUBST(SC_SO_VERSION)
39
40changequote(<<, >>)dnl
41SC_MAJOR_VERSION=`echo $SC_MMM_VERSION|sed 's/\([0-9]*\)\.[0-9]*\.[0-9]*/\1/'`
42SC_MINOR_VERSION=`echo $SC_MMM_VERSION|sed 's/[0-9]*\.\([0-9]*\)\.[0-9]*/\1/'`
43SC_MICRO_VERSION=`echo $SC_MMM_VERSION|sed 's/[0-9]*\.[0-9]*\.\([0-9]*\)/\1/'`
44changequote([, ])dnl
45AC_DEFINE_UNQUOTED(SC_MAJOR_VERSION,$SC_MAJOR_VERSION, ["major version number"])
46AC_DEFINE_UNQUOTED(SC_MINOR_VERSION,$SC_MINOR_VERSION, ["minor version number"])
47AC_DEFINE_UNQUOTED(SC_MICRO_VERSION,$SC_MICRO_VERSION, ["micro version number"])
48
49EXCLUDED_DIRS=
50
51# Checks for programs.
52AC_PROG_CXX
53AC_PROG_INSTALL
54
55# use doxygen
56DX_HTML_FEATURE(ON)
57DX_PS_FEATURE(OFF)
58DX_PDF_FEATURE(OFF)
59DX_INIT_DOXYGEN(MPQC, doxygen.cfg, ${docdir})
60
61# parallel-tests: use parallel test druver
62# color-tests: us coloring to indicate success/failure when available
63# tar-pax: use newer tar implementation with longer filename (>99 chars)
64AM_INIT_AUTOMAKE([dist-bzip2 1.5 parallel-tests color-tests tar-pax subdir-objects])
65
66dnl --------- Features ---------
67
68AC_ARG_ENABLE(debug,
69[ --enable-debug Compile with debugging options],
70[
71case $enableval in
72 yes)
73 DEBUG=yes
74 ;;
75 no)
76 DEBUG=no
77 ;;
78 opt)
79 DEBUG=opt
80 ;;
81 *)
82 AC_MSG_ERROR([Invalid value for --enable-debug ($enableval)])
83 ;;
84esac
85],[
86 DEBUG=no
87]
88)
89
90AC_ARG_ENABLE(strict-arch,
91[ --enable-strict-arch Code might only work on target cpu type],
92[
93case $enableval in
94 yes)
95 STRICT_ARCH=yes
96 ;;
97 no)
98 STRICT_ARCH=no
99 ;;
100 *)
101 AC_MSG_ERROR([Invalid value for --enable-strict-arch ($enableval)])
102 ;;
103esac
104],[
105 STRICT_ARCH=no
106]
107)
108
109enableproduction=no
110AC_ARG_ENABLE(production,
111[ --enable-production Prepare for a production install.],
112[
113case $enableval in
114 yes)
115 enableproduction=yes
116 ;;
117 no)
118 ;;
119 *)
120 AC_MSG_ERROR([Invalid value for --enable-production ($enableval)])
121 ;;
122esac
123])
124
125AC_ARG_ENABLE(sysv-ipc,
126[ --disable-sysv-ipc Disable use of SysV IPC.],
127[
128case $enableval in
129 yes)
130 SYSVIPC=yes
131 ;;
132 no)
133 SYSVIPC=no
134 ;;
135 *)
136 AC_MSG_ERROR([Invalid value for --enable-sysv-ipc ($enableval)])
137 ;;
138esac
139],[
140 SYSVIPC=yes
141]
142)
143
144AC_ARG_ENABLE(parallel,
145[ --disable-parallel Compile for serial execution.],
146[
147case $enableval in
148 yes)
149 PARALLEL=yes
150 ;;
151 no)
152 PARALLEL=no
153 ;;
154 *)
155 AC_MSG_ERROR([Invalid value for --enable-parallel ($enableval)])
156 ;;
157esac
158],[
159 PARALLEL=yes
160]
161)
162
163AC_ARG_ENABLE(always-use-mpi,
164[ --enable-always-use-mpi Causes MPI_Init to always be called from main],
165[
166case $enableval in
167 yes)
168 ALWAYS_USE_MPI=yes
169 ;;
170 no)
171 ALWAYS_USE_MPI=no
172 ;;
173 *)
174 AC_MSG_ERROR([Invalid value for --enable-always-use-mpi ($enableval)])
175 ;;
176esac
177],[
178 ALWAYS_USE_MPI=no
179]
180)
181
182DEFAULT_PARALLEL=none
183AC_ARG_WITH(default-parallel,
184[ --with-default-parallel Default parallism model: none, mpi, armcimpi or mtmpi],
185DEFAULT_PARALLEL=$withval
186)
187if test $DEFAULT_PARALLEL = mpi; then
188 AC_DEFINE(DEFAULT_MPI, 1, ["use MPI as default"])
189elif test $DEFAULT_PARALLEL = mtmpi; then
190 AC_DEFINE(DEFAULT_MPI, 1, ["use MPI as default"])
191 AC_DEFINE(DEFAULT_MTMPI, 1, ["use multi-threaded MPI as default"])
192elif test $DEFAULT_PARALLEL = armcimpi; then
193 AC_DEFINE(DEFAULT_MPI, 1, ["use MPI as default"])
194 AC_DEFINE(DEFAULT_ARMCI, 1, ["use ARMCI as default"])
195fi
196
197SC_MPI_THREAD_LEVEL=MPI_THREAD_MULTIPLE
198AC_ARG_WITH(mpi-thread,
199[ --with-mpi-thread Thread level for MPI (multiple,serialized,funneled,single)],
200[
201 case $withval in
202 multiple)
203 SC_MPI_THREAD_LEVEL=MPI_THREAD_MULTIPLE
204 ;;
205 serialized)
206 SC_MPI_THREAD_LEVEL=MPI_THREAD_SERIALIZED
207 ;;
208 funneled)
209 SC_MPI_THREAD_LEVEL=MPI_THREAD_FUNNELED
210 ;;
211 single)
212 SC_MPI_THREAD_LEVEL=MPI_THREAD_SINGLE
213 ;;
214 *)
215 AC_MSG_ERROR([Invalid value for --with-mpi-thread ($withval)])
216 ;;
217 esac
218]
219)
220AC_DEFINE_UNQUOTED(SC_MPI_THREAD_LEVEL,$SC_MPI_THREAD_LEVEL, ["thread level for MPI"])
221
222AC_ARG_ENABLE(long-long,
223[ --disable-long-long Disable use of long long.],
224[
225case $enableval in
226 yes)
227 LONGLONG=yes
228 ;;
229 no)
230 LONGLONG=no
231 ;;
232 *)
233 AC_MSG_ERROR([Invalid value for --enable-long-long ($enableval)])
234 ;;
235esac
236],[
237 LONGLONG=yes
238]
239)
240
241AC_ARG_ENABLE(threads,
242[ --enable-threads Compile allowing use of threads, if possible.],
243[
244case $enableval in
245 yes)
246 THREADS=yes
247 ;;
248 no)
249 THREADS=no
250 ;;
251 *)
252 AC_MSG_ERROR([Invalid value for --enable-threads ($enableval)])
253 ;;
254esac
255],[
256 THREADS=yes
257]
258)
259
260AC_ARG_ENABLE(ref-debug,
261[ --enable-ref-debug Check for reference count overwrites/overflows/etc],
262[
263case $enableval in
264 yes)
265 ;;
266 no)
267 AC_DEFINE(REF_OPTIMIZE, 1, ["do not check for reference count overwrites"])
268 ;;
269 *)
270 AC_MSG_ERROR([Invalid value for --enable-ref-debug ($enableval)])
271 ;;
272esac
273],[
274 if test $DEBUG = no -o $DEBUG = opt; then
275 AC_DEFINE(REF_OPTIMIZE, 1, ["do not check for reference count overwrites"])
276 fi
277]
278)
279
280AC_ARG_ENABLE(cross-compile,
281[ --enable-cross-compile Rather than checking, assume cross compilation.],
282[
283case $enableval in
284 yes)
285 cross_compiling=yes
286 ;;
287 no)
288 ;;
289 *)
290 AC_MSG_ERROR([Invalid value for --enable-cross-compile ($enableval)])
291 ;;
292esac
293])
294
295DOXYGEN_MAN=YES
296AC_ARG_ENABLE(doxygen-man,
297[ --disable-doxygen-man Disable doxygen man pages.],
298[
299case $enableval in
300 yes)
301 ;;
302 no)
303 DOXYGEN_MAN=NO
304 ;;
305 *)
306 AC_MSG_ERROR([Invalid value for --(dis|en)able-doxygen-man ($enableval)])
307 ;;
308esac
309]
310)
311AC_SUBST(DOXYGEN_MAN)
312
313AC_ARG_ENABLE(sourceforge,
314[ --enable-sourceforge Enable SourceForge web page generation],
315[
316case $enableval in
317 yes)
318 FOOTER_HTML=sf_footer.html
319 ;;
320 no)
321 FOOTER_HTML=footer.html
322 ;;
323 *)
324 AC_MSG_ERROR([Invalid value for --enable-sourceforge ($enableval)])
325 ;;
326esac
327],[
328 FOOTER_HTML=footer.html
329]
330)
331AC_SUBST(FOOTER_HTML)
332
333AC_ARG_ENABLE(components,
334[ --enable-components Enable CCA components],
335[
336case $enableval in
337 yes)
338 components=yes
339 ;;
340 no)
341 components=no
342 ;;
343 *)
344 AC_MSG_ERROR([Invalid value for --enable-components ($enableval)])
345 ;;
346esac
347],[
348 components=no
349]
350)
351ENABLECCA=$components
352AC_SUBST(ENABLECCA)
353
354BUILDID="sc_buildid"
355AC_ARG_WITH(build-id,
356[ --with-build-id Gives an identifier for the build.],
357BUILDID=$withval
358)
359AC_SUBST(BUILDID)
360AC_DEFINE_UNQUOTED(SC_BUILDID,"$BUILDID", ["build identifier"])
361
362DEFAULT_SC_MEMORY=32000000
363AC_ARG_WITH(default-memory,
364[ --with-default-memory Gives the default memory allocation.],
365DEFAULT_SC_MEMORY=$withval
366)
367AC_DEFINE_UNQUOTED(DEFAULT_SC_MEMORY,$DEFAULT_SC_MEMORY, ["default memory allocation"])
368
369if test "$BUILDID"; then
370 SC_VERSION="$SC_MMM_VERSION-$BUILDID"
371else
372 SC_VERSION="$SC_MMM_VERSION"
373fi
374
375AC_DEFINE_UNQUOTED(SC_VERSION, "$SC_VERSION", ["SC version"])
376AC_SUBST(SC_VERSION)
377
378ac_default_prefix="/usr/local/mpqc/$SC_VERSION"
379
380AC_ARG_WITH(cc,
381[ --with-cc Gives the name of the C compiler to use.],
382CC=$withval
383)
384
385AC_ARG_WITH(cxx,
386[ --with-cxx Gives the name of the C++ compiler to use.],
387CXX=$withval
388)
389
390AC_ARG_WITH(f77,
391[ --with-f77 Gives the name of the FORTRAN 77 compiler to use.],
392F77=$withval
393)
394
395AC_ARG_WITH(cxx-optflags,
396[ --with-cxx-optflags Optimization flags to use with the C++ compiler.],
397GIVEN_CXXOPTIONS_OPT=$withval
398)
399
400AC_ARG_WITH(cc-optflags,
401[ --with-cc-optflags Optimization flags to use with the C compiler.],
402GIVEN_COPTIONS_OPT=$withval
403)
404
405DOT=yes
406AC_ARG_WITH(dot,
407[ --with-dot Gives the path to the dot graph generator.],
408DOT=$withval
409)
410
411AC_ARG_WITH(ranlib,
412[ --with-ranlib Gives the name of the ranlib program.],
413RANLIB=$withval
414)
415
416AC_ARG_WITH(ar,
417[ --with-ar Names the archive creator.],
418AR=$withval
419)
420
421ARFLAGS=r
422AC_ARG_WITH(ar-flags,
423[ --with-ar-flags Flags for the the archive creator.],
424ARFLAGS=$withval
425)
426AC_SUBST(ARFLAGS)
427
428AC_ARG_WITH(ld,
429[ --with-ld Names the object linker.],
430LD=$withval
431)
432
433changequote(<<, >>)dnl
434LAUNCH="%MPQC% [-o %OUTPUT%] %INPUT%"
435changequote([, ])dnl
436AC_ARG_WITH(launch,
437[ --with-launch The mpqcrun script launch string.],
438LAUNCH=$withval
439)
440AC_SUBST(LAUNCH)
441
442changequote(<<, >>)dnl
443CCALAUNCH="%CCAFE% --ccafe-rc %INPUT% --ccafe-remap-stdio --ccafe-outputdir %OUTPUT%";
444changequote([, ])dnl
445AC_ARG_WITH(cca-launch,
446[ --with-cca-launch The ccarun script launch string.],
447CCALAUNCH=$withval
448)
449AC_SUBST(CCALAUNCH)
450
451if test $prefix = $ac_default_prefix -o $prefix = NONE; then
452 scdatadir=$datadir
453else
454 #scdatadir=$datadir/mpqc/$SC_VERSION
455 scdatadir=$datadir/molecuilder
456fi
457AC_ARG_WITH(sc-datadir,
458[ --with-sc-datadir Specifies arch-independent install subdir.],
459scdatadir=$withval
460)
461AC_SUBST(scdatadir)
462
463AC_ARG_WITH(include,
464[ --with-include Specifies include directories (-Idir1 -Idir2).],
465EXTRAINCLUDE=$withval
466CPPFLAGS=$withval
467echo Using extra include directories: $withval
468)
469
470template_instantiation=none
471AC_ARG_WITH(template,
472[ --with-template Specifies template instantation model.],
473template_instantiation=$withval
474echo Using extra include directories: $withval
475)
476
477scincludedir=$includedir
478AC_ARG_WITH(sc-includedir,
479[ --with-sc-includedir Specifies include file install subdir.],
480scincludedir=$withval
481)
482AC_SUBST(scincludedir)
483
484AC_ARG_WITH(libs,
485[ --with-libs Specifies libraries (-llib1 -llib2).],
486LIBS=$withval
487echo Using extra libraries: $withval
488)
489
490XTRA_FLIBS=
491AC_ARG_WITH(extra-flibs,
492[ --with-extra-flibs Specifies libs needing a F77 runtime (-llib1 -llib2).],
493XTRA_FLIBS=$withval
494echo Using extra FORTRAN libraries: $withval
495)
496
497have_flibs=no
498AC_ARG_WITH(flibs,
499[ --with-flibs Specifies the F77 runtime (by default, will guess).],
500FLIBS=$withval
501have_flibs=yes
502echo Using FORTRAN runtime libraries: $withval
503)
504
505LDFLAGS=
506LIBDIRS=
507AC_ARG_WITH(libdirs,
508[ --with-libdirs Specifies library directories (-Ldir1 -Ldir2).],
509LIBDIRS=$withval
510LDFLAGS=$withval
511echo Using extra library directories: $withval
512)
513
514AC_ARG_WITH(cca-chem-config,
515[ --with-cca-chem-config Specifies full pathname of cca-chem-config script.],
516[
517 CCA_CHEM_CONFIG=$withval
518 echo Using cca-chem-config: $withval
519],[
520 if test "$components" == "yes"; then
521 AC_PATH_PROG(CCA_CHEM_CONFIG,cca-chem-config,"not-found")
522 fi
523]
524)
525
526dnl --------- Want absolute path for srcdir, not relative. ---------
527
528if test X$ac_srcdir_defaulted = Xyes; then
529 case $srcdir in
530 .|..|./*|../*)
531 srcdir=`(cd $srcdir; pwd)`
532 #srcdir=`(cd $srcdir; echo $PWD)`
533 ;;
534 esac
535fi
536
537dnl --------- Get the path to the compile dir. ---------
538
539compiledir=`pwd`
540AC_SUBST(compiledir)
541
542dnl --------- Need actual paths for substitution outside of a makefile. ---------
543
544if test $exec_prefix = "NONE"; then
545 if test $prefix = "NONE"; then
546 scbindir=$ac_default_prefix/bin;
547 sclibdir=$ac_default_prefix/lib;
548 else
549 scbindir=$prefix/bin;
550 sclibdir=$prefix/lib;
551 fi
552else
553 scbindir=$exec_prefix/bin
554 sclibdir=$exec_prefix/lib
555fi
556AC_SUBST(scbindir)
557AC_SUBST(sclibdir)
558
559dnl --------- Checks for programs. ---------
560AC_PROG_LN_S
561AC_PROG_INSTALL
562dnl obsolete because of LT_INIT
563dnl AC_PROG_RANLIB
564AC_PROG_CC
565dnl ac_prog_cxx's order isn't what i need
566AC_CHECK_PROGS(CXX, g++ c++ gcc CC cxx xlC_r, gcc)
567dnl sees if CXX is a GNU compiler
568AC_PROG_CXX
569if test ! "$F77" = no ; then
570 AC_PROG_F77
571 if test "X$have_flibs" = Xno; then
572 AC_F77_LIBRARY_LDFLAGS
573 fi
574fi
575FLIBS="$XTRA_FLIBS $FLIBS"
576AC_PROG_CPP
577AC_PROG_CXXCPP
578AC_CHECK_PROG(AR,ar,ar)
579AC_CHECK_PROG(PERL,perl,perl)
580AC_CHECK_PROG(WISH,wish,/usr/bin/wish)
581
582dnl --------- use libtool ---------------------
583
584LT_INIT([static])
585AC_SUBST([LIBTOOL_DEPS])
586
587dnl The lack of certain tools is a show stopper
588
589changequote(<<, >>)dnl
590
591if [ X$PERL = X ]; then
592 echo "Could not find the program perl. It can be obtained at"
593 echo "ftp://prep.ai.mit.edu/pub/gnu"
594 exit 1
595fi
596
597changequote([, ])dnl
598
599dnl --------- Check for the graph generator used by doxygen
600
601DOT_PATH=""
602if test X$DOT = Xno; then
603 HAVE_DOT=NO
604elif test X$DOT = Xyes; then
605 AC_CHECK_PROG(HAVE_DOT,dot,YES,NO)
606else
607 HAVE_DOT=YES
608 DOT_PATH=$DOT
609fi
610AC_SUBST(DOT_PATH)
611AC_SUBST(HAVE_DOT)
612
613dnl -------- Checks for cross compiling. ----------
614
615# obsolete starting at autoconf 2.12
616#if test X$cross_compiling != Xyes; then
617#AC_C_CROSS
618#fi
619
620#if test X$cross_compiling = Xyes -a X$target = X$host; then
621# AC_MSG_ERROR([Cross compiling, but target is host (use --host).])
622#fi
623
624dnl -------- Checks for compiler/linker options. ----------
625
626# options needed only for optimization
627COPTIONS_OPT=-O
628# options needed only for debugging
629COPTIONS_DBG=-g
630# options that are always needed
631COPTIONS_MISC=
632
633# options needed only for optimization
634CXXOPTIONS_OPT=-O
635# options needed only for debugging
636CXXOPTIONS_DBG=-g
637# options that are always needed
638CXXOPTIONS_MISC=
639
640OBJSUF=o
641LIBSUF=a
642
643dnl -- check how dependency information is built --
644
645# The GNU compilers work with:
646CCDEPENDSUF=none
647CXXDEPENDSUF=none
648CCDEPENDFLAGS=-M
649CXXDEPENDFLAGS=-M
650
651/bin/rm -f depcheck.u depcheck.c depcheck.o
652
653# Check for an IBM visual age C compiler
654echo "#include <stdio.h>" > depcheck.c
655$CC $CPPFLAGS $CFLAGS -M depcheck.c > /dev/null 2>&1
656if test -f depcheck.u; then
657 CCDEPENDSUF=u
658fi
659/bin/rm -f depcheck.u depcheck.c depcheck.o
660
661# Check for an IBM visual age C++ compiler
662echo "#include <iostream>" > depcheck.cc
663$CXX $CPPFLAGS $CXXFLAGS -M -E depcheck.cc > /dev/null 2>&1
664if test -f depcheck.u; then
665 CXXDEPENDSUF=u
666 CXXDEPENDFLAGS="-M -E"
667fi
668/bin/rm -f depcheck.u depcheck.cc depcheck.o
669
670dnl -- special misc options --
671
672AC_MSG_CHECKING([for miscellaneous flags])
673case $target in
674 *-cray-unicos*)
675 if test ! X$GXX = Xyes; then
676 CXXOPTIONS_MISC="$CXXOPTIONS_MISC -h new_for_init"
677 fi
678 AC_MSG_RESULT(cray)
679 ;;
680 *)
681 AC_MSG_RESULT(none)
682 ;;
683esac
684
685dnl -- special optimization options --
686
687AC_MSG_CHECKING([for special optimization options])
688case $target in
689 rs6000-ibm-aix3.2.* | rs6000-ibm-aix4.* | powerpc-ibm-aix4.* | powerpc-ibm-aix5.*)
690 if test X$GCC != Xyes; then
691 COPTIONS_OPT="-O -qnolm"
692 fi
693 if test X$GXX != Xyes; then
694 CXXOPTIONS_OPT="-O -qnolm -qrtti"
695 fi
696 AC_MSG_RESULT("rs6000 or powerpc")
697 ;;
698 alphaev6-*)
699 if test X$GCC = Xyes; then
700 COPTIONS_OPT="-O3 -mcpu=ev6"
701 else
702 COPTIONS_OPT="-O5 -arch ev6"
703 fi
704 if test X$GXX = Xyes; then
705 CXXOPTIONS_OPT="-O3 -mcpu=ev6"
706 else
707 CXXOPTIONS_OPT="-O5 -arch ev6"
708 fi
709 AC_MSG_RESULT("alphaev6")
710 ;;
711 alphaev56-*)
712 if test X$GCC = Xyes; then
713 COPTIONS_OPT="-O3 -mcpu=ev56"
714 else
715 COPTIONS_OPT="-O5 -arch ev56"
716 fi
717 if test X$GXX = Xyes; then
718 CXXOPTIONS_OPT="-O3 -mcpu=ev56"
719 else
720 CXXOPTIONS_OPT="-O5 -arch ev56"
721 fi
722 AC_MSG_RESULT("alphaev56")
723 ;;
724 mips*-sgi-irix5*)
725 if test X$GCC != Xyes; then
726 COPTIONS_OPT="-O -Olimit 2000"
727 fi
728 AC_MSG_RESULT("mips*-sgi-irix5")
729 ;;
730changequote(<<, >>)dnl
731 mips*-sgi-irix6.[01]*)
732changequote([, ])dnl
733 if test X$GCC != Xyes; then
734 COPTIONS_OPT="-O2 -TENV:use_fp \
735 -OPT:const_copy_limit=20000:fold_arith_limit=20000:global_limit=20000"
736 fi
737 if test X$GXX != Xyes; then
738 CXXOPTIONS_OPT="-O2 -TENV:use_fp \
739 -OPT:const_copy_limit=20000:fold_arith_limit=20000:global_limit=20000"
740 fi
741 AC_MSG_RESULT("mips*-sgi-irix6.0 or mips*-sgi-irix6.1")
742 ;;
743 mips*-sgi-irix*)
744 if test X$GCC != Xyes; then
745 COPTIONS_OPT="-O2 -OPT:Olimit=0"
746 fi
747 if test X$GXX != Xyes; then
748 CXXOPTIONS_OPT="-O2 -OPT:Olimit=0"
749 fi
750 AC_MSG_RESULT("mips*-sgi-irix")
751 ;;
752changequote(<<, >>)dnl
753 i[56]86-*)
754changequote([, ])dnl
755 if test X$GCC = Xyes; then
756 COPTIONS_OPT="-O2"
757 fi
758 if test X$GXX = Xyes; then
759 CXXOPTIONS_OPT="-O2"
760 fi
761 AC_MSG_RESULT("i586 or i686")
762 ;;
763 i860-intel-*)
764 if test X$GCC != Xyes; then
765 COPTIONS_OPT="-O3 -Knoieee"
766 fi
767 AC_MSG_RESULT("i860")
768 ;;
769 *)
770 AC_MSG_RESULT("none")
771 ;;
772esac
773
774dnl -- special architecture options --
775
776case $target_cpu in
777 i786)
778 opt_target_cpu=pentium4
779 ;;
780 *)
781 opt_target_cpu=$target_cpu
782 ;;
783esac
784
785if test X$GXX == Xyes; then
786 AC_MSG_CHECKING([for C++ cpu tuning flag])
787 AC_LANG_SAVE
788 AC_LANG_CPLUSPLUS
789 CXXFLAGS_SAV=$CXXFLAGS
790 CXXFLAGS="-mtune=$opt_target_cpu $CXXFLAGS_SAV"
791 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int main(){}])],cxx_tuneflag="-mtune",cxx_tuneflag="-mcpu")
792 CXXFLAGS=$CXXFLAGS_SAV
793 AC_LANG_RESTORE
794 AC_MSG_RESULT($cxx_tuneflag)
795fi
796
797if test X$GCC == Xyes; then
798 AC_MSG_CHECKING([for C cpu tuning flag])
799 CFLAGS_SAV=$CFLAGS
800 CFLAGS="-mtune=$opt_target_cpu $CFLAGS_SAV"
801 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int main(){}])],cc_tuneflag="-mtune",cc_tuneflag="-mcpu")
802 CFLAGS=$CFLAGS_SAV
803 AC_MSG_RESULT($cc_tuneflag)
804fi
805
806AC_MSG_CHECKING([for special architecture options])
807case $target in
808 *-solaris2*)
809 if test X$GCC != Xyes; then
810 CCDEPENDFLAGS="-xM"
811 fi
812 if test X$GXX != Xyes; then
813 CXXDEPENDFLAGS="-xM"
814 fi
815 ;;
816 rs6000-ibm-aix* | powerpc-ibm-aix*)
817 if test X$GCC != Xyes; then
818 LDFLAGS="$LDFLAGS -bmaxdata:0x70000000"
819 fi
820 AC_MSG_RESULT(rs6000 or powerpc)
821 ;;
822 i686-intel-cougar*)
823 COPTIONS_MISC="$COPTIONS_MISC -mcougar"
824 CXXOPTIONS_MISC="$CXXOPTIONS_MISC -mcougar"
825 EXTRADEFINES="-D_REENTRANT $EXTRADEFINES"
826 if test X$cross_compiling = Xyes; then
827 AR=tflop-ar
828 fi
829 AC_MSG_RESULT(teraflop cougar)
830 ;;
831changequote(<<, >>)dnl
832 i[4567]86-* | pentium-* | pentium4-* | pentiumpro-* | k6-* | athlon-*)
833changequote([, ])dnl
834
835 if test X$STRICT_ARCH = Xyes; then
836 cxx_cpu_arch_option="-march=$opt_target_cpu"
837 cc_cpu_arch_option="-march=$opt_target_cpu"
838 else
839 cxx_cpu_arch_option="$cxx_tuneflag=$opt_target_cpu"
840 cc_cpu_arch_option="$cc_tuneflag=$opt_target_cpu"
841 fi
842 if test X$GCC = Xyes; then
843 COPTIONS_OPT="$COPTIONS_OPT $cc_cpu_arch_option"
844 fi
845 if test X$GXX = Xyes; then
846 CXXOPTIONS_OPT="$CXXOPTIONS_OPT $cxx_cpu_arch_option"
847 fi
848 AC_MSG_RESULT(IA-32: $cpu_arch_option)
849 ;;
850 i860-intel-puma*)
851 if test X$GCC = Xyes; then
852 COPTIONS_MISC="$COPTIONS_MISC -mpuma"
853 else
854 COPTIONS_MISC="$COPTIONS_MISC -D__PUMAGON__"
855 COPTIONS_MISC="$COPTIONS_MISC -L$PARAGON_XDEV/paragon/lib-coff/puma"
856 COPTIONS_MISC="$COPTIONS_MISC -YS,$PARAGON_XDEV/paragon/lib-coff/puma"
857 COPTIONS_MISC="$COPTIONS_MISC -lpuma -lm -lkmath"
858 COPTIONS_MISC="$COPTIONS_MISC $PARAGON_XDEV/paragon/lib-coff/puma/libstubs.o"
859 fi
860 if test X$GXX = Xyes; then
861 CXXOPTIONS_MISC="$CXXOPTIONS_MISC -mpuma"
862 fi
863 if test X$cross_compiling = Xyes; then
864 AR=ar860
865 fi
866 AC_MSG_RESULT(paragon puma)
867 ;;
868 i860-intel-sunmos*)
869 if test X$GCC = Xyes; then
870 COPTIONS_MISC="$COPTIONS_MISC -msunmos"
871 else
872 COPTIONS_MISC="$COPTIONS_MISC -DSUNMOS -D__PUMAGON__"
873 COPTIONS_MISC="$COPTIONS_MISC -L$PARAGON_XDEV/paragon/lib-coff/sunmos"
874 COPTIONS_MISC="$COPTIONS_MISC -Wl,-d0x4000000,-k"
875 COPTIONS_MISC="$COPTIONS_MISC -YS,$PARAGON_XDEV/paragon/lib-coff/sunmos"
876 COPTIONS_MISC="$COPTIONS_MISC -lm -lsunmos -lm"
877 fi
878 if test X$GXX = Xyes; then
879 CXXOPTIONS_MISC="$CXXOPTIONS_MISC -msunmos"
880 fi
881 if test X$cross_compiling = Xyes; then
882 AR=ar860
883 fi
884 AC_MSG_RESULT(paragon sunmos)
885 ;;
886 i860-intel-osf*)
887 if test X$GCC = Xyes; then
888 COPTIONS_MISC="$COPTIONS_MISC -mnx"
889 fi
890 if test X$GXX = Xyes; then
891 CXXOPTIONS_MISC="$CXXOPTIONS_MISC -mnx"
892 fi
893 if test X$cross_compiling = Xyes; then
894 AR=ar860
895 fi
896 AC_MSG_RESULT(paragon osf)
897 ;;
898 *)
899 AC_MSG_RESULT("none")
900 ;;
901esac
902
903dnl -- check for overriden optimization options --
904
905if test -n "$GIVEN_COPTIONS_OPT"; then
906 COPTIONS_OPT=$GIVEN_COPTIONS_OPT
907 AC_MSG_NOTICE("overriding C optimization flags with $COPTIONS_OPT")
908fi
909
910if test -n "$GIVEN_CXXOPTIONS_OPT"; then
911 CXXOPTIONS_OPT=$GIVEN_CXXOPTIONS_OPT
912 AC_MSG_NOTICE("overriding C++ optimization flags with $CXXOPTIONS_OPT")
913fi
914
915dnl ----------- check for C++ typename ---------------
916dnl This is done before template flags are set to avoid
917dnl undefined symbol problems.
918
919AC_LANG_SAVE
920AC_LANG_CPLUSPLUS
921AC_MSG_CHECKING("for C++ typename keyword")
922AC_TRY_LINK([
923 class X { public: typedef int t; X(){} };
924 template <class T> void f(T i) {typename T::t x;}
925],[
926 X g;
927 f(g);
928],[
929AC_DEFINE(HAVE_TYPENAME, 1, ["use typename keyword"])
930AC_MSG_RESULT("yes")
931],
932AC_MSG_RESULT("no")
933AC_DEFINE(typename, [], ["remove usage of absent typename keyword by empty define"])
934);
935AC_LANG_RESTORE
936
937dnl ----------- check for C++ restrict extension ---------------
938
939AC_LANG_SAVE
940AC_LANG_CPLUSPLUS
941AC_TRY_LINK(,[double *restrict x=0;],
942 AC_DEFINE(CXX_RESTRICT, 1, ["c++ restricted extensions"])
943 AC_DEFINE(restrictxx, [restrict], ["convert keyword for c++ restricted extensions"]),
944
945 AC_DEFINE(restrictxx, [], ["convert keyword to none for c++ restricted extensions"]),
946)
947AC_LANG_RESTORE
948
949dnl ---------- Checks for C++ header files. -----------
950
951AC_LANG_SAVE
952AC_LANG_CPLUSPLUS
953AC_CHECK_HEADERS(iostream sstream)
954AC_LANG_RESTORE
955
956AC_MSG_CHECKING(iostream name)
957if test x$ac_cv_header_iostream = xyes; then
958 iostream=iostream
959else
960 iostream=iostream.h
961fi
962AC_MSG_RESULT($iostream)
963
964dnl ----------- check for namespace std ---------------
965
966AC_LANG_SAVE
967AC_LANG_CPLUSPLUS
968AC_MSG_CHECKING("for namespace std")
969AC_TRY_LINK([
970#include <$iostream>
971using namespace std;
972],[
973 ostream &o = cout;
974 o << endl;
975],[
976AC_DEFINE(USING_NAMESPACE_STD, 1, ["using namespace std"])
977NAMESPACE_STD=std::
978AC_MSG_RESULT("yes")
979],
980NAMESPACE_STD=
981AC_MSG_RESULT("no")
982);
983AC_LANG_RESTORE
984
985dnl ----------- check for GNU libc++-v3 prerelease bug ---------------
986
987if test X$GXX = Xyes; then
988AC_LANG_SAVE
989AC_LANG_CPLUSPLUS
990AC_MSG_CHECKING("for GNU libc++-v3 prerelease bug")
991AC_TRY_LINK([
992#include <stdio.h>
993#include <$iostream>
994],[
995],[
996AC_MSG_RESULT("no")
997],
998EXTRADEFINES="$EXTRADEFINES -D_ISOC99_SOURCE=1"
999AC_MSG_RESULT("yes")
1000);
1001AC_LANG_RESTORE
1002fi
1003
1004dnl -- other options --
1005
1006if test $DEBUG = yes; then
1007 CFLAGS="$COPTIONS_DBG $COPTIONS_MISC"
1008 CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_MISC"
1009 LDFLAGS="$LDFLAGS -g"
1010elif test $DEBUG = opt; then
1011 CFLAGS="$COPTIONS_DBG $COPTIONS_OPT $COPTIONS_MISC"
1012 CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_OPT $CXXOPTIONS_MISC"
1013 LDFLAGS="$LDFLAGS -g"
1014else
1015 CFLAGS="$COPTIONS_OPT $COPTIONS_MISC"
1016 CXXFLAGS="$CXXOPTIONS_OPT $CXXOPTIONS_MISC"
1017fi
1018
1019AC_SUBST(EXTRAINCLUDE)
1020
1021AC_SUBST(CFLAGS)
1022AC_SUBST(CXXFLAGS)
1023
1024AC_SUBST(LDFLAGS)
1025AC_SUBST(LIBDIRS)
1026
1027AC_SUBST(OBJSUF)
1028AC_SUBST(LIBSUF)
1029AC_SUBST(CCDEPENDSUF)
1030AC_SUBST(CXXDEPENDSUF)
1031AC_SUBST(CCDEPENDFLAGS)
1032AC_SUBST(CXXDEPENDFLAGS)
1033
1034dnl -------- Checks for architecture specific features. --------
1035dnl (Doesn't work for cross compilation.)
1036dnl AC_CHECK_SIZEOF(void*)
1037
1038dnl This version works on more machines without the need to run
1039dnl a test program.
1040AC_DEFUN([SC_C_BIGENDIAN],
1041[AC_CHECK_HEADERS(fp.h endian.h machine/endian.h sys/endian.h sys/machine.h)
1042AC_CACHE_CHECK(whether byte ordering is bigendian, sc_cv_c_bigendian,
1043[sc_cv_c_bigendian=unknown
1044# See if sys/param.h defines the BYTE_ORDER macro.
1045AC_TRY_COMPILE([#include "confdefs.h"
1046#ifdef HAVE_FP_H
1047#include <fp.h>
1048#endif
1049#ifdef HAVE_ENDIAN_H
1050#include <endian.h>
1051#endif
1052#ifdef HAVE_MACHINE_ENDIAN_H
1053#include <machine/endian.h>
1054#endif
1055#ifdef HAVE_SYS_ENDIAN_H
1056#include <sys/endian.h>
1057#endif
1058#ifdef HAVE_SYS_MACHINE_H
1059#include <sys/machine.h>
1060#endif
1061#include <sys/types.h>
1062#include <sys/param.h>], [
1063#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
1064 bogus endian macros
1065#endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
1066AC_TRY_COMPILE([#include "confdefs.h"
1067#ifdef HAVE_FP_H
1068#include <fp.h>
1069#endif
1070#ifdef HAVE_MP_H
1071#include <mp.h>
1072#endif
1073#ifdef HAVE_ENDIAN_H
1074#include <endian.h>
1075#endif
1076#ifdef HAVE_MACHINE_ENDIAN_H
1077#include <machine/endian.h>
1078#endif
1079#ifdef HAVE_SYS_ENDIAN_H
1080#include <sys/endian.h>
1081#endif
1082#ifdef HAVE_SYS_MACHINE_H
1083#include <sys/machine.h>
1084#endif
1085#include <sys/types.h>
1086#include <sys/param.h>], [
1087#if BYTE_ORDER != BIG_ENDIAN
1088 not big endian
1089#endif], sc_cv_c_bigendian=yes, sc_cv_c_bigendian=no)])
1090if test $sc_cv_c_bigendian = unknown; then
1091AC_TRY_RUN([main () {
1092 /* Are we little or big endian? From Harbison&Steele. */
1093 union
1094 {
1095 long l;
1096 char c[sizeof (long)];
1097 } u;
1098 u.l = 1;
1099 exit (u.c[sizeof (long) - 1] == 1);
1100}], sc_cv_c_bigendian=no, sc_cv_c_bigendian=yes,
1101AC_MSG_ERROR([Could not determine endianness and cross compiling])
1102)
1103fi])
1104if test $sc_cv_c_bigendian = yes; then
1105 AC_DEFINE(WORDS_BIGENDIAN, 1, ["use big endian encoding"])
1106fi
1107])
1108
1109SC_C_BIGENDIAN
1110
1111dnl --------- Checks for libraries. ---------
1112dnl -- libpthread should be linked in last.
1113dnl -- Check on pthread_join since pthread_create, but not pthread_join,
1114dnl -- seems to be in libc on IRIX and we must generate a -lpthread in LIBS.
1115if test "(" X$PARALLEL = Xyes -a X$THREADS != Xno ")" -o X$THREADS = Xyes; then
1116
1117AC_MSG_CHECKING([pthreads])
1118dnl see if posix threads are automatically linked ...
1119AC_LANG_SAVE
1120AC_LANG_CPLUSPLUS
1121LIBSSAV="$LIBS"
1122AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
1123HAVE_PTHREAD=yes],[
1124HAVE_PTHREAD=no])
1125AC_LANG_RESTORE
1126
1127dnl see if posix threads are in -lpthread
1128if test $HAVE_PTHREAD = no; then
1129AC_LANG_SAVE
1130AC_LANG_CPLUSPLUS
1131LIBSSAV="$LIBS"
1132LIBS="$LIBS -lpthread"
1133AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
1134HAVE_PTHREAD=yes],[
1135HAVE_PTHREAD=no
1136LIBS="$LIBSSAV"])
1137AC_LANG_RESTORE
1138fi
1139
1140dnl see if posix threads are in -lpthreads
1141if test $HAVE_PTHREAD = no; then
1142AC_LANG_SAVE
1143AC_LANG_CPLUSPLUS
1144LIBSSAV="$LIBS"
1145LIBS="$LIBS -lpthreads"
1146AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
1147HAVE_PTHREAD=yes],[
1148HAVE_PTHREAD=no
1149LIBS="$LIBSSAV"])
1150AC_LANG_RESTORE
1151fi
1152AM_CONDITIONAL(COND_PTHREAD, [test X$HAVE_PTHREAD = Xyes])
1153
1154AC_MSG_RESULT($HAVE_PTHREAD)
1155fi
1156if test X$HAVE_PTHREAD = Xyes; then
1157 AC_DEFINE(HAVE_PTHREAD, 1, ["use pthreads"])
1158 EXTRADEFINES="-D_REENTRANT $EXTRADEFINES"
1159 AC_CHECK_FUNC(pthread_attr_getstacksize, [HAVE_PTHREAD_ATTR_GETINHERITSCHED=yes], [HAVE_PTHREAD_ATTR_GETINHERITSCHED=no])
1160 AC_CHECK_FUNC(pthread_attr_setstacksize, [HAVE_PTHREAD_ATTR_GETSCHEDPARAM=yes], [HAVE_PTHREAD_ATTR_GETSCHEDPARAM=no])
1161 AC_CHECK_FUNC(pthread_attr_setscope, [HAVE_PTHREAD_ATTR_GETSCHEDPOLICY=yes], [HAVE_PTHREAD_ATTR_GETSCHEDPOLICY=no])
1162 AC_CHECK_FUNC(pthread_attr_getscope, [HAVE_PTHREAD_ATTR_GETSCOPE=yes], [HAVE_PTHREAD_ATTR_GETSCOPE=no])
1163 AC_CHECK_FUNC(pthread_attr_setinheritsched, [HAVE_PTHREAD_ATTR_GETSTACKSIZE=yes], [HAVE_PTHREAD_ATTR_GETSTACKSIZE=no])
1164 AC_CHECK_FUNC(pthread_attr_getinheritsched, [HAVE_PTHREAD_ATTR_SETINHERITSCHED=yes], [HAVE_PTHREAD_ATTR_SETINHERITSCHED=no])
1165 AC_CHECK_FUNC(pthread_attr_setschedpolicy, [HAVE_PTHREAD_ATTR_SETSCHEDPARAM=yes], [HAVE_PTHREAD_ATTR_SETSCHEDPARAM=no])
1166 AC_CHECK_FUNC(pthread_attr_getschedpolicy, [HAVE_PTHREAD_ATTR_SETSCHEDPOLICY=yes], [HAVE_PTHREAD_ATTR_SETSCHEDPOLICY=no])
1167 AC_CHECK_FUNC(pthread_attr_setschedparam, [HAVE_PTHREAD_ATTR_SETSCOPE=yes], [HAVE_PTHREAD_ATTR_SETSCOPE=no])
1168 AC_CHECK_FUNC(pthread_attr_getschedparam, [HAVE_PTHREAD_ATTR_SETSTACKSIZE=yes], [HAVE_PTHREAD_ATTR_SETSTACKSIZE=no])
1169 AC_CHECK_FUNC(sched_get_priority_max, [HAVE_SCHED_GET_PRIORITY_MAX=yes], [HAVE_SCHED_GET_PRIORITY_MAX=no])
1170 AC_CHECK_FUNC(sched_get_priority_min, [HAVE_SCHED_GET_PRIORITY_MIN=yes], [HAVE_SCHED_GET_PRIORITY_MIN=no])
1171fi
1172AC_DEFINE(HAVE_PTHREAD_ATTR_GETINHERITSCHED, [$HAVE_PTHREAD_ATTR_GETINHERITSCHED], ["use pthread_attr_getstacksize"])
1173AC_DEFINE(HAVE_PTHREAD_ATTR_GETSCHEDPARAM, [$HAVE_PTHREAD_ATTR_GETSCHEDPARAM], ["use pthread_attr_setstacksize"])
1174AC_DEFINE(HAVE_PTHREAD_ATTR_GETSCHEDPOLICY, [$HAVE_PTHREAD_ATTR_GETSCHEDPOLICY], ["use pthread_attr_setscope"])
1175AC_DEFINE(HAVE_PTHREAD_ATTR_GETSCOPE, [$HAVE_PTHREAD_ATTR_GETSCOPE], ["use pthread_attr_getscope"])
1176AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE, [$HAVE_PTHREAD_ATTR_GETSTACKSIZE], ["use pthread_attr_setinheritsched"])
1177AC_DEFINE(HAVE_PTHREAD_ATTR_SETINHERITSCHED, [$HAVE_PTHREAD_ATTR_SETINHERITSCHED], ["use pthread_attr_getinheritsched"])
1178AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCHEDPARAM, [$HAVE_PTHREAD_ATTR_SETSCHEDPARAM], ["use pthread_attr_setschedpolicy"])
1179AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCHEDPOLICY, [$HAVE_PTHREAD_ATTR_SETSCHEDPOLICY], ["use pthread_attr_getschedpolicy"])
1180AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCOPE, [$HAVE_PTHREAD_ATTR_SETSCOPE], ["use pthread_attr_setschedparam"])
1181AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE, [$HAVE_PTHREAD_ATTR_SETSTACKSIZE], ["use pthread_attr_getschedparam"])
1182AC_DEFINE(HAVE_SCHED_GET_PRIORITY_MAX, [$HAVE_SCHED_GET_PRIORITY_MAX], ["use sched_get_priority_max"])
1183AC_DEFINE(HAVE_SCHED_GET_PRIORITY_MIN, [$HAVE_SCHED_GET_PRIORITY_MIN], ["use sched_get_priority_max"])
1184
1185AC_CHECK_LIB(dl,main)
1186dnl commented out for Cray X1 (-lsun falsely detected)
1187dnl AC_CHECK_LIB(sun,main)
1188AC_CHECK_LIB(m,main)
1189dnl AC_CHECK_LIB(fl,main)
1190AC_CHECK_HEADER(perf.h,[
1191 AC_CHECK_LIB(perf,perf_set_config,[
1192 HAVE_PERF=yes
1193 LIBS="-lperf $LIBS"
1194 AC_DEFINE(HAVE_PERF, 1, ["use perf"])
1195 ])
1196 ]
1197)
1198
1199AC_CHECK_HEADER(execinfo.h,HAVE_EXECINFO_H_INC=1)
1200AC_CHECK_FUNC(backtrace, HAVE_BACKTRACE_FUNC=1)
1201AC_CHECK_FUNC(backtrace_symbols_fd, HAVE_BACKTRACE_SYMBOLS_FD_FUNC=1)
1202if test -n "$HAVE_EXECINFO_H_INC" -a -n "$HAVE_BACKTRACE_FUNC" -a -n "$HAVE_BACKTRACE_SYMBOLS_FD_FUNC"; then
1203 AC_DEFINE(HAVE_BACKTRACE, 1, ["use backtrace"])
1204fi
1205
1206if test X$PARALLEL = Xyes; then
1207
1208 dnl ----- check for the mpi library
1209 AC_LANG_SAVE
1210 AC_LANG_CPLUSPLUS
1211 dnl Must use try_link since check_header runs cpp which doesn't
1212 dnl always find mpi.h (if mpicc and no -I is used for example)
1213 AC_MSG_CHECKING(for mpi.h)
1214 AC_TRY_LINK([#include <mpi.h>],[],have_mpi_h=yes,have_mpi_h=no)
1215 AC_MSG_RESULT($have_mpi_h)
1216 if test "$have_mpi_h" = yes; then
1217 AC_CHECK_FUNC(MPI_Init,HAVE_MPI=yes,HAVE_MPI=no)
1218 if test "$HAVE_MPI" = no; then
1219 AC_CHECK_LIB(mpi,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpi $LIBS"])
1220 fi
1221 if test "$HAVE_MPI" = no; then
1222 AC_CHECK_LIB(mpich,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpich $LIBS"])
1223 fi
1224 fi
1225 if test X$HAVE_MPI = Xyes; then
1226 AC_DEFINE(HAVE_MPI, 1, ["have MPI"])
1227 AC_CHECK_FUNC(MPI_File_open,
1228 [HAVE_MPIIO=yes;AC_DEFINE(HAVE_MPIIO, 1, ["have MPI IO extensions"])])
1229 AC_CHECK_FUNC(MPI_Init_thread,
1230 [AC_DEFINE(HAVE_MPI_INIT_THREAD, 1, ["have MPI init thread"])])
1231 HAVE_MPIPP=no;
1232 AC_CHECK_LIB(mpi++,MPI_Abort,[HAVE_MPIPP=yes;LIBS="-lmpi++ $LIBS"])
1233 if test X$HAVE_MPIPP = Xno; then
1234 AC_CHECK_LIB(pmpich++,MPI_Abort,[HAVE_MPIPP=yes;LIBS="-lpmpich++ $LIBS"])
1235 fi
1236 AC_DEFINE(HAVE_MPIPP, 1, ["have MPI PP"])
1237 fi
1238 AC_LANG_RESTORE
1239fi
1240AM_CONDITIONAL(COND_MPI, [test X$HAVE_MPI = Xyes])
1241
1242if test X$HAVE_MPI != Xyes -a $ALWAYS_USE_MPI = yes; then
1243 AC_MSG_ERROR([--enable-always-use-mpi is set but MPI is not available])
1244elif test $ALWAYS_USE_MPI = yes; then
1245 AC_DEFINE(ALWAYS_USE_MPI, 1, ["always use MPI"])
1246fi
1247
1248 dnl ------ check for the armci library
1249 AC_LANG_SAVE
1250 AC_LANG_CPLUSPLUS
1251 AC_CHECK_HEADER(armci.h,[
1252 AC_CHECK_FUNC(ARMCI_Init,HAVE_ARMCI=yes,[
1253 AC_CHECK_LIB(armci,ARMCI_Init,[HAVE_ARMCI=yes;LIBS="-larmci $LIBS"])
1254 ])
1255 ])
1256 AC_LANG_RESTORE
1257
1258 if test X$HAVE_ARMCI = Xyes; then
1259 AC_DEFINE(HAVE_ARMCI, 1, ["use ARMCI"])
1260 fi
1261AM_CONDITIONAL(COND_ARMCI, [test X$HAVE_ARMCI = Xyes])
1262
1263if test $DEFAULT_PARALLEL = mtmpi -a X$HAVE_MPI != Xyes; then
1264 AC_MSG_ERROR([--with-default-parallel=mtmpi but MPI not available])
1265fi
1266if test $DEFAULT_PARALLEL = armcimpi -a X$HAVE_MPI != Xyes; then
1267 AC_MSG_ERROR([--with-default-parallel=armcimpi but MPI not available])
1268fi
1269if test $DEFAULT_PARALLEL = armcimpi -a X$HAVE_ARMCI != Xyes; then
1270 AC_MSG_ERROR([--with-default-parallel=armcimpi but ARMCI not available])
1271fi
1272
1273AC_SUBST(HAVE_PERF)
1274AC_SUBST(HAVE_MPI)
1275AC_SUBST(ALWAYS_USE_MPI)
1276AC_SUBST(HAVE_ARMCI)
1277AC_SUBST(HAVE_MPIIO)
1278AC_SUBST(EXTRADEFINES)
1279
1280dnl ---------- Checks for header files. -----------
1281
1282AC_HEADER_STDC
1283AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h pwd.h)
1284AC_CHECK_HEADERS(sys/times.h sys/resource.h time.h machine/fpu.h asm/fpu.h)
1285AC_CHECK_HEADERS(termios.h sys/stat.h sys/types.h dlfcn.h stdint.h)
1286
1287dnl -- Checks for typedefs, structures, and compiler characteristics. --
1288AC_C_CONST
1289AC_TYPE_SIZE_T
1290AC_STRUCT_TM
1291
1292dnl --------- Checks for library functions. ---------
1293AC_TYPE_SIGNAL
1294AC_FUNC_VPRINTF
1295AC_CHECK_FUNCS(strerror sigfillset signal system getpwuid geteuid)
1296AC_CHECK_FUNCS(gethostname time ctime)
1297AC_CHECK_FUNCS(setrlimit setenv)
1298
1299dnl --------- Check for an isnan and make sure it can be used
1300dnl with iostream (it can't on OS X)
1301AC_LANG_SAVE
1302AC_LANG_CPLUSPLUS
1303AC_MSG_CHECKING(isnan and iostream)
1304AC_LINK_IFELSE([AC_LANG_PROGRAM([
1305 #include <iostream>
1306 #include <math.h>],[isnan(1.0); return 0;
1307 ])],
1308 AC_DEFINE(HAVE_ISNAN,1, ["isnan available"])
1309 AC_MSG_RESULT(yes),
1310 AC_MSG_RESULT(no)
1311)
1312AC_LANG_RESTORE
1313
1314dnl --------- Check for the glibc extensions to C99 fenv.h. ---------
1315
1316AC_CHECK_HEADERS(fenv.h)
1317AC_CHECK_FUNCS(feenableexcept fedisableexcept)
1318
1319dnl --------- Checks for a C++ linkable fchdir. ---------
1320AC_LANG_SAVE
1321AC_LANG_CPLUSPLUS
1322AC_MSG_CHECKING([fchdir])
1323AC_TRY_COMPILE([#include <unistd.h>],[
1324fchdir(0);
1325],[HAVE_FCHDIR=yes
1326AC_DEFINE(HAVE_FCHDIR, 1, ["have fchdir"])
1327AC_MSG_RESULT(yes)],[
1328AC_MSG_RESULT(no)
1329HAVE_FCHDIR=no
1330])
1331AC_LANG_RESTORE
1332AC_SUBST(HAVE_FCHDIR)
1333
1334dnl --------- Check for ios::fmtflags. ---------
1335
1336AC_LANG_SAVE
1337AC_LANG_CPLUSPLUS
1338AC_MSG_CHECKING([ios::fmtflags])
1339AC_TRY_COMPILE([#include <$iostream>],[
1340$NAMESPACE_STD ios::fmtflags flags;
1341],[HAVE_IOS_FMTFLAGS=yes
1342AC_DEFINE(HAVE_IOS_FMTFLAGS, 1, ["have iostream format flags"])
1343AC_MSG_RESULT(yes)],[
1344AC_MSG_RESULT(no)
1345HAVE_IOS_FMTFLAGS=no
1346])
1347AC_LANG_RESTORE
1348AC_SUBST(HAVE_IOS_FMTFLAGS)
1349
1350dnl --------- check for long long ---------
1351
1352if test X"$LONGLONG" = Xyes; then
1353AC_LANG_SAVE
1354AC_LANG_CPLUSPLUS
1355AC_MSG_CHECKING(long long)
1356AC_TRY_COMPILE([],[
1357long long i;
1358],[AC_DEFINE(HAVE_LONG_LONG, 1, ["have long long"])
1359AC_MSG_RESULT(yes)],[
1360AC_MSG_RESULT(no)
1361])
1362AC_LANG_RESTORE
1363fi
1364
1365dnl --------- Check for sgetn. ---------
1366
1367AC_LANG_SAVE
1368AC_LANG_CPLUSPLUS
1369AC_MSG_CHECKING([sgetn])
1370AC_TRY_COMPILE([#include <$iostream>],[
1371char *c=0;
1372$NAMESPACE_STD streambuf *s=0; s->sgetn(c,0);
1373],[HAVE_SGETN=yes
1374AC_DEFINE(HAVE_SGETN, 1, ["have sgetn"])
1375AC_MSG_RESULT(yes)],[
1376AC_MSG_RESULT(no)
1377HAVE_SGETN=no
1378])
1379AC_LANG_RESTORE
1380AC_SUBST(HAVE_SGETN)
1381
1382dnl --------- Check for pubseekoff. ---------
1383
1384AC_LANG_SAVE
1385AC_LANG_CPLUSPLUS
1386AC_MSG_CHECKING([pubseekoff])
1387AC_TRY_COMPILE([#include <$iostream>],[
1388$NAMESPACE_STD cout.rdbuf()->pubseekoff(0,$NAMESPACE_STD ios::beg,
1389 $NAMESPACE_STD ios::out);
1390],[HAVE_PUBSEEKOFF=yes
1391AC_DEFINE(HAVE_PUBSEEKOFF, 1, ["have pubseekoff"])
1392AC_MSG_RESULT(yes)],[
1393AC_MSG_RESULT(no)
1394HAVE_PUBSEEKOFF=no
1395])
1396AC_LANG_RESTORE
1397AC_SUBST(HAVE_PUBSEEKOFF)
1398
1399dnl --------- Check for seekoff. ---------
1400
1401AC_LANG_SAVE
1402AC_LANG_CPLUSPLUS
1403AC_MSG_CHECKING([seekoff])
1404AC_TRY_COMPILE([#include <$iostream>],[
1405$NAMESPACE_STD cout.rdbuf()->seekoff(0,$NAMESPACE_STD ios::beg,
1406 $NAMESPACE_STD ios::out);
1407],[HAVE_SEEKOFF=yes
1408AC_DEFINE(HAVE_SEEKOFF, 1, ["have seekoff"])
1409AC_MSG_RESULT(yes)],[
1410AC_MSG_RESULT(no)
1411HAVE_SEEKOFF=no
1412])
1413AC_LANG_RESTORE
1414AC_SUBST(HAVE_SEEKOFF)
1415
1416dnl --------- Check for signal handler argument lists. ---------
1417
1418AC_LANG_SAVE
1419AC_LANG_CPLUSPLUS
1420AC_MSG_CHECKING([signal handler needs ellipsis])
1421AC_TRY_LINK([
1422#include <signal.h>
1423extern "C" {
1424 typedef void (*signal_handler)(...);
1425 void handler(int);
1426}
1427void handler(int) {}
1428],[
1429 signal(SIGINT, (signal_handler)handler);
1430],
1431AC_DEFINE(SIGHASELLIP, 1, ["signal handler needs ellipsis"]) AC_MSG_RESULT(yes),
1432AC_MSG_RESULT(no))
1433AC_LANG_RESTORE
1434
1435dnl --------- Checks for rand functions ---------
1436
1437AC_LANG_SAVE
1438AC_LANG_CPLUSPLUS
1439AC_CHECK_FUNCS(drand48)
1440AC_LANG_RESTORE
1441
1442dnl --------- Checks for SYSV IPC. ---------
1443
1444if test "X$SYSVIPC" = Xyes; then
1445 AC_CHECK_FUNCS(shmget semget)
1446 AC_CHECK_HEADERS(sys/ipc.h sys/sem.h sys/shm.h)
1447 AC_MSG_CHECKING([for SYSV IPC])
1448 if test X$ac_cv_func_shmget = Xyes -a \
1449 X$ac_cv_func_semget = Xyes -a \
1450 X$ac_cv_header_sys_ipc_h = Xyes -a \
1451 X$ac_cv_header_sys_sem_h = Xyes -a \
1452 X$ac_cv_header_sys_shm_h = Xyes; then
1453 HAVE_SYSV_IPC=yes
1454 AC_DEFINE(HAVE_SYSV_IPC, 1, ["use SYSVIPC"])
1455 else
1456 HAVE_SYSV_IPC=no
1457 fi
1458 AC_MSG_RESULT($HAVE_SYSV_IPC)
1459 AC_SUBST(HAVE_SYSV_IPC)
1460else
1461 HAVE_SYSV_IPC=no
1462 AC_SUBST(HAVE_SYSV_IPC)
1463fi
1464AM_CONDITIONAL(COND_SYSV_IPC, [test "X$HAVE_SYSV_IPC" = Xyes])
1465
1466AC_LANG_SAVE
1467AC_LANG_CPLUSPLUS
1468AC_MSG_CHECKING([if semctl requires semun])
1469AC_TRY_LINK([
1470#include <sys/types.h>
1471#include <sys/ipc.h>
1472#include <sys/sem.h>
1473],[
1474 int val = 0;
1475 semctl(0,0,0,val);
1476],[
1477case $target in
1478 *-sgi-irix*)
1479 AC_DEFINE(SEMCTL_REQUIRES_SEMUN, 1, ["semctl requires semun"]) AC_MSG_RESULT(sgi-irix -- yes)
1480 ;;
1481 *)
1482 AC_MSG_RESULT(no)
1483 ;;
1484esac
1485],
1486AC_DEFINE(SEMCTL_REQUIRES_SEMUN, 1, ["semctl requires semun"]) AC_MSG_RESULT(yes))
1487AC_LANG_RESTORE
1488AC_DEFINE(SHMTYPE, [char *], ["type to use in shared memory"])
1489
1490dnl ----------- See if Fortran works --------------
1491
1492AC_MSG_CHECKING(if fortran compiler works)
1493if test -n "$F77" -a "$F77" != no ; then
1494 /bin/rm -f ffunc.f flink.c
1495 echo " program main" > ffunc.f
1496 echo " end" >> ffunc.f
1497 if $F77 -o ffunc ffunc.f 1>&5 2>&5; then
1498 AC_MSG_RESULT(yes)
1499 else
1500 AC_MSG_RESULT(no)
1501 AC_MSG_FAILURE(fortran compiler does not work)
1502 fi
1503 /bin/rm -f ffunc ffunc.f
1504fi
1505
1506dnl ----------- Fortran symbol names --------------
1507
1508AC_MSG_CHECKING(fortran symbols)
1509if test -n "$F77" -a "$F77" != no ; then
1510 /bin/rm -f ffunc.f flink.c
1511 echo " subroutine ffunc()" > ffunc.f
1512 echo " return" >> ffunc.f
1513 echo " end" >> ffunc.f
1514 $F77 -c ffunc.f 1>/dev/null 2>/dev/null
1515 echo "main(){ FF(); return 0; }" > flink.c
1516 if $CC -o flink -DFF=ffunc flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
1517 AC_MSG_RESULT(same as C)
1518 F77_SYMBOLS=symbol
1519 elif $CC -o flink -DFF=ffunc_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
1520 AC_MSG_RESULT(lowercase with underscore)
1521 F77_SYMBOLS=symbol_
1522 elif $CC -o flink -DFF=FFUNC flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
1523 AC_MSG_RESULT(uppercase)
1524 F77_SYMBOLS=SYMBOL
1525 elif $CC -o flink -DFF=FFUNC_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
1526 AC_MSG_RESULT(uppercase with underscore)
1527 F77_SYMBOLS=SYMBOL_
1528 else
1529 AC_MSG_RESULT(giving up)
1530 AC_MSG_ERROR(could not determine F77 symbol names)
1531 fi
1532 /bin/rm -f ffunc.f ffunc.o flink flink.c flink.o ffunc
1533else
1534 F77_SYMBOLS=symbol_
1535 AC_MSG_RESULT(guessing lowercase with underscore)
1536fi
1537AC_SUBST(F77_SYMBOLS)
1538
1539dnl ----------- check for FORTRAN libraries --------------
1540
1541AC_LANG_SAVE
1542AC_LANG_CPLUSPLUS
1543LIBSSAV="$LIBS"
1544LIBS="$LIBSSAV $FLIBS"
1545
1546LIBBLAS=""
1547F77_DGEMM=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DAXPY`
1548AC_CHECK_FUNC($F77_DGEMM,HAVE_BLAS=yes,[
1549 AC_CHECK_LIB(essl,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lessl"],
1550 AC_CHECK_LIB(blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lblas"])
1551 )]
1552)
1553if test X$HAVE_BLAS != Xyes; then
1554 LIBSSAV2="$LIBS"
1555 LIBS="-latlas $LIBS"
1556 AC_CHECK_LIB(f77blas,$F77_DGEMM,[HAVE_BLAS=yes;LIBBLAS="-lf77blas -latlas"],
1557 LIBS="$LIBSSAV2")
1558fi
1559AC_SUBST(HAVE_BLAS)
1560if test X$HAVE_BLAS != Xyes; then
1561 echo "WARNING: Could not link to the BLAS library. It can be obtained at"
1562 echo "http://www.netlib.org/blas. Use --with-libdirs and/or --with-libs"
1563 echo "to specify the name of the library."
1564 AC_MSG_ERROR([BLAS is required to complete the build])
1565fi
1566
1567LIBS="$LIBSSAV $LIBBLAS $FLIBS"
1568
1569LIBLAPACK=""
1570F77_DGESVD=`$PERL $srcdir/bin/mkf77sym.pl.in -method $F77_SYMBOLS DGESVD`
1571AC_CHECK_FUNC($F77_DGESVD,HAVE_LAPACK=yes,[
1572 AC_CHECK_LIB(lapack,$F77_DGESVD,[HAVE_LAPACK=yes;LIBLAPACK="-llapack"]
1573 )]
1574)
1575AC_DEFINE(HAVE_LAPACK, [$HAVE_LAPACK], ["use lapack"])
1576if test X$HAVE_LAPACK != Xyes; then
1577 echo "Could not link to the LAPACK library. It can be obtained at"
1578 echo "http://www.netlib.org/lapack. Use --with-libdirs and/or --with-libs"
1579 echo "to specify the name of the library."
1580 AC_MSG_ERROR([LAPACK is required to complete the build])
1581fi
1582
1583FLIBS="$LIBLAPACK $LIBBLAS $FLIBS"
1584AC_LANG_RESTORE
1585
1586dnl ----------- check for Scalable BLAS library --------------
1587
1588LIBSSAV="$LIBS"
1589LIBS="$LIBS $FLIBS"
1590HAVE_SCALABLE_BLAS=no
1591AC_CHECK_FUNC(sB_init,
1592 HAVE_SCALABLE_BLAS=yes,[
1593 AC_CHECK_LIB(sB_BLAS,sB_init,[
1594 HAVE_SCALABLE_BLAS=yes
1595 LIBSSAV="-lsB_BLAS $LIBSSAV"
1596 ])]
1597)
1598LIBS="$LIBSSAV"
1599if test $HAVE_SCALABLE_BLAS = yes; then
1600 AC_DEFINE(HAVE_SCALABLE_BLAS, 1, ["have scalabale blas"])
1601fi
1602
1603dnl ----------- NIAMA library checks --------------
1604
1605AC_LANG_SAVE
1606AC_LANG_CPLUSPLUS
1607AC_CHECK_PROG(NIAMACFG,niama-config,niama-config)
1608if test X$NIAMACFG != X; then
1609 LIBSSAV="$LIBS"
1610 CPPSAV="$CPPFLAGS"
1611 NIAMALIBS="`niama-config --libs` `niama-config --corbalibs`"
1612 CPPFLAGS="$CPPFLAGS `niama-config --cppflags`"
1613 LIBS="$NIAMALIBS $LIBS"
1614AC_TRY_LINK([
1615#include <niama.h>
1616],[
1617 exit(0);
1618],[
1619 AC_DEFINE(HAVE_NIAMA, 1, ["have NIAMA"])
1620],[
1621 LIBS="$LIBSSAV"
1622 CPPFLAGS="$CPPSAV"
1623]
1624)
1625fi
1626AC_LANG_RESTORE
1627
1628dnl ----------- libint library checks --------------
1629
1630AC_LANG_SAVE
1631AC_LANG_CPLUSPLUS
1632AC_CHECK_HEADERS(libint/libint.h,
1633 HAVE_LIBINT_LIBINT_H=yes
1634 AC_CHECK_LIB(int,init_libint_base,
1635 HAVE_LIBINT=yes
1636 AC_DEFINE(HAVE_LIBINT, 1, ["have libint"])
1637 AC_SUBST(HAVE_LIBINT)
1638 LIBS="-lint $LIBS"
1639 ),
1640 HAVE_LIBINT_LIBINT_H=no
1641 )
1642AC_LANG_RESTORE
1643AC_DEFINE(HAVE_LIBINT_LIBINT_H, [$HAVE_LIBINT_LIBINT_H], ["use libint.h"])
1644AM_CONDITIONAL([COND_LIBINT], [test x"$HAVE_LIBINT" = x"1"])
1645
1646dnl ----------- libr12 library checks --------------
1647
1648AC_LANG_SAVE
1649AC_LANG_CPLUSPLUS
1650AC_CHECK_HEADERS(libr12/libr12.h,
1651 HAVE_LIBR12_LIBR12_H=yes
1652 AC_CHECK_LIB(r12,init_libr12_base,
1653 HAVE_LIBR12=yes
1654 AC_DEFINE(HAVE_LIBR12, 1, ["have libr12"])
1655 AC_SUBST(HAVE_LIBR12)
1656 LIBS="-lr12 $LIBS"
1657 ),
1658 HAVE_LIBR12_LIBR12_H=no
1659 )
1660AC_LANG_RESTORE
1661AC_DEFINE(HAVE_LIBR12_LIBR12_H, [$HAVE_LIBR12_LIBR12_H], ["use libr12.h"])
1662AM_CONDITIONAL([COND_LIBR12], [test x"$HAVE_LIBR12" = x"1"])
1663
1664dnl ----------- libderiv library checks --------------
1665
1666AC_LANG_SAVE
1667AC_LANG_CPLUSPLUS
1668AC_CHECK_HEADERS(libderiv/libderiv.h,
1669 HAVE_LIBDERIV_LIBDERIV_H=yes
1670 AC_CHECK_LIB(deriv,init_libderiv_base,
1671 HAVE_LIBDERIV=yes
1672 AC_DEFINE(HAVE_LIBDERIV, 1, ["have libderiv"])
1673 AC_SUBST(HAVE_LIBDERIV)
1674 LIBS="-lderiv $LIBS"
1675 ),
1676 HAVE_LIBDERIV_LIBDERIV_H=no
1677 )
1678AC_LANG_RESTORE
1679AC_DEFINE(HAVE_LIBDERIV_LIBDERIV_H, [$HAVE_LIBDERIV_LIBDERIV_H], ["use libderiv.h"])
1680AM_CONDITIONAL([COND_LIBDERIV], [test x"$HAVE_LIBDERIV" = x"1"])
1681
1682dnl ----------- make sure we have everything for cints and mbptr12 ----------
1683
1684if test ! X$HAVE_LIBR12 = Xyes -o ! X$HAVE_LIBINT = Xyes; then
1685 EXCLUDED_DIRS="-x SRC_LIB_CHEMISTRY_QC_CINTS -x SRC_LIB_CHEMISTRY_QC_MBPTR12 $EXCLUDED_DIRS"
1686fi
1687
1688dnl --------- Template instantiation. ---------
1689
1690if test $template_instantiation = auto; then
1691AC_MSG_CHECKING(choosing template instantiation method)
1692 if test X$GXX = Xyes; then
1693 AC_MSG_RESULT("gcc (none)")
1694 else
1695 case $target in
1696 *-sgi-irix6.0*)
1697 AC_MSG_RESULT("*-sgi-irix6.0* (none)")
1698 ;;
1699 *-sgi-irix*)
1700 template_instantiation=ptused
1701 AC_MSG_RESULT("*-sgi-irix* (ptused)")
1702 ;;
1703 *-cray-unicos*)
1704 template_instantiation=craysimp
1705 AC_MSG_RESULT("*-cray-unicos* (craysimp)")
1706 ;;
1707 *-dec-osf*)
1708 template_instantiation=repodir
1709 AC_MSG_RESULT("*-dec-osf* (repodir)")
1710 ;;
1711 alpha*)
1712 template_instantiation=repodir
1713 AC_MSG_RESULT("alpha* non-GNU C++ (repodir)")
1714 ;;
1715 *-solaris*)
1716 template_instantiation=sunexpl
1717 AC_MSG_RESULT("*-solaris* (sunexpl)")
1718 ;;
1719 *)
1720 AC_MSG_RESULT("generic non GNU (none)")
1721 ;;
1722 esac
1723 fi
1724fi
1725
1726if test $template_instantiation = auto; then
1727 template_instantiation=none
1728fi
1729
1730AC_MSG_CHECKING(template instantiation flags)
1731TMPLINST=no
1732TMPLREPO=
1733TMPLINLIB=no
1734case $template_instantiation in
1735 repodir)
1736 TMPLREPO=cxx_repository
1737 TMPLINLIB=yes
1738 ;;
1739 craysimp)
1740 CXXFLAGS="$CXXFLAGS -h simple_templates"
1741 ;;
1742 gnurepo)
1743 TMPLINST=yes
1744 CXXFLAGS="$CXXFLAGS -frepo"
1745 AC_MSG_RESULT(gnurepo)
1746 ;;
1747 gnuexpl)
1748 # automatic template instantiation causes problems with libstc++-v3
1749 CXXFLAGS="$CXXFLAGS -fno-implicit-templates"
1750 EXPLICIT_TEMPLATE_INSTANTIATION=yes
1751 AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION, 1, ["template instantiation flags"])
1752 ;;
1753 sunexpl)
1754 CXXFLAGS="$CXXFLAGS -instances=explicit"
1755 AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION, 1, ["template instantiation flags"])
1756 ;;
1757 ptused)
1758 CXXFLAGS="$CXXFLAGS -ptused"
1759 ;;
1760 none)
1761 AC_MSG_RESULT(none)
1762 ;;
1763 *)
1764 AC_MSG_RESULT($template_instantiation)
1765 AC_MSG_ERROR(unknown template instantiation method)
1766esac
1767
1768AC_SUBST(TMPLINST)
1769AC_SUBST(TMPLREPO)
1770AC_SUBST(TMPLINLIB)
1771
1772dnl --------- Checks that must be done last. ---------
1773
1774AC_MSG_CHECKING([for special flags that must be set last])
1775case $target in
1776 i860-intel-puma*)
1777 LDFLAGS="$LDFLAGS -mpuma -mnoieee"
1778 AC_MSG_RESULT(paragon puma)
1779 ;;
1780 i686-intel-cougar*)
1781 LDFLAGS="$LDFLAGS -mcougar -mnoieee"
1782 AC_MSG_RESULT(teraflop cougar)
1783 ;;
1784 i860-intel-sunmos*)
1785 LDFLAGS="$LDFLAGS -msunmos -mnoieee"
1786 AC_MSG_RESULT(paragon sunmos)
1787 ;;
1788 i860-intel-osf*)
1789 LDFLAGS="$LDFLAGS -mnx -mnoieee"
1790 AC_MSG_RESULT(osf paragon)
1791 ;;
1792 *)
1793 AC_MSG_RESULT(none)
1794 ;;
1795esac
1796
1797dnl --------- Shared library configuration. ---------
1798
1799enablelibtool=yes
1800AC_ARG_ENABLE(libtool,
1801[ --disable-libtool Do not use libtool.],
1802[
1803case $enableval in
1804 yes)
1805 ;;
1806 no)
1807 enablelibtool=no
1808 ;;
1809 *)
1810 AC_MSG_ERROR([Invalid value for --(dis|en)able-libtool ($enableval)])
1811 ;;
1812esac
1813])
1814
1815if test "$enablelibtool" = yes; then
1816
1817dnl by default make only static libraries
1818AC_DISABLE_SHARED
1819AC_PROG_LIBTOOL
1820
1821OBJSUF=lo
1822LIBSUF=la
1823
1824else
1825
1826enable_shared=no
1827
1828fi
1829
1830if test "$enable_shared" = "no"; then
1831 OBJSUF=o
1832 LIBSUF=a
1833fi
1834
1835ENABLESHARED=$enable_shared
1836AC_SUBST(ENABLESHARED)
1837
1838dnl --------- CCA component configuration ---------
1839
1840have_condcca="false"
1841if test $components == "yes"; then
1842
1843 if test $HAVE_MPI == "yes" &&
1844 test $HAVE_MPIPP == "no"; then
1845 AC_MSG_ERROR([libmpi++ needed for mpi cca components])
1846 fi
1847
1848 if test -z $CCA_CHEM_CONFIG && ! test -x $CCA_CHEM_CONFIG; then
1849 AC_MSG_ERROR([cca-chem-config is required to build CCA component code])
1850 fi
1851
1852 CCA_CHEM_INCLUDE=`$CCA_CHEM_CONFIG --includedir`
1853 CCA_CHEM_LIB=`$CCA_CHEM_CONFIG --libdir`
1854 CCA_CHEM_PREFIX=`$CCA_CHEM_CONFIG --prefix`
1855 CCA_CHEM_REPO=$CCA_CHEM_PREFIX/repo
1856 AC_SUBST(CCA_CHEM_INCLUDE)
1857 AC_SUBST(CCA_CHEM_LIB)
1858 AC_SUBST(CCA_CHEM_REPO)
1859
1860 CCAFE_CONFIG=`$CCA_CHEM_CONFIG --ccafe-config`
1861 ENABLE_PYTHON="no" # no need for python checks
1862 AC_CHECK_CCA()
1863
1864 LIBS="-L$CCAFE_LIB $LIBS"
1865 CCA_CHEM_INCLUDE=-I$CCA_CHEM_INCLUDE
1866 BABEL_INCLUDE=-I$BABEL_INCLUDE
1867 CCA_SPEC_BABEL_INCLUDE=-I$CCA_SPEC_BABEL_INCLUDE
1868 CCAFE_INCLUDE="-I$CCAFE_INCLUDE -I$CCAFE_INCLUDE/dc/babel/babel-cca/server"
1869 CPPFLAGS="$CPPFLAGS $BABEL_INCLUDE $CCA_SPEC_BABEL_INCLUDE $CCA_CHEM_INCLUDE $CCAFE_INCLUDE"
1870
1871 AC_CHECK_HEADER(sidl.h,
1872 AC_DEFINE(HAVE_SIDL_HEADERS, 1, ["have sidl"]),
1873 AC_MSG_ERROR([problem with babel headers]) )
1874 AC_CHECK_HEADER(gov_cca_IOR.h,
1875 AC_DEFINE(HAVE_CCA_SPEC_BABEL_HEADERS, 1, ["have CCA spec babel headers"]),
1876 AC_MSG_ERROR([problem with cca-spec-babel headers]) )
1877 AC_CHECK_HEADER(Chemistry_QC_Model_IOR.h,
1878 AC_DEFINE(HAVE_CCA_CHEM_HEADERS, 1, ["have CCA chem headers"]),
1879 AC_MSG_ERROR([problem with cca-chem-generic headers]) )
1880
1881 have_condcca="true"
1882else
1883 EXCLUDED_DIRS="-x LIB_CCA -x SRC_LIB_CHEMISTRY_CCA -x SRC_LIB_CHEMISTRY_QC_INTCCA $EXCLUDED_DIRS"
1884fi
1885AM_CONDITIONAL(COND_CCA, [test x"$have_condcca" = x"true"])
1886
1887dnl --------- Find the list of all sc libraries. ---------
1888
1889SCLIBS=`$PERL $srcdir/bin/listlibs.pl -I$srcdir/src/lib -DLIBSUF=$LIBSUF $srcdir/src/lib`
1890AC_SUBST(SCLIBS)
1891
1892dnl --------- Define the library directory macros. ---------
1893
1894if test "$enableproduction" = "no"; then
1895# abs_srcdir is not available, only srcdir, which is insufficient
1896abs_srcdir=$(readlink -m "${srcdir}")
1897AC_DEFINE_DIR(SRC_SCLIBDIR, abs_srcdir/lib, ["source SC libdir"])
1898fi
1899AC_DEFINE_DIR(INSTALLED_SCLIBDIR, prefix/lib, ["install SC libdir"])
1900AC_DEFINE_DIR(SCDATADIR, scdatadir, ["SC data dir"])
1901
1902dnl --------- Create the stub Makefiles. ---------
1903
1904dnl $PERL $srcdir/bin/objectdir.pl $EXCLUDED_DIRS $srcdir
1905
1906### output files
1907AC_CONFIG_FILES([
1908 bin/mkf77sym.pl
1909])
1910AC_CONFIG_FILES([
1911 doc/doxygen.cfg
1912])
1913AC_CONFIG_FILES([
1914 Makefile
1915 lib/Makefile
1916 src/lib/Makefile
1917 src/bin/mpqc/Makefile
1918])
1919AC_CONFIG_TESTDIR([src/bin/mpqc/validate])
1920AC_CONFIG_FILES([
1921 src/bin/mpqc/validate/atlocal
1922 src/bin/mpqc/validate/Makefile
1923])
1924AC_CONFIG_FILES([src/bin/mpqc/validate/molecuilder_mpqc], [chmod +x src/bin/mpqc/validate/molecuilder_mpqc])
1925AC_CONFIG_FILES([src/lib/test_env.sh], [chmod +x src/lib/test_env.sh])
1926
1927AC_OUTPUT
1928
1929
Note: See TracBrowser for help on using the repository browser.