-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
624 lines (527 loc) · 18.5 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
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
AC_INIT([epic], [0.14.2], [[email protected]], [], [https://github.com/matt-frey/epic])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_PROG_FC([gfortran])
AC_LANG(Fortran)
AM_PROG_AR
LT_INIT
# change file extension from *.f to *.f90
# (important for library tests since it autogenerates a file conftest.f90)
AC_FC_SRCEXT(f90)
AC_FC_PP_SRCEXT(f90)
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
src/utils/Makefile
src/mpi/Makefile
src/netcdf/Makefile
src/fft/Makefile
src/2d/Makefile
src/3d/Makefile
models/Makefile
models/2d/Makefile
models/3d/Makefile
analyse/Makefile
analyse/2d/Makefile
analyse/3d/Makefile
unit-tests/Makefile
unit-tests/2d/Makefile
unit-tests/3d/Makefile
unit-tests/mpi/Makefile
unit-tests/netcdf/Makefile
mpi-tests/Makefile
python-scripts/Makefile
python-scripts/tools/Makefile
python-scripts/tools/animate/Makefile
python-scripts/tools/epic_config.py
run-script/Makefile
])
# 30 May 2023
# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
AX_COMPILER_VENDOR
if test "$ax_cv_fc_compiler_vendor" = "unknown"; then
AC_MSG_ERROR([Could not deduce compiler vendor.])
fi
AX_CHECK_COMPILE_FLAG([-cpp], [FCFLAGS="$FCFLAGS -cpp"])
AX_CHECK_COMPILE_FLAG([-mcmodel=large], [FCFLAGS="$FCFLAGS -mcmodel=large"])
# gfortran compiler flags
if test "$ax_cv_fc_compiler_vendor" = "gnu"; then
AX_CHECK_COMPILE_FLAG([-std=f2018], [FCFLAGS="$FCFLAGS -std=f2018"])
AX_CHECK_COMPILE_FLAG([-fall-intrinsics], [FCFLAGS="$FCFLAGS -fall-intrinsics"])
AX_CHECK_COMPILE_FLAG([-fdefault-real-8], [FCFLAGS="$FCFLAGS -fdefault-real-8"])
AX_CHECK_COMPILE_FLAG([-fdefault-double-8], [FCFLAGS="$FCFLAGS -fdefault-double-8"])
AX_CHECK_COMPILE_FLAG([-Wno-unused-dummy-argument], [FCFLAGS="$FCFLAGS -Wno-unused-dummy-argument"])
fi
# intel compiler flags
AX_CHECK_COMPILE_FLAG([-std18], [FCFLAGS="$FCFLAGS -std18"])
AX_CHECK_COMPILE_FLAG([-fp-model=source], [FCFLAGS="$FCFLAGS -fp-model=source"])
AX_CHECK_COMPILE_FLAG([-real-size 8], [FCFLAGS="$FCFLAGS -real-size 8"])
AX_CHECK_COMPILE_FLAG([-double-size 64], [FCFLAGS="$FCFLAGS -double-size 64"])
#######################################################################################
##
## "--with" flags
##
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# NetCDF C
## 11 March 2021
## https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/External-Software.html
AC_ARG_WITH([netcdf-c],
[AS_HELP_STRING([--with-netcdf-c=<path>], [path to NetCDF C library @<:@default=$NETCDF_C_DIR@:>@])],
[NETCDF_C_DIR=$withval],
[])
if test -n "${NETCDF_C_DIR}"; then
CFLAGS="$CFLAGS -I$NETCDF_C_DIR/include"
LDFLAGS="$LDFLAGS -L$NETCDF_C_DIR/lib"
else
AC_MSG_ERROR([No NETCDF_C_DIR environment variable.])
fi
AC_LANG_PUSH([C])
AC_SEARCH_LIBS([nc_create], [netcdf], [], [], [])
AC_MSG_CHECKING([whether we can compile a NetCDF C program])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <netcdf.h>], [
int ncid;
nc_create("dummy.nc", NC_CLOBBER, &ncid);
])],
[netcdf_c_found=yes],
[netcdf_c_found=no])
AC_MSG_RESULT([$netcdf_c_found])
AC_LANG_POP([C])
if test "x$netcdf_c_found" = "xno"; then
AC_MSG_ERROR([Cannot compile a NetCDF C program])
fi
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# NetCDF Fortran
AC_ARG_WITH([netcdf-fortran],
[AS_HELP_STRING([--with-netcdf-fortran=<path>],
[path to NetCDF Fortran library @<:@default=$NETCDF_FORTRAN_DIR@:>@])],
[NETCDF_FORTRAN_DIR=$withval],
[])
if test -n "${NETCDF_FORTRAN_DIR}"; then
FCFLAGS="$FCFLAGS -I$NETCDF_FORTRAN_DIR/include"
LDFLAGS="$LDFLAGS -L$NETCDF_FORTRAN_DIR/lib"
else
AC_MSG_ERROR([No NETCDF_FORTRAN_DIR environment variable.])
fi
# 15 April 2023
#http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_prog_fc_mpi.m4
# We cannot use AC_SEARCH_LIBS
for lib in NONE netcdff; do
save_LIBS=$LIBS
if test x"$lib" = xNONE; then
AC_MSG_CHECKING([for function nf90_open])
else
AC_MSG_CHECKING([for function nf90_open in -l$lib])
LIBS="-l$lib $LIBS"
fi
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([], [
use netcdf
implicit none
integer :: ncerr, ncid
ncerr = nf90_open("dummy.nc", NF90_NOWRITE, ncid)])],
[netcdf_found=yes],
[netcdf_found=no])
AC_MSG_RESULT($netcdf_found)
if test "x$netcdf_found" = "xyes"; then
break;
fi
LIBS=$save_LIBS
done
AC_MSG_CHECKING([whether we can compile a NetCDF Fortran program])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([], [
use netcdf
implicit none])],
[netcdf_fortran_found=yes],
[netcdf_fortran_found=no])
AC_MSG_RESULT([$netcdf_fortran_found])
if test "x$netcdf_fortran_found" = "xno"; then
AC_MSG_ERROR([Cannot compile a NetCDF Fortran program])
fi
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# MPI
AC_ARG_WITH([mpi],
[AS_HELP_STRING([--with-mpi=<path>], [path to mpi library @<:@default=$MPI_DIR@:>@])],
[MPI_DIR=$withval],
[])
if test -n "${MPI_DIR}"; then
# mod file may also be in $MPI_DIR/lib
FCFLAGS="$FCFLAGS -I$MPI_DIR/include -I$MPI_DIR/lib"
LDFLAGS="$LDFLAGS -L$MPI_DIR/lib"
else
AC_MSG_ERROR([No MPI_DIR environment variable.])
fi
AC_SEARCH_LIBS([MPI_Init],
[mpi_usempif08 mpi_usempi_ignore_tkr mpi_mpifh mpichf90],
[],
[])
AC_SEARCH_LIBS([MPI_Win_lock],
[mpi_usempif08 mpi_usempi_ignore_tkr mpi_mpifh mpichf90],
[],
[])
for lib in NONE mpi_usempif08 mpi_usempi_ignore_tkr mpi_mpifh mpichf90; do
save_LIBS=$LIBS
if test x"$lib" = xNONE; then
AC_MSG_CHECKING([for module mpi_f08])
else
AC_MSG_CHECKING([for module mpi_f08 in -l$lib])
LIBS="-l$lib $LIBS"
fi
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([], [
use mpi_f08
implicit none
integer :: ierr
call MPI_Init(ierr)
call MPI_Finalize(ierr)])],
[mpi_found=yes],
[mpi_found=no])
AC_MSG_RESULT([$mpi_found])
if test "x$mpi_found" = "xyes"; then
break;
fi
LIBS=$save_LIBS
done
AC_MSG_CHECKING([for MPI Fortran library])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([], [
use mpi_f08
implicit none
integer :: ierr
call MPI_Init(ierr)
call MPI_Finalize(ierr)])],
[mpi_found=yes],
[mpi_found=no])
AC_MSG_RESULT([$mpi_found])
if test "x$mpi_found" = "xno"; then
AC_MSG_ERROR([Cannot find MPI Fortran library])
fi
#######################################################################################
##
## "--enable" flags
##
##
## Python
##
## # 23 March 2021
## https://askubuntu.com/questions/29370/how-to-check-if-a-command-succeeded
## https://gitlab.psi.ch/H5hut/src/-/blob/master/configure.ac
##
ENABLE_PYTHON='no'
AC_ARG_ENABLE([python],
[AS_HELP_STRING([--enable-python], [enable Python (default=no)])],
[ENABLE_PYTHON=$enableval])
AM_CONDITIONAL([ENABLE_PYTHON], [test "$ENABLE_PYTHON" = "yes"])
if test "x$ENABLE_PYTHON" = "xyes"; then
AM_PATH_PYTHON([3.0])
#
# argparse
#
AC_MSG_CHECKING([for python argparse library])
`${PYTHON} -c 'import argparse' 2> config.log`
if test "X$?" = "X0" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Install argparse with "conda install -c conda-forge argparse".])
exit 1
fi
#
# numpy
#
AC_MSG_CHECKING([for python numpy library])
`${PYTHON} -c 'import numpy' 2> config.log`
if test "X$?" = "X0" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Install numpy with "conda install -c conda-forge numpy".])
exit 1
fi
#
# scipy
#
AC_MSG_CHECKING([for python scipy library])
`${PYTHON} -c 'import scipy' 2> config.log`
if test "X$?" = "X0" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Install numpy with "conda install -c conda-forge scipy".])
exit 1
fi
#
# pandas
#
AC_MSG_CHECKING([for python pandas library])
`${PYTHON} -c 'import pandas' 2> config.log`
if test "X$?" = "X0" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Install numpy with "conda install -c conda-forge pandas".])
exit 1
fi
#
# matplotlib
#
AC_MSG_CHECKING([for python matplotlib library])
`${PYTHON} -c 'import matplotlib.pyplot as plt' 2> config.log`
if test "x$?" = "x0" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Install matplotlib with "conda install -c conda-forge matplotlib".])
exit 1
fi
#
# seaborn
#
AC_MSG_CHECKING([for python seaborn library])
`${PYTHON} -c 'import seaborn' 2> config.log`
if test "X$?" = "X0" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Install numpy with "conda install -c conda-forge seaborn".])
exit 1
fi
#
# netcdf
#
AC_MSG_CHECKING([for python netcdf library])
`${PYTHON} -c 'import netCDF4' 2> config.log`
if test "x$?" = "x0" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Install netcdf with "conda install -c conda-forge netcdf4".])
exit 1
fi
#
# progressbar
#
AC_MSG_CHECKING([for python progressbar library])
`${PYTHON} -c 'import progressbar' 2> config.log`
if test "x$?" = "x0" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Install progressbar with "conda install -c conda-forge progressbar".])
exit 1
fi
#
# bokeh
#
AC_MSG_CHECKING([for python bokeh library])
`${PYTHON} -c 'import bokeh' 2> config.log`
if test "x$?" = "x0" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_NOTICE([Install bokeh with "conda install -c conda-forge bokeh".])
AC_MSG_NOTICE([Install phantomjs with "conda install -c conda-forge phantomjs".])
AC_MSG_NOTICE([Install selenium with "conda install -c bokeh selenium".])
AC_MSG_NOTICE([Install geckodriver with "conda install -c conda-forge firefox geckodriver".])
exit 1
AC_MSG_RESULT([no])
fi
fi
ENABLE_3D='yes'
AC_ARG_ENABLE([3d],
[AS_HELP_STRING([--enable-3d], [enable 3D model (default=yes)])],
[ENABLE_3D=$enableval])
AM_CONDITIONAL([ENABLE_3D], [test "$ENABLE_3D" = "yes"])
AC_MSG_CHECKING([whether we are compiling the 3D model])
if test "x$ENABLE_3D" = "xyes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
ENABLE_BUOYANCY_PERTURBATION_MODE='no'
AC_ARG_ENABLE([buoyancy-perturbation-mode],
[AS_HELP_STRING([--enable-buoyancy-perturbation-mode],
[enable buoyancy perturbation mode (default=no)])],
[ENABLE_BUOYANCY_PERTURBATION_MODE=$enableval])
AM_CONDITIONAL([ENABLE_BUOYANCY_PERTURBATION_MODE], [test "$ENABLE_BUOYANCY_PERTURBATION_MODE" = "yes"])
AC_MSG_CHECKING([whether we are compiling in buoyancy perturbation mode])
if test "x$ENABLE_BUOYANCY_PERTURBATION_MODE" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -DENABLE_BUOYANCY_PERTURBATION_MODE"
else
AC_MSG_RESULT([no])
fi
ENABLE_DRY_MODE='no'
AC_ARG_ENABLE([dry-mode],
[AS_HELP_STRING([--enable-dry-mode], [enable dry mode (default=no)])],
[ENABLE_DRY_MODE=$enableval])
AM_CONDITIONAL([ENABLE_DRY_MODE], [test "$ENABLE_DRY_MODE" = "yes"])
AC_MSG_CHECKING([whether we are compiling in dry mode])
if test "x$ENABLE_DRY_MODE" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -DENABLE_DRY_MODE"
else
AC_MSG_RESULT([no])
fi
ENABLE_LABELS='no'
AC_ARG_ENABLE([labels],
[AS_HELP_STRING([--enable-labels], [enable labels (default=no)])],
[ENABLE_LABELS=$enableval])
AM_CONDITIONAL([ENABLE_LABELS], [test "$ENABLE_LABELS" = "yes"])
AC_MSG_CHECKING([whether we are compiling with labels])
if test "x$ENABLE_LABELS" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -DENABLE_LABELS"
else
AC_MSG_RESULT([no])
fi
ENABLE_P2G_1POINT='no'
AC_ARG_ENABLE([p2g-1point],
[AS_HELP_STRING([--enable-p2g-1point], [enable one-point par2grid (default=no)])],
[ENABLE_P2G_1POINT=$enableval])
AM_CONDITIONAL([ENABLE_P2G_1POINT], [test "$ENABLE_P2G_1POINT" = "yes"])
AC_MSG_CHECKING([whether we are compiling with 1 point in par2grid])
if test "x$ENABLE_P2G_1POINT" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -DENABLE_P2G_1POINT"
else
AC_MSG_RESULT([no])
fi
ENABLE_G2P_1POINT='no'
AC_ARG_ENABLE([g2p-1point],
[AS_HELP_STRING([--enable-g2p-1point], [enable one-point grid2par (default=no)])],
[ENABLE_G2P_1POINT=$enableval])
AM_CONDITIONAL([ENABLE_G2P_1POINT], [test "$ENABLE_G2P_1POINT" = "yes"])
AC_MSG_CHECKING([whether we are compiling with 1 point in grid2par])
if test "x$ENABLE_G2P_1POINT" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -DENABLE_G2P_1POINT"
else
AC_MSG_RESULT([no])
fi
ENABLE_DIAGNOSE='no'
AC_ARG_ENABLE([diagnose],
[AS_HELP_STRING([--enable-diagnose], [enable diagnose mode (default=no)])],
[ENABLE_DIAGNOSE=$enableval])
AM_CONDITIONAL([ENABLE_DIAGNOSE], [test "$ENABLE_DIAGNOSE" = "yes"])
AC_MSG_CHECKING([whether we are compiling in diagnose mode])
if test "x$ENABLE_DIAGNOSE" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -DENABLE_DIAGNOSE"
else
AC_MSG_RESULT([no])
fi
ENABLE_VERBOSE='no'
AC_ARG_ENABLE([verbose],
[AS_HELP_STRING([--enable-verbose], [enable verbose mode (default=no)])],
[ENABLE_VERBOSE=$enableval])
AM_CONDITIONAL([ENABLE_VERBOSE], [test "$ENABLE_VERBOSE" = "yes"])
AC_MSG_CHECKING([whether we are compiling in verbose mode])
if test "x$ENABLE_VERBOSE" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -DENABLE_VERBOSE"
else
AC_MSG_RESULT([no])
fi
ENABLE_DEBUG='no'
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [compile in debug mode (default=no)])],
[ENABLE_DEBUG=$enableval])
AM_CONDITIONAL([ENABLE_DEBUG], [test "$ENABLE_DEBUG" = "yes"])
AC_MSG_CHECKING([whether we are compiling in debug mode])
if test "x$ENABLE_DEBUG" = "xyes"; then
AC_MSG_RESULT([yes])
AX_CHECK_COMPILE_FLAG([-g], [FCFLAGS="$FCFLAGS -g"])
AX_CHECK_COMPILE_FLAG([-O0], [FCFLAGS="$FCFLAGS -O0"])
# gfortran compiler flags
AX_CHECK_COMPILE_FLAG([-Wall], [FCFLAGS="$FCFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-Wuninitialized], [FCFLAGS="$FCFLAGS -Wuninitialized"])
AX_CHECK_COMPILE_FLAG([-Wmaybe-uninitialized], [FCFLAGS="$FCFLAGS -Wmaybe-uninitialized"])
AX_CHECK_COMPILE_FLAG([-Werror], [FCFLAGS="$FCFLAGS -Werror"])
AX_CHECK_COMPILE_FLAG([-fcheck=all], [FCFLAGS="$FCFLAGS -fcheck=all"])
AX_CHECK_COMPILE_FLAG([-fbounds-check], [FCFLAGS="$FCFLAGS -fbounds-check"])
AX_CHECK_COMPILE_FLAG([-fbacktrace], [FCFLAGS="$FCFLAGS -fbacktrace"])
AX_CHECK_COMPILE_FLAG([-ffpe-trap=denormal,invalid,zero,overflow,underflow],
[FCFLAGS="$FCFLAGS -ffpe-trap=denormal,invalid,zero,overflow,underflow"])
# intel compiler flags
AX_CHECK_COMPILE_FLAG([-warn all], [FCFLAGS="$FCFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-warn error], [FCFLAGS="$FCFLAGS -warn error"])
AX_CHECK_COMPILE_FLAG([-debug full], [FCFLAGS="$FCFLAGS -debug full"])
else
AC_MSG_RESULT([no])
AX_CHECK_COMPILE_FLAG([-O3], [FCFLAGS="$FCFLAGS -O3"])
AX_CHECK_COMPILE_FLAG([-DNDEBUG], [FCFLAGS="$FCFLAGS -DNDEBUG"])
# gfortran compiler flags
AX_CHECK_COMPILE_FLAG([-funroll-all-loops], [FCFLAGS="$FCFLAGS -funroll-all-loops"])
AX_CHECK_COMPILE_FLAG([-flto], [FCFLAGS="$FCFLAGS -flto"])
# intel compiler flags
AX_CHECK_COMPILE_FLAG([-funroll-loops], [FCFLAGS="$FCFLAGS -funroll-loops"])
AX_CHECK_COMPILE_FLAG([-ipo -c], [FCFLAGS="$FCFLAGS -ipo -c"])
AX_CHECK_COMPILE_FLAG([-ffat-lto-objects], [FCFLAGS="$FCFLAGS -ffat-lto-objects"])
fi
ENABLE_UNIT_TESTS='no'
AC_ARG_ENABLE([unit-tests],
[AS_HELP_STRING([--enable-unit-tests], [build with unit tests (default=no)])],
[ENABLE_UNIT_TESTS=$enableval])
AM_CONDITIONAL([ENABLE_UNIT_TESTS], [test "$ENABLE_UNIT_TESTS" = "yes"])
AC_MSG_CHECKING([whether we build unit tests])
if test "x$ENABLE_UNIT_TESTS" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -DENABLE_UNIT_TESTS"
else
AC_MSG_RESULT([no])
fi
if test "x$ENABLE_UNIT_TESTS" == "xyes" && test "x$ENABLE_DEBUG" == "xno"; then
AC_MSG_WARN([Volume symmetry unit test disabled since not built in debug mode.])
fi
ENABLE_OPENMP='no'
AC_ARG_ENABLE([openmp],
[AS_HELP_STRING([--enable-openmp], [enable OpenMP (default=no)])],
[ENABLE_OPENMP=$enableval])
AM_CONDITIONAL([ENABLE_OPENMP], [test "$ENABLE_OPENMP" = "yes"])
AC_MSG_CHECKING([whether we are enabling OpenMP])
if test "x$ENABLE_OPENMP" = "xyes"; then
AC_MSG_RESULT([yes])
# gfortran compiler flags
AX_CHECK_COMPILE_FLAG([-fopenmp], [FCFLAGS="$FCFLAGS -fopenmp -DENABLE_OPENMP"])
# intel compiler flags
AX_CHECK_COMPILE_FLAG([-qopenmp], [FCFLAGS="$FCFLAGS -qopenmp -DENABLE_OPENMP"])
else
AC_MSG_RESULT([no])
fi
#
# Scalasca and Score-P
#
ENABLE_SCALASCA='no'
AC_ARG_ENABLE([scalasca],
[AS_HELP_STRING([--enable-scalasca], [compile with scalasca enabled (default=no)])],
[ENABLE_SCALASCA=$enableval])
AM_CONDITIONAL([ENABLE_SCALASCA], [test "ENABLE_SCALASCA" = "yes"])
AC_MSG_CHECKING([whether we are compiling with scalasca])
if test "x$ENABLE_SCALASCA" = "xyes"; then
AC_MSG_RESULT([yes])
# check if scalasca executable is part of $PATH
AC_CHECK_PROG([scalasca_found],
[scalasca],
[yes],
[no],
[$PATH])
if test "x$scalasca_found" = "xno"; then
AC_MSG_ERROR([Scalasca not part of PATH environment variable!])
fi
# check if scorep (needed by scalasca executable is part of $PATH
AC_CHECK_PROG([scorep_found],
[scorep],
[yes],
[no],
[$PATH])
if test "x$scorep_found" = "xno"; then
AC_MSG_ERROR([Score-P not part of PATH environment variable!])
fi
FC="scalasca -instrument $FC"
else
AC_MSG_RESULT([no])
fi
AC_OUTPUT