~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#
5
5
#
6
6
 
7
 
define([psi_version],[3.3.0])
 
7
define([psi_version],[3.4.0])
 
8
define([psi_buildid],[alpha])
8
9
define([psi_bugreport],[psicode@users.sourceforge.net])
9
10
AC_PREREQ(2.57)
10
11
AC_INIT([psi],[psi_version],[psi_bugreport])
12
13
AC_CONFIG_HEADER(include/psiconfig.h)
13
14
 
14
15
PSI_VERSION=psi_version
 
16
PSI_BUILDID=psi_buildid
15
17
PSI_BUGREPORT=psi_bugreport
16
18
AC_SUBST(PSI_VERSION)
 
19
AC_SUBST(PSI_BUILDID)
17
20
AC_SUBST(PSI_BUGREPORT)
18
21
AC_CONFIG_AUX_DIR(bin)
19
22
 
20
23
AC_CANONICAL_TARGET
21
24
AC_PREFIX_DEFAULT(/usr/local/psi)
22
25
 
23
 
AC_PROG_MAKE_SET([])
 
26
AC_PROG_MAKE_SET()
 
27
# Psi now is primarily C++
 
28
AC_LANG([C++])
24
29
 
25
30
srcdir=`(cd $srcdir; pwd)`
26
31
 
27
32
 
28
33
objincdir='$(top_objdir)/include'
29
 
AC_SUBST(objincdir)
30
 
 
31
 
docdir='$(prefix)/doc'
32
 
mandir='$(docdir)/man'
33
 
txtdir='$(docdir)/txt'
34
 
htmldir='$(docdir)/html'
35
 
dvidir='$(docdir)/dvi'
36
 
 
37
 
AC_SUBST(docdir)
38
 
AC_SUBST(mandir)
39
 
AC_SUBST(htmldir)
40
 
AC_SUBST(dvidir)
41
 
AC_SUBST(txtdir)
 
34
AC_SUBST([objincdir])
 
35
 
 
36
if test -z $docdir; then
 
37
       docdir='$(datadir)/doc/$(PACKAGE)'
 
38
       AC_SUBST([docdir])
 
39
fi
 
40
if test -z $txtdir; then
 
41
       txtdir='$(docdir)/txt'
 
42
       AC_SUBST([txtdir])
 
43
fi
 
44
if test -z $htmldir; then
 
45
       htmldir='$(docdir)/html'
 
46
       AC_SUBST([htmldir])
 
47
fi
 
48
if test -z $dvidir; then
 
49
       dvidir='$(docdir)/dvi'
 
50
       AC_SUBST([dvidir])
 
51
fi
 
52
pkgdatadir='$(datadir)/psi'
 
53
AC_SUBST([pkgdatadir])
42
54
 
43
55
INSTALL_INCLUDE='$(top_srcdir)/bin/installinc.sh' AC_SUBST(INSTALL_INCLUDE)
44
56
MKDIRS='$(top_srcdir)/bin/mkdirs.sh' AC_SUBST(MKDIRS)
63
75
  LIBDERIV_NEW_AM1=$((2*($withval)))
64
76
])
65
77
AC_SUBST(LIBDERIV_NEW_AM1)
66
 
LIBDERIV_NEW_AM2=4
 
78
LIBDERIV_NEW_AM2=6
67
79
AC_ARG_WITH(max-am-deriv2,[  --with-max-am-deriv2    maximum AM in ERI second derivatives],[
68
80
  LIBDERIV_NEW_AM2=$((2*($withval)))
69
81
])
79
91
AC_SUBST(LIBR12_NEW_AM)
80
92
AC_SUBST(LIBR12_OPT_AM)
81
93
 
 
94
PSI_INTEGRALS_STANDARD=1
 
95
AC_ARG_WITH(integrals-standard,[  --with-integrals-standard     specifies the standard for the basis normalization, etc.
 
96
                                The allowed values are cca (default) and psi.],[
 
97
case $withval in
 
98
  psi)
 
99
    PSI_INTEGRALS_STANDARD=0
 
100
    ;;
 
101
  cca)
 
102
    PSI_INTEGRALS_STANDARD=1
 
103
    ;;
 
104
  *)
 
105
    AC_MSG_WARN([did not recognize value $withval. will assume the default]) 
 
106
    ;;
 
107
esac
 
108
])
 
109
AC_DEFINE_UNQUOTED(PSI_INTEGRALS_STANDARD,$PSI_INTEGRALS_STANDARD)
 
110
 
82
111
########
83
112
## Check for programs
84
113
########
85
114
 
86
115
case $target_os in
87
116
  aix*)
88
 
    CC_LIST="cc_r gcc cc"
89
 
    CXX_LIST="xlC_r g++ c++"
90
 
    F77_LIST="xlf_r gfortran g77 ifort f77"
91
 
    ;;
92
 
  irix*)
93
 
    CC_LIST="cc gcc"
94
 
    CXX_LIST="CC g++ c++"
95
 
    F77_LIST="f77 gfortran g77 ifort"
 
117
    CC_LIST="gcc cc_r cc"
 
118
    CXX_LIST="g++ xlC_r c++"
 
119
    F77_LIST="ifort gfortran g77 xlf_r f77"
96
120
    ;;
97
121
  *)
98
122
    CC_LIST="gcc icc cc"
101
125
    ;;
102
126
esac
103
127
 
 
128
AC_ARG_WITH(aix64,
 
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"
 
134
AIX64=yes
 
135
AC_MSG_RESULT([Compiling on 64-bit AIX])
 
136
)
104
137
 
105
138
AC_ARG_WITH(cc,[  --with-cc               which C compiler to use],[
106
 
case $withval in
107
 
  yes)
108
 
    CC_LIST="$CC_LIST"
109
 
    ;;
110
 
  no)
111
 
    CC_LIST="$CC_LIST"
112
 
    ;;
113
 
  *)
114
 
    CC_LIST="$withval $CC_LIST"
115
 
    ;;
116
 
esac
 
139
CC=$withval
117
140
])
118
 
 
119
141
AC_PROG_CC([$CC_LIST])
120
142
 
121
143
AC_ARG_WITH(cxx,[  --with-cxx              which C++ compiler to use],[
122
 
case $withval in           
123
 
  yes)
124
 
    CXX_LIST="$CXX_LIST"
125
 
    ;;
126
 
  no)
127
 
    CXX_LIST="$CXX_LIST"
128
 
    ;;
129
 
  *)
130
 
    CXX_LIST="$withval $CXX_LIST"
131
 
    ;;
132
 
esac
 
144
CXX=$withval
133
145
])
134
 
 
135
146
AC_PROG_CXX([$CXX_LIST])
136
147
 
137
148
AC_ARG_WITH(fc,[  --with-fc               which Fortran compiler to use],[
138
149
case $withval in
139
 
  yes)
140
 
    F77_LIST="$F77_LIST"
141
 
    ;;
142
150
  no)
143
 
    F77_LIST='no'
 
151
    F77="no"
144
152
    ;;
145
153
  *)
146
 
    F77_LIST="$withval $F77_LIST"
 
154
    F77=$withval
147
155
    ;;
148
156
esac
149
157
])
150
158
 
151
 
if test "$F77_LIST" != no; then
152
 
  AC_PROG_F77([$F77_LIST])
153
 
else
154
 
  F77=
155
 
fi
156
 
AC_SUBST(FC,[$F77])
157
 
 
158
 
## Fortran-C linking convention tests
 
159
if test -z "$F77"; then
 
160
  AC_PROG_F77
 
161
elif test "$F77" = "no"; then
 
162
  F77=""
 
163
fi
 
164
 
 
165
dnl ----------- See if Fortran works --------------
 
166
 
 
167
if test -n "$F77" -a "$F77" != no ; then
 
168
  AC_MSG_CHECKING([if fortran compiler works])
 
169
  /bin/rm -f ffunc.f
 
170
  echo "      program main" > ffunc.f
 
171
  echo "      end" >> ffunc.f
 
172
  if $F77 -o ffunc ffunc.f 1>&5 2>&5; then
 
173
    AC_MSG_RESULT([yes])
 
174
    F77_WORKS=yes
 
175
  else
 
176
    AC_MSG_RESULT([no])
 
177
    F77_WORKS=no
 
178
  fi
 
179
  /bin/rm -f ffunc ffunc.f
 
180
fi
 
181
 
 
182
dnl ----------- Fortran symbol names --------------
159
183
 
160
184
AC_ARG_WITH(f77symbol,[  --with-f77symbol        FORTRAN77 symbol convention
161
185
                          Allowed values are:
184
208
])
185
209
 
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)
197
 
    FC_SYMBOL=1  
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)
200
 
    FC_SYMBOL=2  
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)
203
 
    FC_SYMBOL=3  
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])
 
221
    FC_SYMBOL=1
 
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])
 
224
    FC_SYMBOL=2
 
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])
 
227
    FC_SYMBOL=3
 
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])
206
230
    FC_SYMBOL=4
207
231
  else
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])
210
234
  fi
211
 
  /bin/rm -f ffunc.f ffunc.o flink flink.c flink.o ffunc
212
 
else
 
235
  /bin/rm -f ffunc.f ffunc.o flink flink.cc flink.o ffunc
 
236
 else
213
237
  FC_SYMBOL=2
214
 
  AC_MSG_RESULT(No Fortran compiler provided; guessing lowercase with underscore)
215
 
fi
 
238
  AC_MSG_RESULT([will assume lowercase with underscore])
 
239
 fi
216
240
fi
217
241
AC_SUBST(FC_SYMBOL)
218
242
 
281
305
AC_PROG_DVIPS
282
306
AC_PROG_BIBTEX
283
307
 
 
308
####
 
309
# Check for doxygen and it buddies
 
310
####
 
311
AC_CHECK_PROGS(DOXYGEN,doxygen,NO)
 
312
DOT=yes
 
313
AC_ARG_WITH(dot,
 
314
[  --with-dot              Gives the path to the dot graph generator.],
 
315
DOT=$withval
 
316
)
 
317
DOT_PATH=""
 
318
if test X$DOT = Xno; then
 
319
  HAVE_DOT=NO
 
320
elif test X$DOT = Xyes; then
 
321
  AC_CHECK_PROG(HAVE_DOT,dot,YES,NO)
 
322
else
 
323
  HAVE_DOT=YES
 
324
  DOT_PATH=$DOT
 
325
fi
 
326
AC_SUBST(DOT_PATH)
 
327
AC_SUBST(HAVE_DOT)
 
328
 
284
329
########
285
330
## Check for libraries
286
331
########
287
332
 
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,[],[
 
337
      FLIBS=
 
338
      AC_MSG_WARN([F77 libraries don't seem to link with C++ programs])
 
339
      ],
 
340
      $FLIBS)
290
341
fi
291
 
# This just implicitly checks that FLIBS can co-exist with the C linker
292
 
AC_CHECK_LIB(c,exit,[],[
293
 
FLIBS=
294
 
AC_MSG_WARN([F77 libraries don't seem to link with C programs])
295
 
],$FLIBS)
296
342
 
297
343
AC_ARG_WITH(blas,[  --with-blas             which blas library to use],[
298
344
case $withval in
347
393
 
348
394
### If the user didn't give us a BLAS lib, see if we can find one
349
395
 
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")
354
400
  fi
355
401
fi
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")
359
405
fi
360
406
if test -z "$BLAS"; then
361
407
  AC_CHECK_LIB(scs, $DGEMM_SYMBOL, BLAS="-lscs")
374
420
  LIBS=$SAVE_LIBS2
375
421
fi  
376
422
if test -z "$BLAS"; then
377
 
  echo "$LD_LIBRARY_PATH"
378
423
  AC_CHECK_LIB(mkl, $DGEMM_SYMBOL, BLAS="-lmkl")
379
424
fi
380
425
if test -z "$BLAS"; then
411
456
fi 
412
457
if test -z "$LAPACK_IN_BLAS"; then
413
458
  if test -z "$LAPACK"; then
414
 
    if test $CC = icc; then
 
459
    if test $CC = icc -o $CXX = icpc; then
415
460
      # Intel's libmkl_lapack64 contains the double-precision routines
416
461
      AC_CHECK_LIB(mkl_lapack64,$DGEEV_SYMBOL,LAPACK="-lmkl_lapack64")
417
462
    fi
430
475
LIBS=$SAVE_LIBS
431
476
 
432
477
# Check for libcompat.a availability
433
 
case $target_vendor in
434
 
  apple)
435
 
    AC_HAVE_LIBRARY(compat,CLIBS="-lcompat $CLIBS",AC_MSG_ERROR([Missing libcompat.a: See http://www.opensource.apple.com/ for more information]))
436
 
    echo "$CLIBS"
437
 
  ;;
438
 
esac
 
478
#case $target_vendor in
 
479
#  apple)
 
480
#    AC_HAVE_LIBRARY(compat,CLIBS="-lcompat $CLIBS",AC_MSG_ERROR([Missing libcompat.a: See http://www.opensource.apple.com/ for more information]))
 
481
#    echo "$CLIBS"
 
482
#  ;;
 
483
#esac
439
484
 
440
485
########
441
486
## Check for header files
455
500
AC_CXX_PROCESS_CHECK([cstddef],[#include <cstddef>],,[HAVE_CSTDDEF=1],[HAVE_CSTDDEF=0]) 
456
501
CXXDEF="$CXXDEF -DHAVE_CSTDDEF=$HAVE_CSTDDEF"
457
502
 
458
 
/bin/rm -f a.out
459
 
 
460
 
########
461
 
## Check for types
462
 
########
463
 
 
464
 
#check to see if void* is allowed
465
 
AC_MSG_CHECKING(for void pointers)
466
 
psi_ac_voidptr=yes
467
 
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
468
 
;}
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"
474
 
fi
 
503
####################
 
504
#  Check for Ruby  #
 
505
####################
 
506
HAVE_RUBY="no"
 
507
RUBYINC=""
 
508
CHECKRUBY="yes"
 
509
AC_ARG_WITH(ruby-include,[  --with-ruby-include     where to look for Ruby headers (-Idir1 -Idir2 etc.)],[
 
510
case $withval in
 
511
  yes)
 
512
    ;;
 
513
  no)
 
514
        CHECKRUBY="no"
 
515
    ;;
 
516
  *)
 
517
        RUBYINC="$withval"
 
518
    ;;
 
519
esac
 
520
])
 
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
 
525
fi
 
526
 
 
527
if test X$HAVE_RUBY = Xyes; then
 
528
  HAVE_RUBY="no"
 
529
  RUBYLIB="-lruby-static"
 
530
  CHECKRUBY="yes"
 
531
  AC_ARG_WITH(ruby-lib,[  --with-ruby-lib         which Ruby library to use (-Ldir1 -lruby_red)],[
 
532
  case $withval in
 
533
  yes)
 
534
    ;;
 
535
  no)
 
536
        CHECKRUBY="no"
 
537
    ;;
 
538
  *)
 
539
        RUBYLIB="$withval"
 
540
    ;;
 
541
  esac
 
542
  ])
 
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"
 
547
  AC_LINK_IFELSE(
 
548
    AC_LANG_PROGRAM(
 
549
      [[#include <ruby.h>
 
550
      ]],
 
551
      [[
 
552
        void (*funcptr)() = ruby_init;
 
553
        funcptr();
 
554
      ]]
 
555
      ),
 
556
    HAVE_RUBY=yes
 
557
    AC_MSG_RESULT(yes),
 
558
    HAVE_RUBY=no
 
559
    AC_MSG_RESULT(no)
 
560
  )
 
561
  LIBS=$REF_LIBS
 
562
  CPPFLAGS=$REF_CPPFLAGS
 
563
  fi
 
564
fi
 
565
 
 
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 #
 
569
#  on Linux                                                             #
 
570
#########################################################################
 
571
case $target_vendor in
 
572
        apple)
 
573
                RUBYLDFLAGS=""
 
574
                ;;
 
575
        *)
 
576
                RUBYLDFLAGS="-rdynamic -Wl,-export-dynamic"
 
577
                ;;
 
578
esac
 
579
AC_SUBST(RUBYLIB)
 
580
AC_SUBST(RUBYINC)
 
581
AC_SUBST(HAVE_RUBY)
 
582
AC_SUBST(RUBYLDFLAGS)
475
583
 
476
584
########
477
585
## Check for compiler characteristics
478
586
########
479
587
 
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)
483
590
 
484
 
AC_CC_PROCESS_CHECK(C dependency processing,[
485
 
#include "nosuchincludefile.h"
486
 
],-M,CCDEPEND='$(CC) -M'; DODEPEND=yes,CCDEPEND=":"; DODEPEND=no)
487
 
AC_SUBST(CCDEPEND)
488
 
AC_SUBST(DODEPEND)
489
 
AC_MSG_RESULT(CCDEPEND is $CCDEPEND)
490
 
AC_MSG_RESULT(DODEPEND is $DODEPEND)
491
 
 
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)
495
 
AC_SUBST(CLIBS)
496
 
 
497
 
AC_CHECK_LIB(m,exit,CXXLIBS="$CXXLIBS -lm")
498
 
AC_MSG_RESULT(c++ libs: $CXXLIBS)
499
 
AC_SUBST(CXXLIBS)
500
 
 
501
 
PSICPPFLAGS='-I. -I$(objincdir) -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I$(top_objdir)/src/lib' AC_SUBST(PSICPPFLAGS)
502
 
 
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)
520
 
 
521
 
AC_C_CONST
 
591
dnl -- check how dependency information is built --
 
592
# The GNU compilers work with:
 
593
CCDEPENDSUF=none
 
594
CXXDEPENDSUF=none
 
595
CCDEPENDFLAGS=-M
 
596
CXXDEPENDFLAGS=-M
 
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
 
602
  CCDEPENDSUF=u
 
603
fi
 
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
 
609
  CXXDEPENDSUF=u
 
610
  CXXDEPENDFLAGS="-M -E"
 
611
fi
 
612
/bin/rm -f depcheck.u depcheck.c depcheck.cc depcheck.o
 
613
 
 
614
AC_SUBST(CCDEPENDSUF)
 
615
AC_SUBST(CXXDEPENDSUF)
 
616
AC_SUBST(CCDEPENDFLAGS)
 
617
AC_SUBST(CXXDEPENDFLAGS)
522
618
 
523
619
AC_CHECK_DECLS([putenv],[extradef="-DHAVE_DECL_PUTENV=1"])
524
620
CDEF="$CDEF $extradef"
545
641
  CXXDEF="$CXXDEF $extradef"
546
642
fi
547
643
 
548
 
# set up cpu specific flags
549
 
AC_MSG_CHECKING([for architecture/compiler specific optimization flags])
550
 
case $target_cpu in
 
644
 
 
645
dnl ------------------- Determine Compiler Flags --------------------
 
646
 
 
647
# User's input overrides all defaults
 
648
# Defaults depend on the compiler and the architecture
 
649
AC_MSG_RESULT([-------------------------------------------------------------------------------])
 
650
 
 
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)
 
655
AC_SUBST(CDEF)
 
656
COTH='' AC_SUBST(COTH)
 
657
CINC='$(CPPFLAGS) $(PSICPPFLAGS)' AC_SUBST(CINC)
 
658
CXXDBG='' AC_SUBST(CXXDBG)
 
659
CXXOPT='-O2' AC_SUBST(CXXOPT)
 
660
AC_SUBST(CXXDEF)
 
661
CXXOTH='' AC_SUBST(CXXOTH)
 
662
CXXINC='$(CPPFLAGS) $(PSICPPFLAGS)' AC_SUBST(CXXINC)
 
663
 
 
664
# Check user's input
 
665
# The default is to optimize.  --with-opt=no or --without-opt will turn
 
666
# off optimization.
 
667
OPTFLAGS_GIVEN=no
 
668
AC_ARG_WITH(opt,[  --with-opt              Specifies the C++/C optimization compiler flags.
 
669
                          --with-opt=no means no optimization],[
 
670
case $withval in
 
671
  no)
 
672
    COPT=''
 
673
    CXXOPT=''
 
674
    OPTFLAGS_GIVEN=yes
 
675
    ;;
 
676
  *)
 
677
    COPT="$withval"
 
678
    CXXOPT="$withval"
 
679
    OPTFLAGS_GIVEN=yes
 
680
    ;;
 
681
esac
 
682
])
 
683
if test X$OPTFLAGS_GIVEN = Xyes; then
 
684
  AC_MSG_RESULT([C++ optimization flags           : $CXXOPT])
 
685
fi
 
686
 
 
687
# if not given by the user, use architecture-dependent defaults
 
688
if test X$OPTFLAGS_GIVEN = Xno; then
 
689
 case $target_cpu in
551
690
  rs6000)
552
 
    if test "$FC" = xlf_r ; then
553
 
      FOPT="-O2 -qarch=com -qxflag=xalias -qdpc -qfloat=fold -qfloat=maf -qmaxmem=-1"
554
 
    fi
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"
557
693
    fi
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"
560
696
    fi
561
697
    ;;
562
698
  powerpc)
563
 
    if test "$FC" = xlf_r ; then
564
 
      FOPT="-O2 -qarch=ppc -qxflag=xalias -qdpc -qfloat=fold -qmaxmem=-1 -qfloat=maf"
565
 
    fi
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"
568
701
    fi
569
702
    if test "$CXX" = xlC_r ; then
570
 
      CXXOPT="-O2 -qarch=ppc -qfloat=maf -qfloat=fold -qmaxmem=-1"
571
 
    fi
572
 
    ;;
573
 
  i686)
574
 
    if test "$FC" = g77 ; then
575
 
      FOPT="-O2 -march=pentiumpro"
576
 
    fi
577
 
    if test "$CC" = gcc -o "$CC" = cc ; then
578
 
      COPT="-O2 -march=pentiumpro"    
579
 
    fi
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"
 
705
    fi
 
706
    if test "$CXX" = g++ ; then
 
707
      CXXOPT="-O3"
 
708
      LDLIBS="$LDLIBS $FLIBS"
582
709
    fi
583
710
    ;;
584
711
  x86_64)
589
716
      CXXOPT="-O3 -m64"
590
717
    fi
591
718
    ;;
592
 
esac
593
 
AC_MSG_RESULT([C optimization flags: $COPT])
594
 
AC_MSG_RESULT([C++ optimization flags: $CXXOPT])
 
719
 esac
 
720
 AC_MSG_RESULT([C++ optimization flags           : $CXXOPT])
 
721
fi
595
722
 
596
 
AC_MSG_CHECKING([for OS specific flags])
597
723
case $target_os in
598
724
  aix*)
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"
604
730
    ;;
605
731
  linux*)
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"
610
735
    ;;
611
736
esac
612
 
AC_MSG_RESULT([C preprocessor directives: $CDEF])
613
 
AC_MSG_RESULT([C++ preprocessor directives: $CXXDEF])
614
 
 
615
 
# Set up CFLAGS and FFLAGS.
616
 
 
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)
620
 
 
621
 
# Adjust the debug flags.
 
737
AC_MSG_RESULT([extra preprocessor defines       : $CXXDEF])
 
738
 
 
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],[
624
742
case $withval in
625
743
  yes)
 
744
    CDBG='-g'
 
745
    CXXDBG='-g'
626
746
    ;;
627
747
  no)
628
748
    CDBG=''
629
749
    CXXDBG=''
630
 
    FDBG=''
631
750
    ;;
632
751
  *)
633
752
    CDBG="$withval"
634
753
    CXXDBG="$withval"
635
 
    FDBG="$withval"
636
 
    ;;
637
 
esac
638
 
],CDBG='' CXXDBG='' FDBG='')
639
 
 
640
 
# Adjust the optimize flags.
641
 
# The default is to optimize.  --with-opt=no or --without-opt will turn
642
 
# off optimization.
643
 
AC_ARG_WITH(opt,[  --with-opt              --with-opt=no to turn off optimization],[
644
 
case $withval in
645
 
  yes)
646
 
    ;;
647
 
  no)
648
 
    COPT=''
649
 
    CXXOPT=''
650
 
    FOPT=''
651
 
    ;;
652
 
  *)
653
 
    COPT="$withval"
654
 
    CXXOPT="$withval"
655
 
    FOPT="$withval"
656
754
    ;;
657
755
esac
658
756
])
 
757
AC_MSG_RESULT([debugging C++ compiler flags     : $CXXDBG])
659
758
 
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 
664
763
case $withval in
665
764
  yes)
666
765
    # "Strict" flags only known for GNU compilers
667
 
    if test "$G77" = yes ; then      
668
 
      FOTH="$FOTH -Wall"
669
 
    fi
670
766
    if test "$GCC" = yes ; then
671
767
      COTH="$COTH -Wall -ansi"
672
768
    fi
678
774
    ;;
679
775
esac
680
776
])
681
 
AC_MSG_RESULT([C extra flags: $COTH])
682
 
AC_MSG_RESULT([C++ extra flags: $CXXOTH])
683
 
 
684
 
########
685
 
## Check for library functions
686
 
########
 
777
AC_MSG_RESULT([misc C++ compiler flags          : $CXXOTH])
 
778
 
 
779
CFLAGS='$(CDBG) $(COPT) $(CDEF) $(COTH) $(CINC)' AC_SUBST(CFLAGS)
 
780
CXXFLAGS='$(CXXDBG) $(CXXOPT) $(CXXDEF) $(CXXOTH) $(CXXINC)' AC_SUBST(CXXFLAGS)
 
781
 
 
782
if test X$AIX64 = Xyes; then
 
783
  if test X$CXX = Xg++; then
 
784
    COTH="$COTH -maix64" 
 
785
    CXXOTH="$CXXOTH -maix64" 
 
786
    F77FLAGS="$F77FLAGS -maix64" 
 
787
    LDFLAGS="$LDFLAGS -maix64" 
 
788
    LDLIBS="$LAPACK $BLAS $LDLIBS"
 
789
  fi
 
790
fi
 
791
 
 
792
AC_MSG_RESULT([-------------------------------------------------------------------------------])
687
793
 
688
794
 
689
795
########
692
798
 
693
799
AC_CONFIG_FILES([include/Makefile
694
800
          include/chkpt_params.h
695
 
          Makefile lib/Makefile src/Makefile
 
801
          Makefile lib/Makefile lib/ruby/Makefile src/Makefile
696
802
          src/lib/Makefile src/lib/MakeRules src/lib/MakeVars
697
803
          src/util/Makefile src/util/MakeRules src/util/MakeVars
698
804
          src/bin/Makefile src/bin/MakeRules src/bin/MakeVars
701
807
          doc/installation/Makefile
702
808
          doc/progman/Makefile doc/userman/Makefile
703
809
          doc/userman/prsty.bst
 
810
          doc/doxygen/Makefile
 
811
          doc/doxygen/doxygen.cfg
704
812
 
705
813
          src/lib/libdpd/Makefile
706
814
          src/lib/libiwl/Makefile
708
816
          src/lib/libqt/Makefile
709
817
          src/lib/libbasis/Makefile
710
818
          src/lib/libciomr/Makefile
711
 
          src/lib/libciomr/iomrparam.h
712
819
          src/lib/libipv1/Makefile
713
820
          src/lib/libchkpt/Makefile
714
821
          src/lib/libderiv/Makefile
720
827
          src/lib/libr12/Makefile
721
828
          src/lib/libr12/MakeVars
722
829
          src/lib/libr12/libr12_config.h
 
830
          src/lib/libutil/Makefile
 
831
          src/lib/liboptions/Makefile
 
832
          src/lib/libmoinfo/Makefile
 
833
          src/lib/libmints/Makefile
723
834
          src/util/tocprint/Makefile
724
835
          src/util/psi2molden/Makefile
725
836
 
744
855
          src/bin/geom/Makefile
745
856
          src/bin/input/Makefile
746
857
          src/bin/intder/Makefile
 
858
          src/bin/mcscf/Makefile
747
859
          src/bin/mp2/Makefile
748
860
          src/bin/mp2r12/Makefile
749
861
          src/bin/oeprop/Makefile
758
870
          src/bin/localize/Makefile
759
871
          src/bin/stable/Makefile
760
872
          src/bin/response/Makefile
 
873
          src/bin/psirb/Makefile
 
874
          src/bin/psimrcc/Makefile
 
875
          src/bin/nonbonded/Makefile
 
876
 
761
877
          tests/Makefile
762
878
          tests/MakeVars
763
879
          tests/MakeRules
764
880
          tests/runtest.pl
765
881
          tests/scf-opt/Makefile
 
882
          tests/scf-opt-fragments/Makefile
 
883
          tests/mp2-opt-fragments/Makefile
766
884
          tests/scf-opt2/Makefile
767
885
          tests/scf-opt3/Makefile
768
886
          tests/scf-opt4/Makefile
777
895
          tests/scf-opt2-numer/Makefile
778
896
          tests/scf-freq/Makefile
779
897
          tests/scf-freq-first-3/Makefile
 
898
          tests/scf-freq-first-3a/Makefile
780
899
          tests/scf-freq-first-5/Makefile
 
900
          tests/scf-freq-first-5a/Makefile
781
901
          tests/scf-freq-none-3/Makefile
782
902
          tests/scf-freq-none-5/Makefile
783
903
          tests/scf-symm-fc-numer/Makefile
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
812
942
          tests/cc6/Makefile
813
943
          tests/cc7/Makefile
814
944
          tests/cc8/Makefile
 
945
          tests/cc8a/Makefile
815
946
          tests/cc9/Makefile
 
947
          tests/cc9a/Makefile
816
948
          tests/cc10/Makefile
817
949
          tests/cc11/Makefile
818
950
          tests/cc12/Makefile
819
951
          tests/cc13/Makefile
 
952
          tests/cc13a/Makefile
820
953
          tests/cc14/Makefile
821
954
          tests/cc15/Makefile
822
955
          tests/cc16/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
 
1020
 
 
1021
          src/samples/Makefile
 
1022
          src/samples/MakeVars
 
1023
          src/samples/MakeRules
 
1024
          src/samples/mints/Makefile
874
1025
])
875
1026
 
876
1027
AC_OUTPUT
 
1028
 
 
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.])
 
1032
        fi
 
1033
        if test -z $RUBYINC; then
 
1034
                AC_MSG_NOTICE([Unable to locate ruby.h will not link the psirb module.])
 
1035
        fi
 
1036
fi