-
Notifications
You must be signed in to change notification settings - Fork 14
/
configure.ac
560 lines (463 loc) · 17.2 KB
/
configure.ac
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
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([o2scl],[0.929],[awsteiner0@protonmail.com])
AC_CONFIG_SRCDIR(config.h.in)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
# Checks for compiler and other required programs
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
# 7/20/22, fixing this since o2scl uses c++14 extensions
#
AX_CXX_COMPILE_STDCXX(14,[],[optional])
# Newer replacement for LT_INIT
LT_INIT
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_SELECT_ARGTYPES
# Check for popen
AC_CHECK_FUNC([popen],[AC_DEFINE([HAVE_POPEN],[1],
[Define if popen exists])])
# ------------------------------------------------------------------
# Take care of library version numbers
# ------------------------------------------------------------------
# For the time being, current and age are always
# "version number minus 910"
OLIB_CURRENT=19
OLIB_REVISION=0
OLIB_AGE=19
OLIB_LT_VERSION="${OLIB_CURRENT}:${OLIB_REVISION}:${OLIB_AGE}"
AC_SUBST(OLIB_LT_VERSION)
# ------------------------------------------------------------------
# Check for Boost headers
# ------------------------------------------------------------------
# AWS: This doesn't seem to correctly find the Boost libraries yet
#AC_CHECK_HEADER([boost/numeric/ublas/vector.hpp],[],
# [echo ""
# echo "Boost not found. O2scl requires Boost."
# echo ""
# echo -n " The present value of CPPFLAGS is: "
# echo $CPPFLAGS
# echo ""
# exit -1
# ],[])
# ------------------------------------------------------------------
# Check for math library
# ------------------------------------------------------------------
AC_CHECK_LIB([m],[cos])
# ------------------------------------------------------------------
# Check for BLAS
# ------------------------------------------------------------------
AC_CHECK_LIB([cblas],[cblas_dgemm],[],[
echo "Library libcblas not found. Looking for GSL cblas."
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
AC_CHECK_LIB([gslcblas],[cblas_dgemm],[],[
echo "Library libgslcblas not found. O2scl requires a cblas library."
echo "You may be required to add a cblas library to the LIBS "
echo "environment variable. "
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
echo ""
],[])
],[])
# ------------------------------------------------------------------
# Check for GSL library (must check for BLAS first)
# ------------------------------------------------------------------
AC_CHECK_LIB([gsl], [gsl_vector_get], [],
[echo ""
echo "GSL not found."
echo "O2scl requires the GSL library."
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
exit -1
],[])
# ------------------------------------------------------------------
# Check for libquadmath
# ------------------------------------------------------------------
AC_CHECK_LIB([quadmath], [isnanq], [],
[echo ""
echo "Quadmath not found."
echo "O2scl typically requires libquadmath."
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
],[])
# ------------------------------------------------------------------
# Check for Readline library
# ------------------------------------------------------------------
AC_ARG_ENABLE(readline,
[ --enable-readline Include readline support @<:@default=yes@:>@],
[case "${enableval}" in
yes) readline=true ;;
no) readline=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-readline) ;;
esac],[readline=true])
AM_CONDITIONAL(O2SCL_READLINE, test x$readline = xtrue)
# ------------------------------------------------------------------
# If enabled, check for the readline library
# ------------------------------------------------------------------
AS_IF([test "x$enable_readline" != "xno"], [
AC_CHECK_LIB([readline], [add_history], [],
[echo ""
echo "Readline not found. "
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
],[])
])
# ------------------------------------------------------------------
# Check for module support
# ------------------------------------------------------------------
AC_ARG_ENABLE(modules,
[ --enable-modules Include module support @<:@default=no@:>@],
[case "${enableval}" in
yes) modules=true ;;
no) modules=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-modules) ;;
esac],[modules=false])
AM_CONDITIONAL(O2SCL_MODULES, test x$modules = xtrue)
# ------------------------------------------------------------------
# Check for Mpfr library
# ------------------------------------------------------------------
AC_ARG_ENABLE(mpfr,
[ --enable-mpfr Include mpfr support @<:@default=no@:>@],
[case "${enableval}" in
yes) mpfr=true ;;
no) mpfr=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mpfr) ;;
esac],[mpfr=false])
AM_CONDITIONAL(O2SCL_MPFR, test x$mpfr = xtrue)
# ------------------------------------------------------------------
# If enabled, check for the mpfr library
# ------------------------------------------------------------------
AS_IF([test "x$enable_mpfr" == "xyes"], [
AC_CHECK_LIB([mpfr], [mpfr_add], [],
[echo ""
echo "Mpfr not found. "
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
],[])
])
# ------------------------------------------------------------------
# Check for Pugixml library
# ------------------------------------------------------------------
AC_ARG_ENABLE(pugixml,
[ --enable-pugixml Include pugixml support @<:@default=no@:>@],
[case "${enableval}" in
yes) pugixml=true ;;
no) pugixml=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-pugixml) ;;
esac],[pugixml=false])
AM_CONDITIONAL(O2SCL_PUGIXML, test x$pugixml = xtrue)
# ------------------------------------------------------------------
# If enabled, check for the pugixml library
# ------------------------------------------------------------------
AS_IF([test "x$enable_pugixml" == "xyes"], [
AC_CHECK_LIB([pugixml], [atoi], [],
[echo ""
echo "Pugixml not found. "
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
],[])
])
# ------------------------------------------------------------------
# Check for Cubature library
# ------------------------------------------------------------------
AC_ARG_ENABLE(cubature,
[ --enable-cubature Include cubature support @<:@default=no@:>@],
[case "${enableval}" in
yes) cubature=true ;;
no) cubature=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-cubature) ;;
esac],[cubature=false])
AM_CONDITIONAL(O2SCL_CUBATURE, test x$cubature = xtrue)
# ------------------------------------------------------------------
# If enabled, check for the cubature library
# ------------------------------------------------------------------
AS_IF([test "x$enable_cubature" == "xyes"], [
AC_CHECK_LIB([cubature], [pcubature], [],
[echo ""
echo "Cubature not found. "
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
],[])
])
# ------------------------------------------------------------------
# Enable Python extensions
# ------------------------------------------------------------------
AC_ARG_ENABLE(python,
[ --enable-python Include python support @<:@default=no@:>@],
[case "${enableval}" in
yes) python=true ;;
no) python=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
esac],[python=false])
AM_CONDITIONAL(O2SCL_PYTHON, test x$python = xtrue)
# ------------------------------------------------------------------
# If enabled, check for the python library
# ------------------------------------------------------------------
AS_IF([test "x$enable_python" == "xyes"], [
AX_PYTHON
])
# ------------------------------------------------------------------
# If enabled, check for the polylogarithm library
# ------------------------------------------------------------------
dnl AS_IF([test "x$enable_polylogarithm" == "xyes"], [
dnl AC_CHECK_LIB([polylog_cpp], [log], [],
dnl [echo ""
dnl echo "Polylogarithm not found. "
dnl echo ""
dnl echo -n " The present value of LDFLAGS is: "
dnl echo $LDFLAGS
dnl ],[])
dnl ])
# ------------------------------------------------------------------
# Check for ncurses library
# ------------------------------------------------------------------
AC_ARG_ENABLE(ncurses,
[ --enable-ncurses Include ncurses support @<:@default=no@:>@],
[case "${enableval}" in
yes) ncurses=true ;;
no) ncurses=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ncurses) ;;
esac],[ncurses=false])
AM_CONDITIONAL(O2SCL_NCURSES, test x$ncurses = xtrue)
# ------------------------------------------------------------------
# If enabled, check for the ncurses library
# ------------------------------------------------------------------
AS_IF([test "x$enable_ncurses" != "xno"], [
AC_CHECK_LIB([ncurses], [initscr], [],
[echo ""
echo "Ncurses not found. "
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
],[])
])
# ------------------------------------------------------------------
# If enabled, check for the HDF5 library
# ------------------------------------------------------------------
AC_CHECK_LIB([hdf5], [H5Fopen], [], [
AC_CHECK_LIB([hdf5_serial], [H5Fopen], [], [
echo ""
echo "HDF5 not found. Either provide the location for "
echo "the hdf5 libraries or ensure that HDF5 support is "
echo "disabled with the --disable-hdf option to configure. "
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
],[])
],[])
# ------------------------------------------------------------------
# ... and for the HDF5 high-level library
# ------------------------------------------------------------------
AC_CHECK_LIB([hdf5_hl], [H5TBread_table], [], [
AC_CHECK_LIB([hdf5_serial_hl], [H5TBread_table], [], [
echo ""
echo "High-level HDF5 interface not found. Either provide the "
echo "location for the hdf5_hl libraries or ensure that HDF5 "
echo "support is disabled with the --disable-hdf option to "
echo "configure. "
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
],[])
],[])
# ------------------------------------------------------------------
# Enable or disable FFTW support (included here
# for later use)
# ------------------------------------------------------------------
AC_ARG_ENABLE(fftw,
[ --enable-fftw Include FFTW support @<:@default=no@:>@],
[case "${enableval}" in
yes) fftw=true ;;
no) fftw=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-fftw) ;;
esac],[fftw=false])
AM_CONDITIONAL(O2SCL_FFTW, test x$fftw = xtrue)
# ------------------------------------------------------------------
# If enabled, check for the FFTW library
# ------------------------------------------------------------------
AS_IF([test "x$enable_fftw" == "xyes"],[
AC_CHECK_LIB([fftw3], [fftw_ifree], [],
[echo ""
echo "FFTW not found. Either provide the location for "
echo "the fftw libraries or ensure that FFTW support is "
echo "disabled with the --disable-fftw option to configure. "
echo ""
echo -n " The present value of LDFLAGS is: "
echo $LDFLAGS
],[])
])
# ------------------------------------------------------------------
# Enable or disable python support
# ------------------------------------------------------------------
# AC_ARG_ENABLE(python,
# [ --enable-python Include Python support @<:@default=no@:>@],
# [case "${enableval}" in
# yes) python=true ;;
# no) python=false ;;
# *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
# esac],[python=false])
# AM_CONDITIONAL(O2SCL_PYTHON, test x$python = xtrue)
# ------------------------------------------------------------------
# Enable or disable support for acol
# ------------------------------------------------------------------
AC_ARG_ENABLE(acol,
[ --enable-acol Include 'acol' utility @<:@default=yes@:>@],
[case "${enableval}" in
yes) acol=true ;;
no) acol=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-acol) ;;
esac],[acol=true])
AM_CONDITIONAL(O2SCL_ENABLE_ACOL, test x$acol = xtrue)
# ------------------------------------------------------------------
# Enable or disable snap configurations
# ------------------------------------------------------------------
AC_ARG_ENABLE(snap,
[ --enable-snap Enable snap features @<:@default=no@:>@],
[case "${enableval}" in
yes) snap=true ;;
no) snap=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-snap) ;;
esac],[snap=false])
AM_CONDITIONAL(O2SCL_SNAP, test x$snap = xtrue)
# ------------------------------------------------------------------
# Enable or disable armadillo support
# ------------------------------------------------------------------
AC_ARG_ENABLE(armadillo,
[ --enable-armadillo Include Armadillo support @<:@default=no@:>@],
[case "${enableval}" in
yes) armadillo=true ;;
no) armadillo=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-armadillo) ;;
esac],[armadillo=false])
AM_CONDITIONAL(O2SCL_ARMA, test x$armadillo = xtrue)
# ------------------------------------------------------------------
# If enabled, check for Armadillo library
# ------------------------------------------------------------------
# AWS: This doesn't correctly find the Armadillo libraries yet
AS_IF([test "x$enable_armadillo" == "xyes"], [
AC_CHECK_LIB([armadillo], [wrapper_dgemm_],[],
[echo ""
echo "Armadillo library not found."
echo " The present value of LDFLAGS is: "
echo $LDFLAGS
echo ""
],[])
])
# ------------------------------------------------------------------
# Enable or disable Eigen support
# ------------------------------------------------------------------
AC_ARG_ENABLE(eigen,
[ --enable-eigen Include Eigen support @<:@default=no@:>@],
[case "${enableval}" in
yes) eigen=true ;;
no) eigen=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-eigen) ;;
esac],[eigen=false])
AM_CONDITIONAL(O2SCL_EIGEN, test x$eigen = xtrue)
# ------------------------------------------------------------------
# Enable or disable openmp support
# ------------------------------------------------------------------
AC_ARG_ENABLE(openmp,
[ --enable-openmp Include OpenMP support @<:@default=no@:>@],
[case "${enableval}" in
yes) openmp=true ;;
no) openmp=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-openmp) ;;
esac],[openmp=false])
AM_CONDITIONAL(O2SCL_OPENMP, test x$openmp = xtrue)
# ------------------------------------------------------------------
# Define 'host_os' to determine target system
# from https://stackoverflow.com/questions/38898591/how-to-check-the-os-with-automake
AC_CANONICAL_HOST
build_linux=no
build_windows=no
build_mac=no
# Detect the target system
case "${host_os}" in
linux*)
build_linux=yes
;;
cygwin*|mingw*)
build_windows=yes
;;
darwin*)
build_mac=yes
;;
*)
AC_MSG_ERROR(["OS $host_os is not supported"])
;;
esac
# Pass the conditionals to automake
AM_CONDITIONAL([O2SCL_LINUX], [test "$build_linux" = "yes"])
AM_CONDITIONAL([O2SCL_WINDOWS], [test "$build_windows" = "yes"])
AM_CONDITIONAL([O2SCL_OSX], [test "$build_mac" = "yes"])
# ------------------------------------------------------------------
AC_CONFIG_FILES([Makefile
src/Makefile
src/anneal/Makefile
src/base/Makefile
src/base/arma/Makefile
src/base/both/Makefile
src/base/eigen/Makefile
src/base/fftw/Makefile
src/base/mpfr/Makefile
src/base/neither/Makefile
src/base/openmp/Makefile
src/base/python/Makefile
src/base/readline/Makefile
src/deriv/Makefile
src/eos/Makefile
src/fit/Makefile
src/hdf/Makefile
src/inte/Makefile
src/internal/Makefile
src/linalg/Makefile
src/linalg/neither/Makefile
src/linalg/both/Makefile
src/linalg/arma/Makefile
src/linalg/eigen/Makefile
src/mcarlo/Makefile
src/min/Makefile
src/modtest/Makefile
src/nuclei/Makefile
src/ode/Makefile
src/other/Makefile
src/part/Makefile
src/root/Makefile
src/root/arma/Makefile
src/root/both/Makefile
src/root/eigen/Makefile
src/root/neither/Makefile
bin/Makefile
include/Makefile
include/o2scl/Makefile
data/Makefile
data/o2scl/Makefile
data/o2scl/nucmass/Makefile
data/o2scl/nucmass/frib_mex/Makefile
data/o2scl/nucmass/ame20/Makefile
data/o2scl/rmfdata/Makefile
data/o2scl/skdata/Makefile
data/o2scl/python/Makefile
examples/Makefile
examples/plot/Makefile
doc/Makefile
doc/o2scl/Makefile
doc/o2scl/sphinx/Makefile])
AC_OUTPUT