source: ThirdParty/mpqc_open/configure.ac@ 12add2

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 12add2 was 12add2, checked in by Frederik Heber <heber@…>, 8 years ago

Added missing SRCDIR define to scconfig.h

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