-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
3058 lines (2806 loc) · 140 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
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------
AC_PREREQ([2.69])
ACX_POLYMORPHIC_OPTION([enable], [fcgroup-*], [icon_fcgroups])
AC_INIT([icon], [2024.10], [], [icon-2024.10])
AC_CONFIG_MACRO_DIR([m4])
m4_pattern_forbid([^A[SC]?X_])dnl
AC_CONFIG_AUX_DIR([utils])
AC_CONFIG_SRCDIR([src/drivers/icon.f90])
icon_usr_note="
********************************************************************************
The users are recommended to run site-specific wrappers instead of this generic
configure script.
You can find the wrappers in '${srcdir}/config/<organization>/'.
If you are running a wrapper and still see this message than either you are
using a wrong one or the wrapper is broken, or there is really a problem with
the configure script.
********************************************************************************
"
m4_define([AC_MSG_FAILURE],
[{ AS_MESSAGE([error: in `$ac_pwd':], 2)
AC_MSG_ERROR([$1
See `config.log' for more details
${icon_usr_note}], [$2]); }])
dnl End of the temporary message injection. Delete up until this line once the
dnl message is not needed anymore.
dnl We need to make sure that the source directory is clean when building
dnl out-of-source for two reasons:
dnl 1. Building systems of most of the bundled packages are Automake-based
dnl and, therefore, they rely on the standard non-selective search path
dnl (i.e., VPATH) feature of make for out-of-source builds. This makes
dnl having a clean source directory a hard requirement for them. Otherwise,
dnl instead of generating object files in the build directory, make would
dnl simply take them from the dirty source directory. For that reason, the
dnl respective configure scripts will run a check similar to the one below
dnl and fail if their source directories are dirty. It is better that we
dnl run the check much earlier and fail the configuration with a more
dnl informative error message.
dnl 2. The makefiles of ICON rely on the selective search path (i.e. vpath)
dnl feature of GNU Make. Therefore, the problem with the object files that
dnl is described above is irrelevant. However, icon.mk supports Fortran
dnl source file preprocessing. The input and output files of the most of
dnl the preprocessing steps are valid Fortran files. Thus, both the
dnl original files in the source directory and the preprocessed files in
dnl the build directory have the same suffix '.f90', which makes it
dnl impossible to declare selective search paths that would work for the
dnl original files but wouldn't work for the preprocessed files. This might
dnl lead to the preprocessed files being taken from the dirty source
dnl directory instead of being generated in the build directory. A
dnl workaround for this, which had been implemented before, is to refer to
dnl the preprocessed files by their absolute paths. However, it makes the
dnl makefiles overcomplicated and error-prone. Instead, we simply forbid
dnl the source directory to be dirty in the case of out-of-source build.
AS_IF([test "`cd $srcdir && pwd`" != "`pwd`" && dnl
test -f "$srcdir/config.status"],
[AC_MSG_ERROR([source directory already configured; dnl
run "make distclean" there first])])
############################# OPTION DECLARATIONS ##############################
AC_ARG_ENABLE([rpaths],
[AS_HELP_STRING([--enable-rpaths],
[add directories specified with -L flags in LDFLAGS and LIBS to the
runtime library search paths (RPATH) @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_rpaths=yes])],
[enable_rpaths=yes])
AC_ARG_ENABLE([silent-rules],
[AS_HELP_STRING([--enable-silent-rules],
[less verbose build output (undo: "make V=1") @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_silent_rules=yes])],
[enable_silent_rules=yes])
AC_ARG_ENABLE([delayed-config],
[AS_HELP_STRING([--enable-delayed-config],
[configure the bundled packages at the build time @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_delayed_config=yes])],
[enable_delayed_config=yes])
AC_ARG_ENABLE([separate-mods],
[AS_HELP_STRING([--enable-separate-mods],
[enable the two-step compilation of the Fortran source files (increases the
total overhead but potentially reduces the wall clock time for parallel builds
due to a faster Fortran module generation) @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_separate_mods=yes])],
[enable_separate_mods=no])
m4_divert_once([HELP_ENABLE], [[
Model Features:]])
AC_ARG_ENABLE([atmo],
[AS_HELP_STRING([--enable-atmo],
[enable the atmosphere component of ICON @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_atmo=yes])],
[enable_atmo=yes])
AC_ARG_ENABLE([les],
[AS_HELP_STRING([--enable-les],
[enable the Large-Eddy Simulation component of ICON @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_les=yes])],
[enable_les=yes])
AC_ARG_ENABLE([upatmo],
[AS_HELP_STRING([--enable-upatmo],
[enable the upper atmosphere component of ICON @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_upatmo=yes])],
[enable_upatmo=yes])
AC_ARG_ENABLE([ocean],
[AS_HELP_STRING([--enable-ocean],
[enable the ocean component of ICON @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_ocean=yes])],
[enable_ocean=yes])
AC_ARG_ENABLE([jsbach],
[AS_HELP_STRING([--enable-jsbach],
[enable the land component of ICON (ICON-Land) @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_jsbach=yes])],
[enable_jsbach=yes])
AC_ARG_ENABLE([jsbach-hd],
[AS_HELP_STRING([--enable-jsbach-hd],
[enable the internal hydrological discharge (HD) scheme of the land
component @<:@default=auto@:>@])],
[AS_IF([test x"$enableval" != xno && test x"$enableval" != xauto],
[enable_jsbach_hd=yes])],
[enable_jsbach_hd=auto])
AC_ARG_ENABLE([quincy],
[AS_HELP_STRING([--enable-quincy],
[enable the QUINCY biogeochemistry model in the land component
@<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_quincy=yes])],
[enable_quincy=no])
AC_ARG_ENABLE([waves],
[AS_HELP_STRING([--enable-waves],
[enable the ocean surface wave component of ICON @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_waves=yes])],
[enable_waves=no])
AC_ARG_ENABLE([coupling],
[AS_HELP_STRING([--enable-coupling],
[enable the coupling @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_coupling=yes])],
[enable_coupling=yes])
AC_ARG_ENABLE([aes],
[AS_HELP_STRING([--enable-aes],
[enable the AES physics package @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_aes=yes])],
[enable_aes=yes])
AC_ARG_ENABLE([nwp],
[AS_HELP_STRING([--enable-nwp],
[enable the NWP physics package @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_nwp=yes])],
[enable_nwp=yes])
AC_ARG_ENABLE([ecrad],
[AS_HELP_STRING([--enable-ecrad],
[enable usage of the ECMWF radiation scheme (ECRAD) @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_ecrad=yes])],
[enable_ecrad=no])
AC_ARG_ENABLE([rte-rrtmgp],
[AS_HELP_STRING([--enable-rte-rrtmgp],
[enable usage of the RTE+RRTMGP toolbox for radiation calculations
@<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_rte_rrtmgp=yes])],
[enable_rte_rrtmgp=yes])
AC_ARG_ENABLE([rttov],
[AS_HELP_STRING([--enable-rttov],
[enable usage of the radiative transfer model for TOVS
@<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_rttov=yes])],
[enable_rttov=no])
AC_ARG_ENABLE([dace],
[AS_HELP_STRING([--enable-dace],
[enable the DACE modules for data assimilation @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_dace=yes])],
[enable_dace=no])
AC_ARG_ENABLE([emvorado],
[AS_HELP_STRING([--enable-emvorado],
[enable the radar forward operator EMVORADO @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_emvorado=yes])],
[enable_emvorado=no])
AC_ARG_ENABLE([art],
[AS_HELP_STRING([--enable-art],
[enable the aerosols and reactive trace component ART
@<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_art=yes])],
[enable_art=no])
AC_ARG_ENABLE([art-gpl],
[AS_HELP_STRING([--enable-art-gpl],
[enable GPL-licensed code parts of the ART component @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_art_gpl=yes])],
[enable_art_gpl=no])
AC_ARG_ENABLE([comin],
[AS_HELP_STRING([--enable-comin],
[enable the ICON community interface (COMIN) @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_comin=yes])],
[enable_comin=no])
AC_ARG_ENABLE([hd],
[ --enable-hd enable the Hydrological Discharge (HD) model. The
value of the argument must be one of the following
@<:@default=no@:>@:
05deg|yes enable for the 0.5-degree global domain
5min enable for the 5min global domain
no disable the HD model],
[AS_CASE([$enableval],
[yes], [enable_hd=05deg],
[05deg|5min|no], [],
[AC_MSG_ERROR([unexpected value for the argument dnl
--enable-hd='$enableval'; valid values are '05deg', 'yes' (same dnl
as '05deg'), '5min', 'no'])])],
[enable_hd=no])
AC_ARG_ENABLE([acm-license],
[AS_HELP_STRING([--enable-acm-license],
[enable code parts that require accepting the ACM Software License ]dnl
[Agreement @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_acm_license=yes])],
[enable_acm_license=no])
m4_divert_once([HELP_ENABLE], [[
Infrastructural Features:]])
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING([--enable-mpi],
[enable MPI (parallelization) support @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_mpi=yes])],
[enable_mpi=yes])
AC_ARG_ENABLE([mpi-checks],
[AS_HELP_STRING([--enable-mpi-checks],
[enable configure-time checks of MPI library for known defects ]dnl
[@<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_mpi_checks=yes])],
[enable_mpi_checks=yes])
AC_ARG_ENABLE([active-target-sync],
[AS_HELP_STRING([--enable-active-target-sync],
[enable MPI active target mode (otherwise, passive target mode is used)
@<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_active_target_sync=yes])],
[enable_active_target_sync=no])
dnl switch to disable MPI_Rget for systems where it doesn't work
AC_ARG_ENABLE([mpi-rget],
[AS_HELP_STRING([--enable-mpi-rget],
[enable usage of the MPI_Rget routine @<:@default=auto@:>@])],
[AS_IF([test x"$enableval" != xno && test x"$enableval" != xauto],
[enable_mpi_rget=yes])],
[enable_mpi_rget=auto])
AC_ARG_ENABLE([mpi-gpu],
[AS_HELP_STRING([--enable-mpi-gpu],
[enable usage of the GPU-aware MPI features @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_mpi_gpu=yes])],
[enable_mpi_gpu=no])
AC_ARG_ENABLE([async-io-rma],
[AS_HELP_STRING([--enable-async-io-rma],
[enable MPI RMA for asynchronous I/O @<:@default=yes@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_async_io_rma=yes])],
[enable_async_io_rma=yes])
AC_ARG_ENABLE([openmp],
[AS_HELP_STRING([--enable-openmp],
[enable OpenMP support @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_openmp=yes])],
[enable_openmp=no])
AC_ARG_ENABLE([gpu],
[ --enable-gpu enable GPU support. The value of the argument must
be one of the following @<:@default=no@:>@:
openacc+cuda enable support with OpenACC and CUDA
openacc+hip enable support with OpenACC and HIP
openacc alias for 'openacc+cuda'
yes alias for 'openacc+cuda'
no disable GPU support],
[AS_CASE([$enableval],
[openacc|yes], [enable_gpu='openacc+cuda'],
[openacc+cuda|openacc+hip|no], [],
[AC_MSG_ERROR([unexpected value for the argument dnl
--enable-gpu='$enableval'; valid values are 'openacc+cuda', 'openacc+hip', dnl
'openacc' (same as 'openacc+cuda'), 'yes' (same as 'openacc+cuda'), 'no'])])],
[enable_gpu=no])
AS_CASE([$enable_gpu],
[openacc+*], [icon_gpu_primary=openacc],
[icon_gpu_primary=no])
AS_CASE([$enable_gpu],
[*+cuda], [icon_gpu_secondary=cuda],
[*+hip], [icon_gpu_secondary=hip],
[icon_gpu_secondary=no])
AC_ARG_ENABLE([grib2],
[AS_HELP_STRING([--enable-grib2],
[enable GRIB2 I/O @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_grib2=yes])],
[enable_grib2=no])
AC_ARG_ENABLE([parallel-netcdf],
[AS_HELP_STRING([--enable-parallel-netcdf],
[enable usage of the parallel features of NetCDF
@<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_parallel_netcdf=yes])],
[enable_parallel_netcdf=no])
AC_ARG_ENABLE([cdi-pio],
[AS_HELP_STRING([--enable-cdi-pio],
[enable usage of the parallel features of CDI @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_cdi_pio=yes])],
[enable_cdi_pio=no])
AC_ARG_ENABLE([sct],
[AS_HELP_STRING([--enable-sct],
[enable the SCT timer @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_sct=yes])],
[enable_sct=no])
AC_ARG_ENABLE([yaxt],
[AS_HELP_STRING([--enable-yaxt],
[enable the YAXT data exchange @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_yaxt=yes])],
[enable_yaxt=no])
AC_ARG_ENABLE([explicit-fpp],
[AS_HELP_STRING([--enable-explicit-fpp],
[enable explicit Fortran preprocessing @<:@default=auto@:>@])],
[AS_IF([test x"$enableval" != xno && test x"$enableval" != xauto],
[enable_explicit_fpp=yes])],
[enable_explicit_fpp=auto])
AC_ARG_ENABLE([serialization],
[ --enable-serialization enable the Serialbox2 serialization. The value of
the argument must be one of the following
@<:@default=no@:>@:
read enable READ mode
perturb enable READ & PERTURB mode
create enable CREATE mode
yes alias for 'read'
no disable serialization],
[AS_CASE([$enableval],
[yes], [enable_serialization=read],
[read|perturb|create|no], [],
[AC_MSG_ERROR([unexpected value for the argument dnl
--enable-serialization='$enableval'; valid values are 'read', 'perturb', dnl
'create', 'yes' (same as 'read'), 'no'])])],
[enable_serialization=no])
AS_VAR_IF([enable_explicit_fpp], [auto],
[AS_IF([test x"$enable_serialization" != xno],
[AC_MSG_NOTICE([explicit Fortran preprocessing is enabled because the dnl
Serialbox2 serialization is requested: disable the explicit preprocessing dnl
if required (--disable-explicit-fpp)])
enable_explicit_fpp=yes],
[enable_explicit_fpp=no])])
AC_ARG_ENABLE([testbed],
[AS_HELP_STRING([--enable-testbed],
[enable ICON Testbed infrastructure @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_testbed=yes])],
[enable_testbed=no])
AC_ARG_ENABLE([memory-tracing],
[ --enable-memory-tracing enable native dynamic memory tracing facility. The
value of the argument must be one of the following
@<:@default=no@:>@:
mtrace enable tracing with mtrace (glibc)
yes alias for 'mtrace'
no disable memory tracing],
[AS_CASE([$enableval],
[yes], [enable_memory_tracing=mtrace],
[mtrace|no], [],
[AC_MSG_ERROR([unexpected value for the argument dnl
--enable-memory-tracing='$enableval'; valid values are 'mtrace', 'yes' (same dnl
as 'mtrace'), 'no'])])],
[enable_memory_tracing=no])
m4_define([icon_supported_bundled_python], [mtime, yac, comin])dnl
AC_ARG_ENABLE([bundled-python],
[ --enable-bundled-python enable Python interfaces of the bundled libraries.
The value of the argument must be either one of the
following @<:@default=no@:>@:
auto|yes enable all supported interfaces of the
enabled bundled libraries
no disable Python interfaces
or a comma-separated list of libraries to enable the
m4_text_wrap([Python interfaces for: ]m4_join([, ], icon_supported_bundled_python),
[ ])],
[AS_CASE([$enableval],
[auto|no], [],
[yes], [enable_bundled_python=auto],
[icon_save_IFS=$IFS
IFS=','
for icon_bundled_name in $enableval; do
IFS=$icon_save_IFS
AS_CASE([$icon_bundled_name],
[''|m4_join([|], icon_supported_bundled_python)], [],
[AC_MSG_ERROR([unexpected value for the argument dnl
--enable-bundled-python='$enableval'; valid values are 'auto', 'yes' (same as dnl
'auto'), 'no' or a comma-separated subset of the following: dnl
'm4_join([', '], icon_supported_bundled_python)'])])
done
IFS=$icon_save_IFS])],
[enable_bundled_python=no])
for icon_bundled_name in m4_join([ ], icon_supported_bundled_python); do
AS_CASE([$enable_bundled_python],
[auto|no],
[AS_VAR_SET([icon_${icon_bundled_name}_python], [$enable_bundled_python])],
[AS_CASE([",${enable_bundled_python},"],
[*",${icon_bundled_name},"*],
[AS_VAR_SET([icon_${icon_bundled_name}_python], [yes])],
[AS_VAR_SET([icon_${icon_bundled_name}_python], [no])])])
done
m4_divert_once([HELP_ENABLE], [[
Optimization Features:]])
AC_ARG_ENABLE([loop-exchange],
[AS_HELP_STRING([--enable-loop-exchange],
[enable loop exchange @<:@default=auto@:>@])],
[AS_IF([test x"$enableval" != xno && test x"$enableval" != xauto],
[enable_loop_exchange=yes])],
[enable_loop_exchange=auto])
AS_VAR_IF([enable_loop_exchange], [auto],
[AS_VAR_IF([icon_gpu_primary], [openacc],
[enable_loop_exchange=no],
[AC_MSG_NOTICE([loop exchange is enabled because no GPU support is dnl
requested: disable the loop exchange if required (--disable-loop-exchange)])
enable_loop_exchange=yes])])
AC_ARG_ENABLE([dim-swap],
[AS_HELP_STRING([--enable-dim-swap],
[enable dimension swap @<:@default=auto@:>@])],
[AS_IF([test x"$enableval" != xno && test x"$enableval" != xauto],
[enable_dim_swap=yes])],
[enable_dim_swap=auto])
AS_VAR_IF([enable_dim_swap], [auto],
[AS_VAR_IF([icon_gpu_primary], [openacc],
[AC_MSG_NOTICE([dimension swap is enabled because the GPU support is dnl
requested: disable the dimension swap if required (--disable-dim-swap)])
enable_dim_swap=yes],
[enable_dim_swap=no])])
AC_ARG_ENABLE([realloc-buf],
[AS_HELP_STRING([--enable-realloc-buf],
[enable reallocatable buffer in the communication @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno ], [enable_realloc_buf=yes])],
[enable_realloc_buf=no])
AC_ARG_ENABLE([vectorized-lrtm],
[AS_HELP_STRING([--enable-vectorized-lrtm],
[enable the parallelization-invariant version of LRTM
@<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_vectorized_lrtm=yes])],
[enable_vectorized_lrtm=no])
AC_ARG_ENABLE([mixed-precision],
[AS_HELP_STRING([--enable-mixed-precision],
[enable mixed precision dycore @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_mixed_precision=yes])],
[enable_mixed_precision=no])
AC_ARG_ENABLE([intel-consistency],
[AS_HELP_STRING([--enable-intel-consistency],
[enable Intel compiler directives enforcing consistency
@<:@default=auto@:>@])],
[AS_IF([test x"$enableval" != xno && test x"$enableval" != xauto],
[enable_intel_consistency=yes])],
[enable_intel_consistency=auto])
AC_ARG_ENABLE([hip-overrides],
[AS_HELP_STRING([--enable-hip-overrides],
[enable HIP overrides, which improves the performance on AMD GPUs by
suppressing the HIP event handling in the Cray OpenACC runtime
@<:@default=auto@:>@])],
[AS_IF([test x"$enableval" != xno && test x"$enableval" != xauto],
[enable_hip_overrides=yes])],
[enable_hip_overrides=auto])
AC_ARG_ENABLE([pgi-inlib],
[AS_HELP_STRING([--enable-pgi-inlib],
[enable PGI/NVIDIA cross-file function inlining via an inline library
@<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno && test x"$enableval" != xauto],
[enable_pgi_inlib=yes])],
[enable_pgi_inlib=no])
AC_ARG_ENABLE([nccl],
[AS_HELP_STRING([--enable-nccl],
[enable NCCL for communication @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_nccl=yes])],
[enable_nccl=no])
AC_ARG_ENABLE([cuda-graphs],
[AS_HELP_STRING([--enable-cuda-graphs],
[enable CUDA graphs @<:@default=no@:>@])],
[AS_IF([test x"$enableval" != xno], [enable_cuda_graphs=yes])],
[enable_cuda_graphs=no])
m4_divert_once([HELP_ENABLE],
[ --enable-fcgroup-<NAME> enable Fortran compile group <NAME>, which can be
compiled with an extra set of compiler flags. <NAME>
can be any non-empty string consisting of capital
letters, digits and underscores. The Fortran
compiler flags to be appended to FCFLAGS when
compiling files of the group are read from the
environment variable ICON_<NAME>_FCFLAGS. The paths
to the directories and files included in the group
must be provided relative to the root source
directory. The value of the argument must be one of
the following @<:@default=no@:>@:
path1:path2 a colon-separated list of paths to
the directories and files included in
the group
yes read paths to the directories and
files of the group from the
environment variable ICON_<NAME>_PATH
no disable the group])
AC_SUBST([ICON_FCGROUP_ASSIGNMENTS], [''])
icon_fcgroups_unique=
icon_fcgroup_all_entries=
for icon_fcgroup in $icon_fcgroups; do
dnl Skip if the group has already been processed:
AS_CASE([" $icon_fcgroups_unique "],
[*"$icon_fcgroup"*], [continue],
[AS_VAR_APPEND([icon_fcgroups_unique], [" $icon_fcgroup"])])
dnl Check that the name of the group consists of capital letters, digits and
dnl underscores:
expr "X$icon_fcgroup" : "[.*[^_$as_cr_LETTERS$as_cr_digits]]" >/dev/null &&
AC_MSG_ERROR([invalid compile group name '$icon_fcgroup': only capital dnl
letters and digits are allowed])
dnl Resolve trivial option values:
enableval=AS_VAR_GET([enable_fcgroup_$icon_fcgroup])
AS_CASE([$enableval],
[no], [continue],
[yes], [AS_VAR_COPY([enableval], [ICON_${icon_fcgroup}_PATH])])
enableval=`AS_ECHO(["$enableval"]) | sed 's/::*/:/g;s/^://;s/:*$//'`
dnl
icon_save_IFS=$IFS
IFS=':'
for icon_fcgroup_entry in $enableval; do
IFS=$icon_save_IFS
AS_CASE([$icon_fcgroup_entry],
[[[\\/]]* | ?:[[\\/]]*],
[AC_MSG_WARN([entry '$icon_fcgroup_entry' of the Fortran compile group dnl
'$icon_fcgroup' is ignored: not a relative path])
continue])
icon_fcgroup_path="$srcdir/$icon_fcgroup_entry"
AS_IF(
[test -d "$icon_fcgroup_path"],
[icon_fcgroup_entry_dirname=$icon_fcgroup_path
icon_fcgroup_entry_basename=],
[test -f "$icon_fcgroup_path"],
[icon_fcgroup_entry_dirname=`AS_DIRNAME(["$icon_fcgroup_path"])`
icon_fcgroup_entry_basename=`AS_BASENAME(["$icon_fcgroup_path"])`],
[AC_MSG_WARN([entry '$icon_fcgroup_entry' of the Fortran compile group dnl
'$icon_fcgroup' is ignored: not recognized as an existing directory or a file])
continue])
icon_fcgroup_entry_dirname=`cd "$icon_fcgroup_entry_dirname" >/dev/null dnl
2>&1 && pwd` || { AC_MSG_WARN([entry '$icon_fcgroup_entry' of the Fortran dnl
compile group '$icon_fcgroup' is ignored: unable to detect absolute path to dnl
'$icon_fcgroup_entry_dirname']); continue; }
AS_CASE([$icon_fcgroup_entry_dirname],
["$ac_abs_confdir"[[\\/]]*], [],
[AC_MSG_WARN([entry '$icon_fcgroup_entry' of the Fortran compile group dnl
'$icon_fcgroup' is ignored: not a subdirectory of the root source directory])
continue])
icon_fcgroup_entry_dirname=`AS_ECHO(["$icon_fcgroup_entry_dirname"]) | dnl
sed "s:^$ac_abs_confdir[[\\/]]::"`
icon_fcgroup_entry_basename=`AS_ECHO(["$icon_fcgroup_entry_basename"]) | dnl
sed 's:[[^\.]]*$:%:'`
icon_fcgroup_pattern=dnl
"${icon_fcgroup_entry_dirname}/${icon_fcgroup_entry_basename}"
AS_CASE(["$icon_fcgroup_all_entries:"],
[*":$icon_fcgroup_pattern:"*],
[AC_MSG_WARN([entry '$icon_fcgroup_entry' of the Fortran compile group dnl
'$icon_fcgroup' is ignored: an entry with the same relative path (modulo dnl
file extension) has already been registered])
continue],
[AS_VAR_APPEND([icon_fcgroup_all_entries], [":$icon_fcgroup_pattern"])])
AS_IF([test -n "$ICON_FCGROUP_ASSIGNMENTS"],
[AS_VAR_APPEND([ICON_FCGROUP_ASSIGNMENTS], ["
"])])
AS_VAR_APPEND([ICON_FCGROUP_ASSIGNMENTS],
["${icon_fcgroup_pattern}: dnl
ICON_FCFLAGS:= \$(ICON_${icon_fcgroup}_FCFLAGS)"])
done
IFS=$icon_save_IFS
done
dnl Newer versions of GNU Make (starting at least 4.1) give preference to the
dnl MOST SPECIALIZED matching pattern when performing pattern-specific variable
dnl assignment. Older versions (at least up to 3.81), however, prefer the LAST
dnl matching pattern. This means that, as long as we support the older version
dnl of GNU Make, we have to declare the most general assignments first. We can
dnl achieve that by sorting the list of assignments:
AS_IF([test -n "$ICON_FCGROUP_ASSIGNMENTS"],
[ICON_FCGROUP_ASSIGNMENTS=`AS_ECHO(["$ICON_FCGROUP_ASSIGNMENTS"]) | sort`])
dnl Optional Packages:
AC_ARG_WITH([external-rte-rrtmgp],
[AS_HELP_STRING([--with-external-rte-rrtmgp],
[use external RTE+RRTMGP library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_rte_rrtmgp=yes])],
[with_external_rte_rrtmgp=no])
AC_ARG_WITH([external-ecrad],
[AS_HELP_STRING([--with-external-ecrad],
[use external ECRAD library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_ecrad=yes])],
[with_external_ecrad=no])
AC_ARG_WITH([external-sct],
[AS_HELP_STRING([--with-external-sct],
[use external SCT library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_sct=yes])],
[with_external_sct=no])
AC_ARG_WITH([external-yaxt],
[AS_HELP_STRING([--with-external-yaxt],
[use external YAXT library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_yaxt=yes])],
[with_external_yaxt=no])
AC_ARG_WITH([external-ppm],
[AS_HELP_STRING([--with-external-ppm],
[use external PPM library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_ppm=yes])],
[with_external_ppm=no])
AC_ARG_WITH([external-cdi],
[AS_HELP_STRING([--with-external-cdi],
[use external CDI library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_cdi=yes])],
[with_external_cdi=no])
AC_ARG_WITH([external-mtime],
[AS_HELP_STRING([--with-external-mtime],
[use external MTIME library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_mtime=yes])],
[with_external_mtime=no])
AC_ARG_WITH([external-yac],
[AS_HELP_STRING([--with-external-yac],
[use external YAC library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_yac=yes])],
[with_external_yac=no])
AC_ARG_WITH([external-tixi],
[AS_HELP_STRING([--with-external-tixi],
[use external TIXI library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_tixi=yes])],
[with_external_tixi=no])
AC_ARG_WITH([external-fortran-support],
[AS_HELP_STRING([--with-external-fortran-support],
[use external FORTRAN-SUPPORT library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_fortran_support=yes])],
[with_external_fortran_support=no])
AC_ARG_WITH([external-comin],
[AS_HELP_STRING([--with-external-comin],
[use external COMIN library @<:@default=no@:>@])],
[AS_IF([test x"$withval" != xno], [with_external_comin=yes])],
[with_external_comin=no])
############################# OPTION CROSS-CHECKS ##############################
AS_IF(
[test "x$enable_hip_overrides" = xyes && test "x$icon_gpu_secondary" != xhip],
[AC_MSG_ERROR([unsupported combination of the configure options: you are dnl
trying to configure with the HIP overrides enabled but the GPU support is dnl
disabled or the secondary GPU compiler is not HIP: either disable the HIP dnl
overrides (--disable-hip-overrides) or enable the GPU support with HIP dnl
(e.g. --enable-gpu=openacc+hip)])])
AS_VAR_IF([enable_jsbach], [no],
[AS_VAR_IF([enable_jsbach_hd], [yes],
[AC_MSG_ERROR([unsupported combination of the configure options: you dnl
are trying to configure with the internal hydrological discharge (HD) scheme dnl
but the land component of ICON is disabled: either disable the internal HD dnl
scheme (--disable-jsbach-hd) or enable the land component (--enable-jsbach)])])
AS_VAR_IF([enable_quincy], [yes],
[AC_MSG_ERROR([unsupported combination of the configure options: you dnl
are trying to configure with the QUINCY biogeochemistry model but the ICON dnl
land component is disabled: either disable the QUINCY model dnl
(--disable-quincy) or enable the ICON land component (--enable-jsbach)])])])
AS_VAR_IF([enable_jsbach_hd], [auto], [enable_jsbach_hd=$enable_jsbach])
AS_VAR_IF([enable_art], [no],
[AS_VAR_IF([enable_art_gpl], [yes],
[AC_MSG_ERROR([unsupported combination of the configure options: you dnl
are trying to configure with the GPL-licensed code parts of the ART dnl
component but the ART component is disabled: either disable the the dnl
GPL-licensed code of the component (--disable-art-gpl) or enable the ART dnl
component (--enable-art)])])])
AS_VAR_IF([enable_cdi_pio], [yes],
[AS_VAR_IF([enable_mpi], [no],
[AC_MSG_ERROR([unsupported combination of the configure options: you dnl
are trying to configure with the parallel features of CDI but MPI dnl
(parallelization) support is disabled: either disable usage of the parallel dnl
features of CDI (--disable-cdi-pio) or enable MPI (parallelization) support dnl
(--enable-mpi)])])
AS_IF(
[test "x$with_external_cdi" = xyes && test "x$with_external_yaxt" = xno],
[AC_MSG_ERROR([unsupported combination of the configure options: you dnl
are trying to configure with the parallel features of an external CDI dnl
library and the bundled YAXT library: either disable usage of the parallel dnl
features of CDI (--disable-cdi-pio) or use the bundled version of CDI dnl
library (--without-external-cdi), or provide the version of YAXT library dnl
(--with-external-yaxt) that the provided CDI library has been built with by dnl
setting FCFLAGS, LDFLAGS and LIBS accordingly])])])
AS_CASE(["$with_external_mtime$icon_mtime_python"],
[yesyes], [AC_MSG_ERROR([unsupported combination of the configure options: dnl
you are trying to configure with the Python interface of the bundled MTIME dnl
library and an external MTIME library: either disable the Python interface dnl
of the bundled MTIME (see --enable-bundled-python) or use the bundled dnl
version of MTIME library (--without-external-mtime)])],
[noauto], [icon_mtime_python=yes],
[*auto], [icon_mtime_python=no])
AS_IF([test "x$enable_coupling" = xyes && test "x$with_external_yac" = xyes],
[AS_VAR_IF([with_external_mtime], [no],
[AC_MSG_ERROR([unsupported combination of the configure options: you dnl
are trying to configure with an external YAC library and the bundled MTIME dnl
library: either disable the coupling (--disable-coupling) or use the bundled dnl
version of YAC library (--without-external-yac), or provide the version of dnl
MTIME library (--with-external-mtime) that the provided YAC library has been dnl
built with by setting FCFLAGS, LDFLAGS and LIBS accordingly])])
AS_VAR_IF([with_external_yaxt], [no],
[AC_MSG_ERROR([unsupported combination of the configure options: you dnl
are trying to configure with an external YAC library and the bundled YAXT dnl
library: either disable the coupling (--disable-coupling) or use the bundled dnl
version of YAC library (--without-external-yac), or provide the version of dnl
YAXT library (--with-external-yaxt) that the provided YAC library has been dnl
built with by setting FCFLAGS, LDFLAGS and LIBS accordingly])])])
AS_CASE(["$enable_coupling$with_external_yac$icon_yac_python"],
[no*yes], [AC_MSG_ERROR([unsupported combination of the configure options: dnl
you are trying to configure with the Python interface of the bundled YAC dnl
library but the coupling is disabled: either disable the Python interface of dnl
the bundled YAC (see --enable-bundled-python) or enable the coupling dnl
(--enable-coupling)])],
[*yesyes], [AC_MSG_ERROR([unsupported combination of the configure dnl
options: you are trying to configure with the Python interface of the dnl
bundled YAC library and an external YAC library: either disable the Python dnl
interface of the bundled YAC (see --enable-bundled-python) or use the dnl
bundled version of YAC library (--without-external-yac)])],
[yesnoauto], [icon_yac_python=yes],
[*auto], [icon_yac_python=no])
AS_CASE(["$enable_comin$with_external_comin$icon_comin_python"],
[no*yes], [AC_MSG_ERROR([unsupported combination of the configure options: dnl
you are trying to configure with the Python interface of the bundled COMIN dnl
library but the ICON community interface (COMIN) is disabled: either disable dnl
the Python interface of the bundled COMIN (see --enable-bundled-python) or dnl
enable the community interface (--enable-comin)])],
[*yesyes], [AC_MSG_ERROR([unsupported combination of the configure dnl
options: you are trying to configure with the Python interface of the dnl
bundled COMIN library and an external COMIN library: either disable the dnl
Python interface of the bundled COMIN (see --enable-bundled-python) or use dnl
the bundled version of COMIN library (--without-external-comin)])],
[yesnoauto], [icon_comin_python=yes],
[*auto], [icon_comin_python=no])
############################# CODEBASE EXTENSIONS ##############################
AS_VAR_IF([enable_jsbach], [yes],
[icon_subdir_srcdir="$srcdir/externals/jsbach"
icon_subdir_unique_file="src/base/mo_jsb_base.f90"
AS_IF([test ! -r "$icon_subdir_srcdir/$icon_subdir_unique_file"],
[AC_MSG_ERROR([unable to find sources of the land component JSBACH dnl
($icon_subdir_unique_file) in '$icon_subdir_srcdir': disable the component dnl
(--disable-jsbach)])])])
AS_VAR_IF([enable_dace], [yes],
[icon_subdir_srcdir="$srcdir/externals/dace_icon"
icon_subdir_unique_file="src_for_icon/mo_fdbk_tables.f90"
AS_IF([test ! -r "$icon_subdir_srcdir/$icon_subdir_unique_file"],
[AC_MSG_ERROR([unable to find sources of the DACE modules for data dnl
assimilation ($icon_subdir_unique_file) in '$icon_subdir_srcdir': disable dnl
the component (--disable-dace)])])])
AS_VAR_IF([enable_emvorado], [yes],
[icon_subdir_srcdir="$srcdir/externals/emvorado"
icon_subdir_unique_file="src_emvorado/radar_organize.f90"
AS_IF([test ! -r "$icon_subdir_srcdir/$icon_subdir_unique_file"],
[AC_MSG_ERROR([unable to find sources of the radar forward operator dnl
EMVORADO ($icon_subdir_unique_file) in '$icon_subdir_srcdir': disable the dnl
operator (--disable-emvorado)])])
AS_VAR_IF([enable_dace], [no],
[AC_MSG_WARN([the radar forward operator EMVORADO is enabled but the dnl
DACE modules for data assimilation are disabled: EMVORADO will not be able dnl
to produce the FEEDBACK (fdbk) files for data assimilation])])])
AS_VAR_IF([enable_art], [yes],
[icon_subdir_srcdir="$srcdir/externals/art"
icon_subdir_unique_file="chem_init/mo_art_chem_init_utils.f90"
AS_IF([test ! -r "$icon_subdir_srcdir/$icon_subdir_unique_file"],
[AC_MSG_ERROR([unable to find sources of the aerosols and reactive dnl
trace component ART ($icon_subdir_unique_file) in '$icon_subdir_srcdir': dnl
disable the component (--disable-art)])])])
############################## ENVIRONMENT CHECKS ##############################
ACX_BUILD_ENVIRONMENT
AC_CANONICAL_HOST
ACX_HOST_FQDN([], [:])
AC_SUBST([host_fqdn], [$acx_cv_host_fqdn])
###################### FORTRAN COMPILER COMMAND AND FLAGS ######################
AC_LANG([Fortran])
dnl Override the default flags set by AC_PROG_FC:
FCFLAGS=${FCFLAGS-}
dnl Save the flags to pass them later to the bundled packages:
subdir_FCFLAGS=$FCFLAGS
dnl Make sure the configure checks are run with ICON_*FLAGS:
AS_VAR_APPEND([LDFLAGS], ["${ICON_LDFLAGS:+ }${ICON_LDFLAGS}"])
dnl We cannot literally append ICON_FCFLAGS to FCFLAGS now because it will be
dnl difficult to replace ICON_FCFLAGS with ICON_OCEAN_FCFLAGS afterwards.
dnl Instead, we make sure that all the checks are run with
dnl '$FCFLAGS $ICON_FCFLAGS':
m4_pushdef([AC_LANG(Fortran)],
m4_bpatsubst(m4_dquote(m4_defn([AC_LANG(Fortran)])),
[FCFLAGS],[FCFLAGS $ICON_FCFLAGS]))dnl
dnl Delay the cross-compilation check:
ACX_COMPILER_CROSS_CHECK_DELAY
AC_PROG_FC
dnl Make sure that the bundled packages pick up the same FC if not set by the
dnl user on the command line:
export FC
dnl We put the following declarations here (i.e. after AC_PROG_FC) for better
dnl readability of the help message:
AC_ARG_VAR([ICON_FCFLAGS],
[Fortran compiler flags to be appended to FCFLAGS when configuring ICON])dnl
AC_ARG_VAR([ICON_LDFLAGS],
[Fortran compiler flags to be appended to LDFLAGS when configuring ICON])dnl
m4_divert_push([HELP_VAR])dnl
AS_HELP_STRING([ICON_<NAME>_FCFLAGS],
[Fortran compiler flags to be appended to FCFLAGS instead of ICON_FCFLAGS when
compiling files of the compile group <NAME> (see --enable-fcgroup-<NAME>)
@<:@default=$ICON_FCFLAGS@:>@], [14])
AS_HELP_STRING([ICON_<NAME>_PATH],
[colon-separated list of paths (relative to the root source directory) to
files and directories included in the compile group <NAME> (see
--enable-fcgroup-<NAME>)], [14])
m4_divert_pop([HELP_VAR])dnl
AC_SUBST([ICON_FCGROUP_FLAGS], [''])dnl
for icon_fcgroup in $icon_fcgroups_unique; do
eval "icon_fcgroup_flags=\${ICON_${icon_fcgroup}_FCFLAGS-\$ICON_FCFLAGS}"
AS_IF([test -n "$ICON_FCGROUP_FLAGS"],
[AS_VAR_APPEND([ICON_FCGROUP_FLAGS], ["
"])])
AS_VAR_APPEND([ICON_FCGROUP_FLAGS],
["ICON_${icon_fcgroup}_FCFLAGS= ${icon_fcgroup_flags}"])
done
AC_ARG_VAR([ICON_BUNDLED_FCFLAGS],
[Fortran compiler flags to be appended to FCFLAGS when configuring the bundled
packages @<:@default=$ICON_FCFLAGS@:>@])dnl
ICON_BUNDLED_FCFLAGS=${ICON_BUNDLED_FCFLAGS-$ICON_FCFLAGS}
ACX_FC_PP_SRCEXT([f90])
ACX_COMPILER_FC_VENDOR_SIMPLE
AC_SUBST([FC_VENDOR], [$acx_cv_fc_compiler_vendor])
AS_VAR_IF([enable_intel_consistency], [auto],
[AS_VAR_IF([FC_VENDOR], [intel],
[AC_MSG_NOTICE([Intel compiler directives enforcing consistency are dnl
enabled because $FC is recognized as the Intel Fortran compiler: disable dnl
the directives if required (--disable-intel-consistency)])
enable_intel_consistency=yes],
[enable_intel_consistency=no])])
AS_IF([test "x$enable_hip_overrides" = xauto],
[AS_IF([test x"$FC_VENDOR$icon_gpu_secondary" = xcrayhip],
[AC_MSG_NOTICE([HIP overrides are enabled because $FC is recognized as dnl
Cray and the secondary GPU compiler is HIP: disable the overrides if dnl
required (--disable-hip-overrides)])
enable_hip_overrides=yes],
[enable_hip_overrides=no])])
AS_VAR_IF([enable_pgi_inlib], [auto],
[AS_VAR_IF([FC_VENDOR], [portland],
[AC_MSG_NOTICE([PGI/NVIDIA cross-file function inlining via an inline dnl
library is enabled because $FC is recognized as the PGI/NVIDIA compiler: dnl
disable the inlining if required (--disable-pgi-inlib)])
enable_pgi_inlib=yes],
[enable_pgi_inlib=no])])
ACX_COMPILER_FC_VERSION_SIMPLE
AC_SUBST([FC_VERSION], [$acx_cv_fc_compiler_version])
dnl Generate RPATH flags:
AS_VAR_IF([enable_rpaths], [yes],
[ACX_SHLIB_FC_RPATH_FLAG
ASX_EXTRACT_ARGS([icon_L_args], ["$LDFLAGS $LIBS"], ['-L@<:@ @:>@*'])
for icon_L_arg in $icon_L_args; do
ASX_VAR_APPEND_UNIQ([LDFLAGS], ["$acx_cv_fc_rpath_flag$icon_L_arg"], [' '])
done
ACX_SHLIB_RPATH_FLAGS_CHECK])
dnl Run the delayed cross-compilation check:
ACX_COMPILER_CROSS_CHECK_NOW
ACX_FC_LINE_LENGTH([unlimited])
ACX_FC_MODULE_IN_FLAG([AC_SUBST([FC_MOD_IN], [$acx_cv_fc_module_in_flag])])
ACX_FC_MODULE_OUT_FLAG([AC_SUBST([FC_MOD_OUT], [$acx_cv_fc_module_out_flag])])
ACX_FC_MODULE_NAMING(
[AC_SUBST([FC_MOD_FILE_UPPER], [$acx_cv_fc_module_naming_upper])
AC_SUBST([FC_MOD_FILE_EXT], [$acx_cv_fc_module_naming_ext])])
ACX_FC_MODULE_SNAMING(
[AC_SUBST([FC_SMOD_FILE_INFIX], [$acx_cv_fc_module_snaming_infix])
AC_SUBST([FC_SMOD_FILE_EXT], [$acx_cv_fc_module_snaming_ext])])
ACX_FC_MODULE_ROOT_SMOD(
[AC_SUBST([FC_ROOT_SMOD], [$acx_cv_fc_module_root_smod])])
AS_VAR_IF([enable_separate_mods], [yes],
[ACX_FC_MODULE_ONLY_FLAG([FC_MOD_ONLY=$acx_cv_fc_module_only_flag])],
[FC_MOD_ONLY=])
AC_SUBST([FC_MOD_ONLY])
ACX_FC_INCLUDE_FLAG(
[AC_SUBST([FC_INC_FLAG], [$acx_cv_fc_ftn_include_flag])])
ACX_FC_INCLUDE_ORDER(
[FC_INC_ORDER=$acx_cv_fc_ftn_include_order],
[FC_INC_ORDER=src,flg])
AC_SUBST([FC_INC_ORDER])
ACX_FC_INCLUDE_FLAG_PP(
[AC_SUBST([FC_INC_FLAG_PP_f90], [$acx_cv_fc_pp_include_flag])])
ACX_FC_INCLUDE_ORDER_PP(
[FC_INC_ORDER_PP_f90=$acx_cv_fc_pp_include_order],
[FC_INC_ORDER_PP_f90=inc,flg])
AC_SUBST([FC_INC_ORDER_PP_f90])
ACX_LANG_MACRO_FLAG([AC_SUBST([FC_PP_DEF], [$acx_cv_fc_macro_flag])])
ACX_FC_ATTRIBUTE_CONTIGUOUS(
[AS_VAR_APPEND([FCFLAGS],
[" ${FC_PP_DEF}HAVE_FC_ATTRIBUTE_CONTIGUOUS"])], [:])
AS_VAR_APPEND([FCFLAGS], [" ${FC_PP_DEF}__ICON__"])
AS_VAR_IF([enable_atmo], [no],
[AS_VAR_APPEND([FCFLAGS], [" ${FC_PP_DEF}__NO_ICON_ATMO__"])])
AS_VAR_IF([enable_les], [no],
[AS_VAR_APPEND([FCFLAGS], [" ${FC_PP_DEF}__NO_ICON_LES__"])])
AS_VAR_IF([enable_upatmo], [no],
[AS_VAR_APPEND([FCFLAGS], [" ${FC_PP_DEF}__NO_ICON_UPATMO__"])])
AS_VAR_IF([enable_ocean], [no],
[AS_VAR_APPEND([FCFLAGS], [" ${FC_PP_DEF}__NO_ICON_OCEAN__"])])
AS_VAR_IF([enable_jsbach], [no],
[AS_VAR_APPEND([FCFLAGS], [" ${FC_PP_DEF}__NO_JSBACH__"])])