File: configure.ac

package info (click to toggle)
libint 1.2.1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,664 kB
  • sloc: sh: 10,214; ansic: 9,478; makefile: 437; perl: 141
file content (579 lines) | stat: -rw-r--r-- 14,124 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
define([libint_mmm_version],[1.2.1])
define([libint_buildid],[])
define([libint_so_version],[1:0:0])

dnl Process this file with autoconf to produce a configure script.
define([AC_CACHE_LOAD], )dnl for debugging configure.in
define([AC_CACHE_SAVE], )dnl for debugging configure.in
AC_INIT(src/bin/libint/build_libint.c)
AC_PREREQ(2.52)
AC_CONFIG_HEADER(src/bin/libint_config.h)
AC_CONFIG_AUX_DIR(bin)
AC_CONFIG_MACRO_DIR([lib/autoconf])

AC_CANONICAL_SYSTEM
AC_SET_MAKE

AC_DEFINE_UNQUOTED(HOST_ARCH, "$host")
AC_DEFINE_UNQUOTED(TARGET_ARCH, "$target")

define([default_prefix_dash],ifelse(libint_buildid, ,[],[-]))
define([default_prefix],"/usr/local")

LIBINT_MMM_VERSION=libint_mmm_version
changequote(<<, >>)dnl
LIBINT_MAJOR_VERSION=`echo $LIBINT_MMM_VERSION|sed 's/\([0-9]*\)\.[0-9]*\.[0-9]*/\1/'`
LIBINT_MINOR_VERSION=`echo $LIBINT_MMM_VERSION|sed 's/[0-9]*\.\([0-9]*\)\.[0-9]*/\1/'`
LIBINT_MICRO_VERSION=`echo $LIBINT_MMM_VERSION|sed 's/[0-9]*\.[0-9]*\.\([0-9]*\)/\1/'`
changequote([, ])dnl
AC_DEFINE_UNQUOTED(LIBINT_MAJOR_VERSION,$LIBINT_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(LIBINT_MINOR_VERSION,$LIBINT_MINOR_VERSION)
AC_DEFINE_UNQUOTED(LIBINT_MICRO_VERSION,$LIBINT_MICRO_VERSION)

LIBINT_SO_VERSION=libint_so_version
AC_SUBST(LIBINT_SO_VERSION)

dnl --------- Features ---------

AC_ARG_ENABLE(debug,
[  --enable-debug          Compile with debugging options],
[
case $enableval in
  yes)
    DEBUG=yes
  ;;
  no)
    DEBUG=no
  ;;
  opt)
    DEBUG=opt
  ;;
  *)
    AC_MSG_ERROR([Invalid value for --enable-debug ($enableval)])
  ;;
esac
],[
    DEBUG=no
]
)


EXCLUDED_DIRS=

INCLUDE_DERIV=yes
AC_ARG_ENABLE(deriv,
[  --enable-deriv          Compile with 1st- and 2nd-order derivative ERI support],
[
case $enableval in
  yes)
    INCLUDE_DERIV=yes
  ;;
  no)
    INCLUDE_DERIV=no
  ;;
  *)
    AC_MSG_ERROR([Invalid value for --enable-deriv ($enableval)])
  ;;
esac
],[
    INCLUDE_DERIV=yes
]
)
if test $INCLUDE_DERIV = yes; then
  AC_DEFINE(INCLUDE_DERIV)
else
  EXCLUDED_DIRS="-x SRC_BIN_LIBDERIV $EXCLUDED_DIRS"
fi

INCLUDE_R12=yes
AC_ARG_ENABLE(r12,
[  --enable-r12            Compile with linear R12 methods integrals support],
[
case $enableval in
  yes)
    INCLUDE_R12=yes
  ;;
  no)
    INCLUDE_R12=no
  ;;
  *)
    AC_MSG_ERROR([Invalid value for --enable-r12 ($enableval)])
  ;;
esac
],[
    INCLUDE_R12=yes
]
)
if test $INCLUDE_R12 = yes; then
  AC_DEFINE(INCLUDE_R12)
else
  EXCLUDED_DIRS="-x SRC_BIN_LIBR12 $EXCLUDED_DIRS"
fi

LIBINT_MAX_AM=4
AC_ARG_WITH(libint-max-am,
[  --with-libint-max-am    Gives the maximum angular momentum of ERI this library will be able to handle.],
if test $withval -le 0; then
  AC_MSG_ERROR([Invalid value for --with-libint-max-am ($withval)])
else
  LIBINT_MAX_AM=$withval
fi
if test $LIBINT_MAX_AM -ge 11; then
  AC_MSG_ERROR([Value for --with-libint-max-am too high ($withval). Are you sure you know what you are doing?])
fi
)

LIBINT_OPT_AM=$((($LIBINT_MAX_AM/2)+1))
AC_ARG_WITH(libint-opt-am,
[  --with-libint-opt-am    Gives the level of optimization for ERIs this library will use (opt-am <= max-am).],
if test $withval -le $LIBINT_MAX_AM; then
  LIBINT_OPT_AM=$withval
fi
)

if test $LIBINT_MAX_AM -gt 3; then
  LIBDERIV_MAX_AM1=3
else
  LIBDERIV_MAX_AM1=$(($LIBINT_MAX_AM-1))
fi
AC_ARG_WITH(libderiv-max-am1,
[  --with-libderiv-max-am1 Gives the maximum angular momentum of 1st derivative ERI this library will be able to handle.],
if test $withval -le 0 -o $withval -ge $LIBINT_MAX_AM; then
  AC_MSG_ERROR([Invalid value for --with-libderiv-max-am1 ($withval)])
else
  LIBDERIV_MAX_AM1=$withval
fi
)

if test $LIBDERIV_MAX_AM1 -gt 1; then
  LIBDERIV_MAX_AM2=$(($LIBDERIV_MAX_AM1-1))
else
  if test $(($LIBINT_MAX_AM-$LIBDERIV_MAX_AM1)) -gt 1; then
    LIBDERIV_MAX_AM2=$LIBDERIV_MAX_AM1
  else
    AC_MSG_ERROR([Value of --with-libint-max-am is too low ($LIBINT_MAX_AM) to include second-derivative integrals support.])
  fi
fi
AC_ARG_WITH(libderiv-max-am2,
[  --with-libderiv-max-am2 Gives the maximum angular momentum of 2nd derivative ERI this library will be able to handle.],
if test $withval -le 0 -o $withval -ge $LIBDERIV_MAX_AM1; then
  AC_MSG_ERROR([Invalid value for --with-libderiv-max-am2 ($withval)])
else
  LIBDERIV_MAX_AM2=$withval
fi
)

LIBR12_MAX_AM=$(($LIBINT_MAX_AM-1))
AC_ARG_WITH(libr12-max-am,
[  --with-libr12-max-am    Gives the maximum angular momentum of linear R12 method integrals this library will be able to handle.],
if test $withval -le 0 -o $withval -ge $LIBINT_MAX_AM; then
  AC_MSG_ERROR([Invalid value for --with-libr12-max-am ($withval)])
else
  LIBR12_MAX_AM=$withval
fi
)

LIBR12_OPT_AM=$((($LIBR12_MAX_AM/2)+1))
AC_ARG_WITH(libr12-opt-am,
[  --with-libr12-opt-am    Gives the level of optimization for linear R12 method integrals this library will use (opt-am <= max-am).],
if test $withval -le $LIBR12_MAX_AM; then
  LIBR12_OPT_AM=$withval
fi
)

MAX_CLASS_SIZE=300
AC_ARG_WITH(max-class-size,
[  --with-max-class-size   Restricts the length of VRR build routines to avoid compiler failures.],
if test $withval -le 10; then
  AC_MSG_ERROR([Invalid value for --with-class-size ($withval)])
else
  MAX_CLASS_SIZE=$withval
fi
)

AC_ARG_ENABLE(long-double,
[  --enable-long-double    Compute all integrals using long double precision.],
[
case $enableval in
  yes)
    LONG_DOUBLE=1
  ;;
  no)
    LONG_DOUBLE=0
  ;;
  *)
    AC_MSG_ERROR([Invalid value for --enable-long-double ($enableval)])
  ;;
esac
],[
    LONG_DOUBLE=0
]
)

AC_SUBST(LIBINT_MAX_AM)
AC_SUBST(LIBINT_OPT_AM)
AC_SUBST(LIBDERIV_MAX_AM1)
AC_SUBST(LIBDERIV_MAX_AM2)
AC_SUBST(LIBR12_MAX_AM)
AC_SUBST(LIBR12_OPT_AM)
AC_SUBST(MAX_CLASS_SIZE)
AC_SUBST(LONG_DOUBLE)

AC_DEFINE_UNQUOTED(LIBINT_MAX_AM,$LIBINT_MAX_AM)
AC_DEFINE_UNQUOTED(LIBINT_OPT_AM,$LIBINT_OPT_AM)
AC_DEFINE_UNQUOTED(LIBDERIV_MAX_AM1,$LIBDERIV_MAX_AM1)
AC_DEFINE_UNQUOTED(LIBDERIV_MAX_AM2,$LIBDERIV_MAX_AM2)
AC_DEFINE_UNQUOTED(LIBDERIV_MAX_AM12,$LIBDERIV_MAX_AM2)
AC_DEFINE_UNQUOTED(LIBR12_MAX_AM,$LIBR12_MAX_AM)
AC_DEFINE_UNQUOTED(LIBR12_OPT_AM,$LIBR12_OPT_AM)
AC_DEFINE_UNQUOTED(LIBINT_MAX_CLASS_SIZE,$MAX_CLASS_SIZE)
AC_DEFINE_UNQUOTED(LIBR12_MAX_CLASS_SIZE,$MAX_CLASS_SIZE)
AC_DEFINE_UNQUOTED(LONG_DOUBLE,$LONG_DOUBLE)

BUILDID="libint_buildid"
AC_ARG_WITH(build-id,
[  --with-build-id         Gives an identifier for the build.],
BUILDID=$withval
)
AC_SUBST(BUILDID)
AC_DEFINE_UNQUOTED(LIBINT_BUILDID,"$BUILDID")

if test "$BUILDID"; then
  LIBINT_VERSION="$LIBINT_MMM_VERSION-$BUILDID"
else
  LIBINT_VERSION="$LIBINT_MMM_VERSION"
fi

AC_DEFINE_UNQUOTED(LIBINT_VERSION, "$LIBINT_VERSION")
AC_SUBST(LIBINT_VERSION)

ac_default_prefix="/usr/local/libint/$LIBINT_VERSION"

AC_ARG_WITH(cc,
[  --with-cc               Gives the name of the C compiler to use.],
CC=$withval
)

AC_ARG_WITH(cxx,
[  --with-cxx              Gives the name of the C++ compiler to use.],
CXX=$withval
)

COPTIONS_OPT=
AC_ARG_WITH(cc-optflags,
[  --with-cc-optflags      Gives optimization flags for the C compiler.],
COPTIONS_OPT=$withval
)

CXXOPTIONS_OPT=
AC_ARG_WITH(cxx-optflags,
[  --with-cxx-optflags     Gives optimization flags for the C++ compiler.],
CXXOPTIONS_OPT=$withval
)

AC_ARG_WITH(ranlib,
[  --with-ranlib           Gives the name of the ranlib program.],
RANLIB=$withval
)

AC_ARG_WITH(ar,
[  --with-ar               Names the archive creator.],
AR=$withval
)

ARFLAGS=r
AC_ARG_WITH(ar-flags,
[  --with-ar-flags         Flags for the the archive creator.],
ARFLAGS=$withval
)
AC_SUBST(ARFLAGS)

AC_ARG_WITH(ld,
[  --with-ld               Names the object linker.],
LD=$withval
)

if test $prefix = $ac_default_prefix -o $prefix = NONE; then
  libintincludedir=$includedir
else
  libintincludedir=$includedir/$SC_VERSION
fi
AC_ARG_WITH(libint-includedir,
[  --with-libint-includedir       Specifies include file install subdir.],
libintincludedir=$withval
)
AC_SUBST(libintincludedir)

AC_ARG_WITH(incdirs,
[  --with-incdirs          Specifies include directories (-Idir1 -Idir2).],
EXTRAINCDIRS=$withval
CPPFLAGS=$withval
echo Using extra include directories: $withval
)

AC_ARG_WITH(libs,
[  --with-libs             Specifies libraries (-llib1 -llib2).],
LIBS=$withval
echo Using extra libraries: $withval
)

LDFLAGS=
LIBDIRS=
AC_ARG_WITH(libdirs,
[  --with-libdirs          Specifies library directories (-Ldir1 -Ldir2).],
LIBDIRS=$withval
LDFLAGS=$withval
echo Using extra library directories: $withval
)

SCRATCHDIR=tmp
AC_ARG_WITH(scratchdir,
[  --with-scratchdir       Specifies the location for the machine-generated library source and object files.],
SCRATCHDIR=$withval
)
AC_SUBST(SCRATCHDIR)

dnl --------- Want absolute path for srcdir, not relative. ---------

if test X$ac_srcdir_defaulted = Xyes; then
  case $srcdir in
    ..*)
      srcdir=`(cd $srcdir; pwd)`
      #srcdir=`(cd $srcdir; echo $PWD)`
      ;;
  esac
fi

dnl --------- Checks for programs. ---------
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_CC
dnl ac_prog_cxx's order isn't what i need
AC_CHECK_PROGS(CXX, g++ c++ gcc CC cxx xlC_r, gcc)
dnl sees if CXX is a GNU compiler
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CXXCPP
AC_CHECK_PROG(AR,ar,ar)
AC_CHECK_PROG(PERL,perl,perl)
AC_PATH_PROG(PDFLATEX,pdflatex,,$PATH:/usr/local/bin)
AC_PATH_PROG(PSLATEX,pslatex,,$PATH:/usr/local/bin)
AC_PATH_PROG(BIBTEX,bibtex,,$PATH:/usr/local/bin)

dnl The lack of certain tools is a show stopper

changequote(<<, >>)dnl

if [ X$PERL = X ]; then
  echo "Could not find the program perl.  It can be obtained at"
  echo "ftp://prep.ai.mit.edu/pub/gnu"
  exit 1
fi

changequote([, ])dnl

dnl -------- Checks for compiler/linker options. ----------

# options needed only for optimization
if test "X$COPTIONS_OPT" = X; then
  COPTIONS_OPT=-O
fi
# options needed only for debugging
COPTIONS_DBG=-g
# options that are always needed
COPTIONS_MISC=

# options needed only for optimization
if test "X$CXXOPTIONS_OPT" = X; then
  CXXOPTIONS_OPT=-O
fi
# options needed only for debugging
CXXOPTIONS_DBG=-g
# options that are always needed
CXXOPTIONS_MISC=

OBJSUF=o
LIBSUF=a

dnl -- check how dependency information is built --

# The GNU compilers work with:
CCDEPENDSUF=none
CXXDEPENDSUF=none
CCDEPENDFLAGS=-M
CXXDEPENDFLAGS=-M

/bin/rm -f depcheck.u depcheck.c depcheck.o

# Check for an IBM visual age C compiler
echo "#include <stdio.h>" > depcheck.c
$CC $CPPFLAGS $CFLAGS -M depcheck.c > /dev/null 2>&1
if test -f depcheck.u; then
  CCDEPENDSUF=u
fi
/bin/rm -f depcheck.u depcheck.c depcheck.o

# Check for an IBM visual age C++ compiler
echo "#include <iostream>" > depcheck.cc
$CXX $CPPFLAGS $CXXFLAGS -M -E depcheck.cc > /dev/null 2>&1
if test -f depcheck.u; then
  CXXDEPENDSUF=u
  CXXDEPENDFLAGS="-M -E"
fi
/bin/rm -f depcheck.u depcheck.c depcheck.o

dnl -- special optimization options --

AC_MSG_CHECKING([for additional optimization options])
case $target in
  rs6000-ibm-aix3.2.* | rs6000-ibm-aix4.* | powerpc-ibm-aix4.* | powerpc-ibm-aix5.*)
    if test X$GCC != Xyes; then
      COPTIONS_OPT="$COPTIONS_OPT -qnolm"
    fi
    if test X$GXX != Xyes; then
      CXXOPTIONS_OPT="$CXXOPTIONS_OPT -qnolm -qrtti"
    fi
    AC_MSG_RESULT([rs6000 or powerpc])
  ;;
  *)
    AC_MSG_RESULT([none])
  ;;
esac

dnl -- special architecture options --

if test "X$COPTIONS_OPT" = X; then
  AC_MSG_WARN([C optimization options are not given! For optimum performance use --with-cc-optflags configure option])
fi
if test "X$CXXOPTIONS_OPT" = X; then
  AC_MSG_WARN([C++ optimization options are not given! For optimum performance use --with-cxx-optflags configure option])
fi

dnl ----------- check for GNU libc++-v3 prerelease bug ---------------

if test X$GXX = Xyes; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING([for GNU libc++-v3 prerelease bug])
AC_TRY_LINK([
#include <stdio.h>
#include <$iostream>
],[
],[
AC_MSG_RESULT([no])
],
EXTRADEFINES="$EXTRADEFINES -D_ISOC99_SOURCE=1"
AC_MSG_RESULT([yes])
);
AC_LANG_RESTORE
fi

dnl -- other options --

AC_MSG_CHECKING([GNU c++ library/template flags])
if test X$GXX = Xyes; then
  # automatic template instantiation causes problems with libstc++-v3
  #CXXOPTIONS_MISC="$CXXOPTIONS_MISC -fno-implicit-templates"
  #EXPLICIT_TEMPLATE_INSTANTIATION=yes
  #AC_DEFINE(EXPLICIT_TEMPLATE_INSTANTIATION)
  AC_MSG_RESULT([GNU])
else
  case $target in
    *)
      AC_MSG_RESULT([generic non GNU])
      ;;
    esac
fi

if test $DEBUG = yes; then
  CFLAGS="$COPTIONS_DBG $COPTIONS_MISC"
  CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_MISC"
  LDFLAGS="$LDFLAGS -g"
elif test $DEBUG = opt; then
  CFLAGS="$COPTIONS_DBG $COPTIONS_OPT $COPTIONS_MISC"
  CXXFLAGS="$CXXOPTIONS_DBG $COPTIONS_OPT $CXXOPTIONS_MISC"
  LDFLAGS="$LDFLAGS -g"
else
  CFLAGS="$COPTIONS_OPT $COPTIONS_MISC"
  CXXFLAGS="$CXXOPTIONS_OPT $CXXOPTIONS_MISC"
fi

AC_SUBST(EXTRAINCLUDE)

AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)

AC_SUBST(LIBDIRS)

AC_SUBST(OBJSUF)
AC_SUBST(LIBSUF)
AC_SUBST(CCDEPENDSUF)
AC_SUBST(CXXDEPENDSUF)
AC_SUBST(CCDEPENDFLAGS)
AC_SUBST(CXXDEPENDFLAGS)

dnl -------- Checks for architecture specific features. --------
dnl (Doesn't work for cross compilation.)
dnl AC_CHECK_SIZEOF(void*)

AC_SUBST(EXTRADEFINES)

dnl ---------- Checks for header files. -----------

AC_HEADER_STDC

dnl -- Checks for typedefs, structures, and compiler characteristics. --
AC_C_CONST
AC_TYPE_SIZE_T

CC="$CC" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="-lm $LIBS $FLIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \

dnl --------- Shared library configuration. ---------

enablelibtool=yes
AC_ARG_ENABLE(libtool,
[  --disable-libtool       Do not use libtool.],
[
case $enableval in
  yes)
  ;;
  no)
    enablelibtool=no
  ;;
  *)
    AC_MSG_ERROR([Invalid value for --(dis|en)able-libtool ($enableval)])
  ;;
esac
])

if test "$enablelibtool" = yes; then

dnl by default make only static libraries
AC_DISABLE_SHARED
AC_PROG_LIBTOOL

OBJSUF=lo
LIBSUF=la

else

enable_shared=no

fi

if test "$enable_shared" = "no"; then
  OBJSUF=o
  LIBSUF=a
fi

ENABLESHARED=$enable_shared
AC_SUBST(ENABLESHARED)

dnl make Makefiles in object tree
$PERL $srcdir/bin/objectdir.pl $EXCLUDED_DIRS $srcdir

AC_OUTPUT(src/bin/MakeVars src/bin/MakeRules src/lib/MakeVars src/lib/MakeRules
          doc/MakeVars doc/MakeRules)