129
[ --with-aix64 Compiling on a 64-bit AIX machine.],
130
CXXFLAGS="$CXXFLAGS -maix64"
131
F77FLAGS="$F77FLAGS -maix64"
132
CFLAGS="$CFLAGS -maix64"
133
LDFLAGS="$LDFLAGS -maix64"
135
AC_MSG_RESULT([Compiling on 64-bit AIX])
105
138
AC_ARG_WITH(cc,[ --with-cc which C compiler to use],[
114
CC_LIST="$withval $CC_LIST"
119
141
AC_PROG_CC([$CC_LIST])
121
143
AC_ARG_WITH(cxx,[ --with-cxx which C++ compiler to use],[
130
CXX_LIST="$withval $CXX_LIST"
135
146
AC_PROG_CXX([$CXX_LIST])
137
148
AC_ARG_WITH(fc,[ --with-fc which Fortran compiler to use],[
146
F77_LIST="$withval $F77_LIST"
151
if test "$F77_LIST" != no; then
152
AC_PROG_F77([$F77_LIST])
158
## Fortran-C linking convention tests
159
if test -z "$F77"; then
161
elif test "$F77" = "no"; then
165
dnl ----------- See if Fortran works --------------
167
if test -n "$F77" -a "$F77" != no ; then
168
AC_MSG_CHECKING([if fortran compiler works])
170
echo " program main" > ffunc.f
171
echo " end" >> ffunc.f
172
if $F77 -o ffunc ffunc.f 1>&5 2>&5; then
179
/bin/rm -f ffunc ffunc.f
182
dnl ----------- Fortran symbol names --------------
160
184
AC_ARG_WITH(f77symbol,[ --with-f77symbol FORTRAN77 symbol convention
161
185
Allowed values are:
186
210
if test -z "$FC_SYMBOL"; then
187
AC_MSG_CHECKING(Fortran symbols)
188
if test -n "$F77" ; then
189
/bin/rm -f ffunc.f flink.c
211
AC_MSG_CHECKING([fortran symbols])
212
if test -n "$F77" -a "$F77" != no -a X$F77_WORKS != Xno; then
213
/bin/rm -f ffunc.f flink.cc
190
214
echo " subroutine ffunc()" > ffunc.f
191
215
echo " return" >> ffunc.f
192
echo " end" >> ffunc.f
216
echo " end" >> ffunc.f
193
217
$F77 -c ffunc.f 1>/dev/null 2>/dev/null
194
echo "main(){ FF(); return 0; }" > flink.c
195
if $CC -o flink -DFF=ffunc flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
196
AC_MSG_RESULT(same as C)
198
elif $CC -o flink -DFF=ffunc_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
199
AC_MSG_RESULT(lowercase with underscore)
201
elif $CC -o flink -DFF=FFUNC flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
202
AC_MSG_RESULT(uppercase)
204
elif $CC -o flink -DFF=FFUNC_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
205
AC_MSG_RESULT(uppercase with underscore)
218
echo "extern \"C\" void FF(); int main(int argc, char** argv){ FF(); return 0; }" > flink.cc
219
if $CXX -o flink -DFF=ffunc flink.cc ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
220
AC_MSG_RESULT([lowercase])
222
elif $CXX -o flink -DFF=ffunc_ flink.cc ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
223
AC_MSG_RESULT([lowercase with underscore])
225
elif $CXX -o flink -DFF=FFUNC flink.cc ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
226
AC_MSG_RESULT([uppercase])
228
elif $CXX -o flink -DFF=FFUNC_ flink.cc ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
229
AC_MSG_RESULT([uppercase with underscore])
208
AC_MSG_RESULT(giving up)
209
AC_MSG_ERROR(could not determine fortran symbol names)
232
AC_MSG_RESULT([giving up])
233
AC_MSG_ERROR([could not determine F77 symbol names])
211
/bin/rm -f ffunc.f ffunc.o flink flink.c flink.o ffunc
235
/bin/rm -f ffunc.f ffunc.o flink flink.cc flink.o ffunc
214
AC_MSG_RESULT(No Fortran compiler provided; guessing lowercase with underscore)
238
AC_MSG_RESULT([will assume lowercase with underscore])
217
241
AC_SUBST(FC_SYMBOL)
309
# Check for doxygen and it buddies
311
AC_CHECK_PROGS(DOXYGEN,doxygen,NO)
314
[ --with-dot Gives the path to the dot graph generator.],
318
if test X$DOT = Xno; then
320
elif test X$DOT = Xyes; then
321
AC_CHECK_PROG(HAVE_DOT,dot,YES,NO)
285
330
## Check for libraries
288
333
if test ! -z "$F77"; then
289
334
AC_F77_LIBRARY_LDFLAGS
335
dnl --- This just implicitly checks that FLIBS can co-exist with the C++ linker
336
AC_CHECK_LIB(c,exit,[],[
338
AC_MSG_WARN([F77 libraries don't seem to link with C++ programs])
291
# This just implicitly checks that FLIBS can co-exist with the C linker
292
AC_CHECK_LIB(c,exit,[],[
294
AC_MSG_WARN([F77 libraries don't seem to link with C programs])
297
343
AC_ARG_WITH(blas,[ --with-blas which blas library to use],[
348
394
### If the user didn't give us a BLAS lib, see if we can find one
350
# If were using the Intel compilers, we prefer MKL as well
396
# If we're using the Intel compilers, we prefer MKL as well
351
397
if test -z "$BLAS"; then
352
if test $CC = icc; then
398
if test $CC = icc -o $CXX = icpc; then
353
399
AC_CHECK_LIB(mkl, $DGEMM_SYMBOL, BLAS="-lmkl")
356
402
# Otherwise, run through a list of possibilities
357
403
if test -z "$BLAS"; then
358
AC_CHECK_LIB(essl, $DGEMM_SYMBOL, BLAS="-lessl")
404
AC_CHECK_LIB(essl, $DGEMM_SYMBOL, BLAS="-lessl -lpthread")
360
406
if test -z "$BLAS"; then
361
407
AC_CHECK_LIB(scs, $DGEMM_SYMBOL, BLAS="-lscs")
455
500
AC_CXX_PROCESS_CHECK([cstddef],[#include <cstddef>],,[HAVE_CSTDDEF=1],[HAVE_CSTDDEF=0])
456
501
CXXDEF="$CXXDEF -DHAVE_CSTDDEF=$HAVE_CSTDDEF"
464
#check to see if void* is allowed
465
AC_MSG_CHECKING(for void pointers)
467
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
469
void *func(void*ptr) { return ptr;
470
]])],[],[psi_ac_voidptr=no])
471
AC_MSG_RESULT($psi_ac_voidptr)
472
if test $psi_ac_voidptr = "no"; then
473
CDEF="$CDEF -DNO_VOID_PTR"
509
AC_ARG_WITH(ruby-include,[ --with-ruby-include where to look for Ruby headers (-Idir1 -Idir2 etc.)],[
521
if test X$CHECKRUBY = Xyes; then
522
REF_CPPFLAGS=$CPPFLAGS CPPFLAGS="$REF_CPPFLAGS $RUBYINC"
523
AC_CHECK_HEADER(ruby.h,[HAVE_RUBY="yes"],[HAVE_RUBY="no"])
524
CPPFLAGS=$REF_CPPFLAGS
527
if test X$HAVE_RUBY = Xyes; then
529
RUBYLIB="-lruby-static"
531
AC_ARG_WITH(ruby-lib,[ --with-ruby-lib which Ruby library to use (-Ldir1 -lruby_red)],[
543
if test $CHECKRUBY = yes; then
544
AC_MSG_CHECKING([for ruby_init])
545
REF_LIBS=$LIBS LIBS="$RUBYLIB $LIBS"
546
REF_CPPFLAGS=$CPPFLAGS CPPFLAGS="$REF_CPPFLAGS $RUBYINC"
552
void (*funcptr)() = ruby_init;
562
CPPFLAGS=$REF_CPPFLAGS
566
#########################################################################
567
# Special linking flags for psirb, because it loads shared object files #
568
# This has to do with dlopen being "lazy" by default on Apple, but not #
570
#########################################################################
571
case $target_vendor in
576
RUBYLDFLAGS="-rdynamic -Wl,-export-dynamic"
582
AC_SUBST(RUBYLDFLAGS)
477
585
## Check for compiler characteristics
480
test -z "$F77SUF" && F77SUF=f AC_SUBST(F77SUF)
481
588
test -z "$LIBSUF" && LIBSUF=a AC_SUBST(LIBSUF)
482
589
test -z "$OBJSUF" && OBJSUF=o AC_SUBST(OBJSUF)
484
AC_CC_PROCESS_CHECK(C dependency processing,[
485
#include "nosuchincludefile.h"
486
],-M,CCDEPEND='$(CC) -M'; DODEPEND=yes,CCDEPEND=":"; DODEPEND=no)
489
AC_MSG_RESULT(CCDEPEND is $CCDEPEND)
490
AC_MSG_RESULT(DODEPEND is $DODEPEND)
492
AC_CHECK_LIB(m,exit,CLIBS="$CLIBS -lm")
493
AC_CHECK_LIB(bsd,exit,CLIBS="$CLIBS -lbsd")
494
AC_MSG_RESULT(c libs: $CLIBS)
497
AC_CHECK_LIB(m,exit,CXXLIBS="$CXXLIBS -lm")
498
AC_MSG_RESULT(c++ libs: $CXXLIBS)
501
PSICPPFLAGS='-I. -I$(objincdir) -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I$(top_objdir)/src/lib' AC_SUBST(PSICPPFLAGS)
503
#default compiler flags
504
FDBG='-g' AC_SUBST(FDBG)
505
FOPT='-O' AC_SUBST(FOPT)
506
FDEF='' AC_SUBST(FDEF)
507
FOTH='' AC_SUBST(FOTH)
508
FSTATIC='' AC_SUBST(FSTATIC)
509
FINC='$(CPPFLAGS) $(PSICPPFLAGS)' AC_SUBST(FINC)
510
CDBG='-g' AC_SUBST(CDBG)
511
COPT='-O2' AC_SUBST(COPT)
512
CDEF='' AC_SUBST(CDEF)
513
COTH='' AC_SUBST(COTH)
514
CINC='$(CPPFLAGS) $(PSICPPFLAGS)' AC_SUBST(CINC)
515
CXXDBG='-g' AC_SUBST(CXXDBG)
516
CXXOPT='-O2' AC_SUBST(CXXOPT)
517
CXXDEF='' AC_SUBST(CXXDEF)
518
CXXOTH='' AC_SUBST(CXXOTH)
519
CXXINC='$(CPPFLAGS) $(PSICPPFLAGS)' AC_SUBST(CXXINC)
591
dnl -- check how dependency information is built --
592
# The GNU compilers work with:
597
/bin/rm -f depcheck.u depcheck.c depcheck.cc depcheck.o
598
# Check for an IBM visual age C compiler
599
echo "#include <stdio.h>" > depcheck.c
600
$CC $CPPFLAGS $CFLAGS -M depcheck.c > /dev/null 2>&1
601
if test -f depcheck.u; then
604
/bin/rm -f depcheck.u depcheck.c depcheck.cc depcheck.o
605
# Check for an IBM visual age C++ compiler
606
echo "#include <iostream>" > depcheck.cc
607
$CXX $CPPFLAGS $CXXFLAGS -M -E depcheck.cc > /dev/null 2>&1
608
if test -f depcheck.u; then
610
CXXDEPENDFLAGS="-M -E"
612
/bin/rm -f depcheck.u depcheck.c depcheck.cc depcheck.o
614
AC_SUBST(CCDEPENDSUF)
615
AC_SUBST(CXXDEPENDSUF)
616
AC_SUBST(CCDEPENDFLAGS)
617
AC_SUBST(CXXDEPENDFLAGS)
523
619
AC_CHECK_DECLS([putenv],[extradef="-DHAVE_DECL_PUTENV=1"])
524
620
CDEF="$CDEF $extradef"
545
641
CXXDEF="$CXXDEF $extradef"
548
# set up cpu specific flags
549
AC_MSG_CHECKING([for architecture/compiler specific optimization flags])
645
dnl ------------------- Determine Compiler Flags --------------------
647
# User's input overrides all defaults
648
# Defaults depend on the compiler and the architecture
649
AC_MSG_RESULT([-------------------------------------------------------------------------------])
651
# default is to optimize with -O2, no debugging symbols will be generated
652
PSICPPFLAGS='-I. -I$(objincdir) -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I$(top_objdir)/src/lib' AC_SUBST(PSICPPFLAGS)
653
CDBG='' AC_SUBST(CDBG)
654
COPT='-O2' AC_SUBST(COPT)
656
COTH='' AC_SUBST(COTH)
657
CINC='$(CPPFLAGS) $(PSICPPFLAGS)' AC_SUBST(CINC)
658
CXXDBG='' AC_SUBST(CXXDBG)
659
CXXOPT='-O2' AC_SUBST(CXXOPT)
661
CXXOTH='' AC_SUBST(CXXOTH)
662
CXXINC='$(CPPFLAGS) $(PSICPPFLAGS)' AC_SUBST(CXXINC)
665
# The default is to optimize. --with-opt=no or --without-opt will turn
668
AC_ARG_WITH(opt,[ --with-opt Specifies the C++/C optimization compiler flags.
669
--with-opt=no means no optimization],[
683
if test X$OPTFLAGS_GIVEN = Xyes; then
684
AC_MSG_RESULT([C++ optimization flags : $CXXOPT])
687
# if not given by the user, use architecture-dependent defaults
688
if test X$OPTFLAGS_GIVEN = Xno; then
552
if test "$FC" = xlf_r ; then
553
FOPT="-O2 -qarch=com -qxflag=xalias -qdpc -qfloat=fold -qfloat=maf -qmaxmem=-1"
555
691
if test "$CC" = xlc_r -o "$CC" = cc_r ; then
556
COPT="-O2 -qarch=com -qfloat=maf -qfloat=fold -qmaxmem=-1"
692
COPT="-O3 -qhot -qstrict -qarch=auto -qtune=auto -qmaxmem=-1"
558
694
if test "$CXX" = xlC_r ; then
559
CXXOPT="-O2 -qarch=com -qfloat=maf -qfloat=fold -qmaxmem=-1"
695
CXXOPT="-O3 -qhot -qstrict -qarch=auto -qtune=auto -qmaxmem=-1"
563
if test "$FC" = xlf_r ; then
564
FOPT="-O2 -qarch=ppc -qxflag=xalias -qdpc -qfloat=fold -qmaxmem=-1 -qfloat=maf"
566
699
if test "$CC" = xlc_r -o "$CC" = cc_r ; then
567
COPT="-O2 -qarch=ppc -qfloat=maf -qfloat=fold -qmaxmem=-1"
700
COPT="-O3 -qhot -qstrict -qarch=auto -qtune=auto -qmaxmem=-1"
569
702
if test "$CXX" = xlC_r ; then
570
CXXOPT="-O2 -qarch=ppc -qfloat=maf -qfloat=fold -qmaxmem=-1"
574
if test "$FC" = g77 ; then
575
FOPT="-O2 -march=pentiumpro"
577
if test "$CC" = gcc -o "$CC" = cc ; then
578
COPT="-O2 -march=pentiumpro"
580
if test "$CXX" = g++ -o "$CXX" = c++ -o "$CXX" = gcc ; then
581
CXXOPT="-O2 -march=pentiumpro"
703
CXXOPT="-O3 -qhot -qstrict -qarch=auto -qtune=auto -qmaxmem=-1"
704
LDLIBS="$LDLIBS $FLIBS"
706
if test "$CXX" = g++ ; then
708
LDLIBS="$LDLIBS $FLIBS"
589
716
CXXOPT="-O3 -m64"
593
AC_MSG_RESULT([C optimization flags: $COPT])
594
AC_MSG_RESULT([C++ optimization flags: $CXXOPT])
720
AC_MSG_RESULT([C++ optimization flags : $CXXOPT])
596
AC_MSG_CHECKING([for OS specific flags])
597
723
case $target_os in
599
725
# _ALL_SOURCE is required because some include files on AIX don't seem to work with pure POSIX
600
EXTRADEFS="-DAIX -D_LARGE_FILES -D_ALL_SOURCE"
601
FDEF="$FDEF $EXTRADEFS"
726
# Removed -D_LARGE_FILE
727
EXTRADEFS="-D_ALL_SOURCE"
602
728
CDEF="$CDEF $EXTRADEFS"
603
729
CXXDEF="$CXXDEF $EXTRADEFS"
606
732
EXTRADEFS="-DLinux -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
607
FDEF="$FDEF $EXTRADEFS"
608
733
CDEF="$CDEF $EXTRADEFS"
609
734
CXXDEF="$CXXDEF $EXTRADEFS"
612
AC_MSG_RESULT([C preprocessor directives: $CDEF])
613
AC_MSG_RESULT([C++ preprocessor directives: $CXXDEF])
615
# Set up CFLAGS and FFLAGS.
617
CFLAGS='$(CDBG) $(COPT) $(CDEF) $(COTH) $(CINC)' AC_SUBST(CFLAGS)
618
CXXFLAGS='$(CXXDBG) $(CXXOPT) $(CXXDEF) $(CXXOTH) $(CXXINC)' AC_SUBST(CXXFLAGS)
619
FFLAGS='$(FDBG) $(FOPT) $(FOTH) $(FSTATIC)' AC_SUBST(FFLAGS)
621
# Adjust the debug flags.
737
AC_MSG_RESULT([extra preprocessor defines : $CXXDEF])
739
# Obtain the debug flags.
622
740
# The default is to not debug. --with-debug will turn on debugging.
623
741
AC_ARG_WITH(debug,[ --with-debug will turn on debugging],[
634
753
CXXDBG="$withval"
638
],CDBG='' CXXDBG='' FDBG='')
640
# Adjust the optimize flags.
641
# The default is to optimize. --with-opt=no or --without-opt will turn
643
AC_ARG_WITH(opt,[ --with-opt --with-opt=no to turn off optimization],[
757
AC_MSG_RESULT([debugging C++ compiler flags : $CXXDBG])
660
759
# Adjust the flags dealing with strictness of the compilers.
661
760
# The default is to disable strict language checks. --with-opt=no or
681
AC_MSG_RESULT([C extra flags: $COTH])
682
AC_MSG_RESULT([C++ extra flags: $CXXOTH])
685
## Check for library functions
777
AC_MSG_RESULT([misc C++ compiler flags : $CXXOTH])
779
CFLAGS='$(CDBG) $(COPT) $(CDEF) $(COTH) $(CINC)' AC_SUBST(CFLAGS)
780
CXXFLAGS='$(CXXDBG) $(CXXOPT) $(CXXDEF) $(CXXOTH) $(CXXINC)' AC_SUBST(CXXFLAGS)
782
if test X$AIX64 = Xyes; then
783
if test X$CXX = Xg++; then
785
CXXOTH="$CXXOTH -maix64"
786
F77FLAGS="$F77FLAGS -maix64"
787
LDFLAGS="$LDFLAGS -maix64"
788
LDLIBS="$LAPACK $BLAS $LDLIBS"
792
AC_MSG_RESULT([-------------------------------------------------------------------------------])
791
911
tests/rohf-stab/Makefile
792
912
tests/rohf-stab/rohf-stab.pl
793
913
tests/cis-sp/Makefile
914
tests/cisd-h2o+-0/Makefile
915
tests/cisd-h2o+-1/Makefile
916
tests/cisd-h2o+-2/Makefile
794
917
tests/cisd-sp/Makefile
918
tests/cisd-sp-2/Makefile
795
919
tests/cisd-opt-numer/Makefile
796
920
tests/fci-h2o/Makefile
921
tests/fci-h2o-2/Makefile
922
tests/fci-h2o-clpse/Makefile
923
tests/fci-h2o-fzcv/Makefile
797
924
tests/fci-dipole/Makefile
798
925
tests/fci-trans/Makefile
799
926
tests/casscf-sp/Makefile
800
927
tests/casscf-sa-sp/Makefile
801
928
tests/casscf-fzc-sp/Makefile
802
929
tests/rasscf-sp/Makefile
930
tests/casscf-opt-numer/Makefile
931
tests/casscf-opt/Makefile
932
tests/zaptn-nh2/Makefile
803
933
tests/mp2-sp/Makefile
804
934
tests/mp2-direct-sp/Makefile
805
935
tests/mp2-oeprop/Makefile
853
986
tests/cc48/Makefile
854
987
tests/cc49/Makefile
855
988
tests/cc50/Makefile
989
tests/psimrcc-sp1/Makefile
856
990
tests/dboc-rhf1/Makefile
857
991
tests/dboc-rohf1/Makefile
858
992
tests/dboc-uhf1/Makefile
859
993
tests/dboc-rcisd1/Makefile
860
994
tests/dboc-rocisd1/Makefile
861
995
tests/extrema-zmat/Makefile
862
tests/extrema-zmat/extrema-zmat.pl
863
996
tests/extrema-deloc/Makefile
864
tests/extrema-deloc/extrema-deloc.pl
997
tests/mcscf-rhf1/Makefile
998
tests/mcscf-rohf1/Makefile
999
tests/mcscf-twocon1/Makefile
865
1000
tests/mp2r12-sp1/Makefile
866
1001
tests/mp2-opt-numer/Makefile
867
1002
tests/mp2-opt/Makefile
870
1005
tests/uhf-lindep1/Makefile
871
1006
tests/psi_start/Makefile
872
1007
tests/psi_start/psi_start.pl
1008
tests/rb-scf-opt-numer/Makefile
1009
tests/rb-ccsd_t-sp/Makefile
1010
tests/rb-fci-h2o/Makefile
1011
tests/rb-ccsd-opt-grad/Makefile
1012
tests/scf-mvd-opt/Makefile
1013
tests/scf-mvd-opt-numer/Makefile
1014
tests/scf-mvd-opt-puream/Makefile
1015
tests/scf-mvd-opt-numer-puream/Makefile
1016
tests/scf+d-opt1/Makefile
1017
tests/scf+d-freq/Makefile
873
1018
src/bin/giao/Makefile
1019
tests/casscf-sp-reorder/Makefile
1021
src/samples/Makefile
1022
src/samples/MakeVars
1023
src/samples/MakeRules
1024
src/samples/mints/Makefile
1029
if test $HAVE_RUBY = no; then
1030
if test -z $RUBYLIB; then
1031
AC_MSG_NOTICE([Unable to locate libruby-static.a will not link the psirb module.])
1033
if test -z $RUBYINC; then
1034
AC_MSG_NOTICE([Unable to locate ruby.h will not link the psirb module.])