source: ThirdParty/mpqc_open/configure.ac@ 5b2946

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 5b2946 was 5b2946, checked in by Frederik Heber <heber@…>, 8 years ago

configure.ac working, mpqc compiles, linking fails.

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