forked from abinit/abinit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1225 lines (962 loc) · 33.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
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
# -*- Autoconf -*-
#
# Copyright (C) 2005-2021 ABINIT Group (Yann Pouillon)
#
# This file is part of the ABINIT software package. For license information,
# please see the COPYING file in the top-level directory of the ABINIT source
# distribution.
#
# ---------------------------------------------------------------------------- #
#
# IMPORTANT NOTE
#
# Please DO NOT EDIT this file unless you REALLY know what you are doing.
# Everything is important, in particular the order of the various commands
# executed here. YOU HAVE BEEN WARNED !
#
# ---------------------------------------------------------------------------- #
#
# Autoconf & Automake startup
#
# Enhance help message
m4_divert_text([HELP_END], [
In order to facilitate the configuration of Abinit, you can save the options
you regularly use into a file. For full instructions, please consult the
doc/build/config-template.ac9 file in this directory tree.
A lot more documentation on how to build and run Abinit is available on the
Abinit Wiki. Please consult it at https://wiki.abinit.org/ whenever needed.
Examples of configuration files for clusters are available at
https://github.com/abinit/abiconfig.
])
# Initialize Autoconf
AC_PREREQ(2.59)
AC_INIT([ABINIT],[9.6.2],[https://bugs.launchpad.net/abinit/],[abinit])
AC_REVISION([Autotools support for ABINIT 9])
AC_CONFIG_AUX_DIR([config/gnu])
AC_CONFIG_MACRO_DIR([config/m4])
AC_CONFIG_SRCDIR([src/98_main/abinit.F90])
AC_CONFIG_HEADERS([config.h])
# ---------------------------------------------------------------------------- #
#
# Startup
#
ABI_MSG_SECTION([Basic initialization])
# Initial setup
AC_CANONICAL_TARGET
# Disable pax to initialise Automake because it causes 'make dist' to fail
alias pax='/bin/false'
AM_INIT_AUTOMAKE([1.10 tar-ustar])
unalias pax
# Early Abinit setup - the order is important!
ABI_INIT_DIRS
ABI_INIT_VERSION
ABI_INIT_CPU_INFO
ABI_INIT_OS_INFO
ABI_INIT_HEADER
ABI_INIT_ARCH
# Check for common programs
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_SED
AC_PROG_AWK
AC_PROG_GREP
AC_PATH_PROG(BOURNE_SHELL, sh, /bin/sh)
AC_PATH_PROG(MV, mv, /bin/false)
AC_PATH_PROG(PERL, perl, /bin/false)
AC_PATH_PROG(RM, rm, /bin/false)
AC_CHECK_PROGS(PATCH, [patch gpatch])
AC_CHECK_PROGS(TAR, [tar gtar star])
# Workaround for the "grep -e" issue on Solaris systems
AC_PROG_EGREP
# Workaround for the wrong path to install-sh on Mac systems
ABI_PROG_MKDIR_P
# Look for a command that provide absolute paths
AC_CHECK_PROGS(REALPATH, [realpath readlink], [/bin/true])
test "${REALPATH}" = "readlink" && REALPATH="${REALPATH} -f"
# We might need a Python interpreter early on
ABI_PROG_PYTHON
# Define command-line arguments
ABI_OPTIONS_DEFINE
# Read config file and ensure that priorities are respected
ABI_ENV_BACKUP
ABI_OPTIONS_BACKUP
ABI_LOAD_OPTIONS
ABI_OPTIONS_CFG_TRANSFER
ABI_OPTIONS_RECALL
ABI_ENV_RECALL
# Set still undefined options
ABI_OPTIONS_SETUP
# Initialize environment, taking options into account
ABI_ENV_INIT
AC_SUBST(CC_LDFLAGS)
AC_SUBST(CC_LIBS)
AC_SUBST(CXX_LDFLAGS)
AC_SUBST(CXX_LIBS)
AC_SUBST(FC_LDFLAGS)
AC_SUBST(FC_LIBS)
# Initialize install dirs (requires version and config options to be set)
ABI_INIT_INSTALL_DIRS
# Disable wrapping of Fortran compiler by default
abi_fc_wrap="no"
# Save user-defined CPP
abi_cpp_user="${CPP}"
# Set-up required information for core libraries
ABI_CORELIBS_INIT
# ---------------------------------------------------------------------------- #
#
# Build-system information
#
ABI_MSG_SECTION([Build-system information])
# Display ABINIT version
AC_MSG_NOTICE([ABINIT version ${ABINIT_VERSION}])
AC_MSG_NOTICE([])
# Display Autotools version information
ABI_INFO_AUTOTOOLS
# Display UI changes
ABI_INFO_OPTIONS_CHANGED
# Display changes in feature triggers
ABI_INFO_TRIGGERS_CHANGED
# ---------------------------------------------------------------------------- #
#
# Check option consistency
#
# NOTE: please hack this section with EXTREME CARE
ABI_MSG_SECTION([Option consistency checking])
# --------- #
# Libraries #
# --------- #
abi_optchk_ok="yes"
AC_MSG_NOTICE([checking consistency of command-line options])
# C-CLOCK requires the building of 02_clib
if test "${abi_cclock_enable}" = "yes"; then
if test "${abi_clib_enable}" = "" -o "${abi_clib_enable}" = "no"; then
AC_MSG_NOTICE([|---> enabling CLib (required by CClock, experimental!)])
abi_clib_enable="yes"
abi_optchk_ok="no"
fi
fi
# Only one of MPI I/O and NetCDF I/O can be the default
if test "${abi_netcdf_default_enable}" = "yes" -a \
"${abi_mpi_io_default_enable}" = "yes"; then
AC_MSG_ERROR([MPI I/O and NetCDF are mutually exclusive default I/O modes
These maintainer options should only be used for testing
purposes. Please do not use them unless you really know
what you are doing.])
fi
# Closing remarks
if test "${abi_optchk_ok}" = "yes"; then
AC_MSG_NOTICE([|---> all OK])
fi
AC_MSG_NOTICE([])
# ------------------- #
# Final step: parsing #
# ------------------- #
ABI_OPTIONS_PARSE
AC_MSG_NOTICE([|---> all OK])
# ---------------------------------------------------------------------------- #
#
# Feature triggers startup
#
ABI_MSG_SECTION([Feature triggers and architecture startup])
# Init Steredeg core features
SD_CORE_INIT
# Do we want to use fallbacks? (must be first)
ABI_FALLBACKS_INIT
# ------------------------------------ #
# Prepare MPI support
ABI_MPI_INIT
# Prepare GPU support
# Note: must be done after MPI
ABI_GPU_INIT
# GPU support requires MPI
if test "${abi_gpu_enable}" = "yes" -a "${abi_mpi_enable}" != "yes"; then
AC_MSG_ERROR([GPU support requires MPI])
fi
# ------------------------------------ #
# Init triggers parameters (must be call after we know about fallbacks)
# Note: MPI and GPU must be initialized after feature triggers
ABI_TRIGGERS_INIT
# ---------------------------------------------------------------------------- #
#
# C support
#
ABI_MSG_SECTION([C support])
# Set basic Abinit C parameters
# Note: advanced fetaures are set later on
ABI_PROG_CC
# ---------------------------------------------------------------------------- #
#
# C++ support
#
ABI_MSG_SECTION([C++ support])
# Set basic Abinit C++ parameters
# Note: advanced fetaures are set later on
ABI_PROG_CXX
# ---------------------------------------------------------------------------- #
#
# Fortran support
#
ABI_MSG_SECTION([Fortran support])
# Set basic Abinit Fortran parameters
# Note: advanced fetaures are set later on
ABI_PROG_FC
# Set default file extensions
ABI_FC_EXTENSIONS
# Get module file case
ABI_FC_MOD_CASE
# Determine Fortran-C name mangling scheme
AC_FC_WRAPPERS
# The IBM Fortran compiler crashes if the mpi module is included
# more than once
if test "${abi_fc_vendor}" = "ibm" -a "${abi_mpi_enable}" = "yes"; then
AC_MSG_NOTICE([activating MPI workaround for the IBM Fortran compiler])
AC_DEFINE([HAVE_MPI_INCLUDED_ONCE], 1,
[Define to 1 if you are using XLF.])
fi
# Wrap Fortran compiler calls if needed or requested
# Note: must be the last step of basic Fortran configuration
if test "${abi_fc_wrapper_enable}" = "yes"; then
abi_fc_wrap="yes"
fi
# FIXME: obsolete mechanism
AC_SUBST(fc_mod_fcflags)
# ---------------------------------------------------------------------------- #
#
# Hints
#
ABI_MSG_SECTION([Hints for the build flags])
# Look for a true C preprocessor
if test "${TRUE_CPP}" = ""; then
AC_CHECK_PROGS([TRUE_CPP],[cpp])
fi
if test "${TRUE_CPP}" = ""; then
AC_PATH_PROG([TRUE_CPP],[cpp])
fi
if test "${TRUE_CPP}" = ""; then
if test -x "/lib/cpp"; then
TRUE_CPP="/lib/cpp"
fi
fi
AC_MSG_CHECKING([for a true C preprocessor])
if test "${TRUE_CPP}" = ""; then
AC_MSG_RESULT([none])
else
AC_MSG_RESULT([${TRUE_CPP}])
fi
# Set Fortran preprocessor when needed
if test "${abi_fc_wrap}" = "yes"; then
AC_MSG_CHECKING([for a Fortran-compatible C preprocessor])
if test "${FPP}" = ""; then
if test "${abi_cpp_user}" != ""; then
FPP="${abi_cpp_user}"
else
if test "${TRUE_CPP}" != ""; then
FPP="${TRUE_CPP}"
else
FPP="${CPP}"
fi
fi
fi
AC_MSG_RESULT([${FPP}])
fi
# FIXME: set CPP vendor
case "${target_os}" in
aix*)
abi_cpp_vendor="ibm"
abi_xpp_vendor="ibm"
abi_fpp_vendor="ibm"
;;
*)
abi_cpp_vendor="default"
abi_xpp_vendor="default"
abi_fpp_vendor="default"
;;
esac
case "${abi_fc_vendor}" in
ibm)
abi_fpp_vendor="ibm"
;;
esac
AC_MSG_NOTICE([setting C preprocessor vendor to '${abi_cpp_vendor}'])
AC_MSG_NOTICE([setting C++ preprocessor vendor to '${abi_xpp_vendor}'])
AC_MSG_NOTICE([setting Fortran preprocessor vendor to '${abi_fpp_vendor}'])
# Preset flags to have the source building properly
if test "${abi_hints_enable}" = "yes"; then
# C support
ABI_CPP_HINTS
ABI_CC_HINTS
# C++ support
ABI_XPP_HINTS
ABI_CXX_HINTS
# Fortran support
ABI_FPP_HINTS
ABI_FC_HINTS
# Library archiver support
#ABI_AR_HINTS
fi
# Adjust OpenMP flags if not used
if test "${abi_openmp_enable}" != "yes"; then
FCFLAGS_OPENMP=""
fi
# Set Fortran preprocessing flags
if test "${abi_fc_wrap}" = "yes"; then
test "${FPPFLAGS}" = "" && FPPFLAGS="${FPPFLAGS_HINTS_EXT}"
fi
# Display Fortran preprocessing parameters
AC_MSG_CHECKING([which Fortran preprocessor to use])
if test "${FPP}" = ""; then
AC_MSG_RESULT([none])
else
AC_MSG_RESULT([${FPP}])
fi
AC_MSG_CHECKING([which Fortran preprocessor flags to apply])
if test "${FPPFLAGS}" = ""; then
AC_MSG_RESULT([none])
else
AC_MSG_RESULT([${FPPFLAGS}])
fi
# Display Fortran compiler wrapper status
AC_MSG_CHECKING([whether to wrap Fortran compiler calls])
AC_MSG_RESULT([${abi_fc_wrap}])
# Export true CPPFLAGS (required by LibXC)
AC_SUBST(CPPFLAGS_HINTS_EXT)
# ---------------------------------------------------------------------------- #
#
# Debugging
#
# NOTE:
#
# * Please do not try to set-up the *FLAGS_DEBUG variables manually,
# as they will systematically be overwritten. These flags should be
# modified by the --with-*-dbgflags options only, and --enable-debug
# set to "yes" in this case.
#
ABI_MSG_SECTION([Debugging])
# Init debug flags
ABI_DEBUG_INIT([${abi_debug_flavor}])
# Activate "design-by-contract" debugging tests when paranoid
AC_MSG_CHECKING([whether to activate design-by-contract debugging])
if test "${abi_debug_flavor}" = "paranoid"; then
AC_DEFINE([DEBUG_CONTRACT], 1,
[Define to 1 if you want to activate design-by-contract debugging tests.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(DO_BUILD_32_CONTRACT,
[test "${abi_debug_flavor}" = "paranoid"])
# ---------------------------------------------------------------------------- #
#
# Optimizations
#
# NOTE: The optimizations will be taken from *FLAGS_OPTIM environment
# variables if with_optim_flavor is set to yes, or set to predefined values
# for other optimization profiles.
#
ABI_MSG_SECTION([Optimizations])
# Disable optimizations if debug mode is activated in source files
if test "${abi_debug_source}" = "yes"; then
if test "${abi_optim_flavor}" != "none"; then
AC_MSG_WARN([disabling optimizations])
fi
abi_optim_flavor="none"
fi
# Init optimization flags
# Note: must be done only once debugging is configured
ABI_OPTIM_INIT([${abi_optim_flavor}])
# FIXME: 20_datashare does not support optimizations
if test "${abi_optim_flavor}" != "none"; then
AC_MSG_NOTICE([disabling optimizations for src/20_datashare/])
fcflags_opt_20_datashare="-O0"
AC_MSG_NOTICE([disabling optimizations for src/43_ptgroups/])
fcflags_opt_43_ptgroups="-O0"
fi
# Set per-directory Fortran optimizations
# Note: must be done only once FCFLAGS_OPTIM is set
ABI_OPTFLAGS_DIRS([${FCFLAGS_OPTIM}])
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Save configuration
#
ABI_MSG_SECTION([Build flags])
# Set-up target and binary package names
# Note: requires knowledge of Fortran compiler
ABI_INIT_TARGET
ABINIT_BINARY_PACKAGE="${PACKAGE}-${VERSION}_${ABINIT_TARGET}"
AC_SUBST(ABINIT_BINARY_PACKAGE)
# Preserve environment
ABI_ENV_BACKUP
# Look for archiver
if test "${AR}" = ""; then
AC_CHECK_PROGS(AR,[ar xiar])
fi
# Set archiver command flag
test "${ARFLAGS_CMD}" = "" && ARFLAGS_CMD="rc"
AC_SUBST(ARFLAGS_CMD)
# Look for ranlib
AC_PROG_RANLIB
# Restore back compile flags
CFLAGS="${abi_env_CFLAGS}"
CXXFLAGS="${abi_env_CXXFLAGS}"
FCFLAGS="${abi_env_FCFLAGS}"
# We want to be able access the archiver from anywhere
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
# Report the use of libtool-related options
AC_SUBST(enable_shared)
AC_SUBST(enable_static)
AC_SUBST(with_gnu_ld)
# Final adjustments for library archiver
test "${ARFLAGS}" = "" && \
ARFLAGS="${ARFLAGS_DEBUG} ${ARFLAGS_OPTIM} ${ARFLAGS_HINTS} ${ARFLAGS_EXTRA} ${ARFLAGS_CMD}"
# Final adjustments for C
test "${CFLAGS}" = "" && \
CFLAGS="${CFLAGS_DEBUG} ${CFLAGS_OPTIM} ${CFLAGS_HINTS} ${CFLAGS_EXTRA}"
test "${CC_LDFLAGS}" = "" && \
CC_LDFLAGS="${CC_LDFLAGS_DEBUG} ${CC_LDFLAGS_OPTIM} ${CC_LDFLAGS_HINTS} ${CC_LDFLAGS_EXTRA}"
test "${CC_LIBS}" = "" && \
CC_LIBS="${CC_LIBS_DEBUG} ${CC_LIBS_OPTIM} ${CC_LIBS_HINTS} ${CC_LIBS_EXTRA}"
# Final adjustments for C++
test "${CXXFLAGS}" = "" && \
CXXFLAGS="${CXXFLAGS_DEBUG} ${CXXFLAGS_OPTIM} ${CXXFLAGS_HINTS} ${CXXFLAGS_EXTRA}"
test "${CXX_LDFLAGS}" = "" && \
CXX_LDFLAGS="${CXX_LDFLAGS_DEBUG} ${CXX_LDFLAGS_OPTIM} ${CXX_LDFLAGS_HINTS} ${CXX_LDFLAGS_EXTRA}"
test "${CXX_LIBS}" = "" && \
CXX_LIBS="${CXX_LIBS_DEBUG} ${CXX_LIBS_OPTIM} ${CXX_LIBS_HINTS} ${CXX_LIBS_EXTRA}"
# Final adjustments for Fortran
# Note: FCFLAGS_OPTIM must not be included (per-directory optimizations)
test "${FCFLAGS}" = "" && \
FCFLAGS="${FCFLAGS_DEBUG} ${FCFLAGS_HINTS} ${FCFLAGS_EXTRA} ${FCFLAGS_OPENMP}"
test "${FC_LDFLAGS}" = "" && \
FC_LDFLAGS="${FC_LDFLAGS_DEBUG} ${FC_LDFLAGS_OPTIM} ${FC_LDFLAGS_HINTS} ${FC_LDFLAGS_EXTRA}"
test "${FC_LIBS}" = "" && \
FC_LIBS="${FC_LIBS_DEBUG} ${FC_LIBS_OPTIM} ${FC_LIBS_HINTS} ${FC_LIBS_EXTRA}"
# Final adjustments for preprocessors
test "${CPPFLAGS}" = "" && \
CPPFLAGS="${CPPFLAGS_DEBUG} ${CPPFLAGS_OPTIM} ${CPPFLAGS_HINTS} ${CPPFLAGS_EXTRA}"
test "${XPPFLAGS}" = "" && \
XPPFLAGS="${XPPFLAGS_DEBUG} ${XPPFLAGS_OPTIM} ${XPPFLAGS_HINTS} ${XPPFLAGS_EXTRA}"
test "${FPPFLAGS}" = "" -a "${abi_fc_wrap}" = "no" && \
FPPFLAGS="${FPPFLAGS_DEBUG} ${FPPFLAGS_OPTIM} ${FPPFLAGS_HINTS} ${FPPFLAGS_EXTRA}"
# FIXME: temporary workaround for Macs
if test "${abi_cpu_platform}" = "apple"; then
AC_MSG_WARN([${abi_cpu_platform} is not able to handle full link information])
AC_MSG_WARN([static builds will fail])
else
AC_MSG_NOTICE([static builds may be performed])
FC_LIBS="${FC_LIBS} ${FCLIBS}"
fi
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Advanced language features
#
# Note: these tests have to be performed after the flags have been
# saved.
ABI_MSG_SECTION([Advanced language features])
# Look for desired C features
ABI_CC_FEATURES
# Look for desired Fortran features
ABI_FC_FEATURES
# Look for desired Python features
ABI_PY_FEATURES
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Platform-specific libraries
#
# Note: these tests have to be performed after the flags have been
# saved.
ABI_MSG_SECTION([Platform-specific libraries])
AC_MSG_CHECKING([which operating system we have])
AC_MSG_RESULT([${target_os}])
# Basic mathematical functions
AC_LANG_PUSH([C])
AC_SEARCH_LIBS([expl], [m ml],
[abi_math_expl_ok="yes"], [abi_math_expl_ok="no"])
AC_SEARCH_LIBS([logl], [m ml],
[abi_math_logl_ok="yes"], [abi_math_logl_ok="no"])
AC_LANG_POP([C])
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Multicore architecture support
# Note: the following settings will be used by the connectors.
ABI_MSG_SECTION([Multicore architecture support])
# OpenMP support
AC_MSG_CHECKING([whether to enable OpenMP support])
AC_MSG_RESULT([${abi_openmp_enable}])
if test "${abi_openmp_enable}" = "yes"; then
AC_MSG_CHECKING([Fortran flags for OpenMP])
AC_MSG_RESULT([${FCFLAGS_OPENMP}])
ABI_OMP_CHECK_COLLAPSE
AC_MSG_NOTICE([OpenMP support is enabled in Fortran source code only])
fi
# MPI support
ABI_MPI_DETECT
if test "${abi_mpi_enable}" = "yes"; then
ABI_MPI_DUMP
fi
# GPU support
ABI_GPU_DETECT
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Optional features - Initialization
#
ABI_MSG_SECTION([Initialization of optional features])
# Init HDF5
#SD_HDF5_INIT([optional fail no-fortran])
#SD_HDF5_INIT([optional warn no-fortran])
SD_HDF5_INIT([required no-fortran warn])
# Init FFTW3
SD_FFTW3_INIT([optional skip])
# Init Levmar
SD_LEVMAR_INIT([optional fail])
# Init LibPSML
#SD_LIBPSML_INIT([optional fail])
SD_LIBPSML_INIT([optional warn])
# Init LibXC
#SD_LIBXC_INIT([no-fortran optional fail])
SD_LIBXC_INIT([required no-fortran warn])
# Init NetCDF
#SD_NETCDF_INIT([optional fail])
SD_NETCDF_INIT([required warn])
# Init NetCDF-Fortran
#SD_NETCDF_FORTRAN_INIT([optional fail])
SD_NETCDF_FORTRAN_INIT([required warn])
# Init PAPI
SD_PAPI_INIT([optional fail])
# Init PFFT
SD_PFFT_INIT([optional skip])
# Init TRIQS
SD_TRIQS_INIT([optional fail])
# Init Wannier90
#SD_WANNIER90_INIT([optional fail], [-lwannier90])
SD_WANNIER90_INIT([optional warn], [-lwannier90])
# Init XMLF90
#SD_XMLF90_INIT([optional fail])
SD_XMLF90_INIT([optional warn])
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Linear algebra support
#
ABI_MSG_SECTION([Linear algebra support])
#SD_LINALG_INIT([required fail])
SD_LINALG_INIT([required warn])
SD_LINALG_INIT_FLAVOR
SD_LINALG_DETECT
# the minimum needed to declare linalg working...
sd_linalg_ok="no"
test "${sd_linalg_has_blas}" = "yes" -a "${sd_linalg_has_lapack}" = "yes" && sd_linalg_ok="yes"
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Optimized FFT support (must be done after linear algebra is fully configured)
#
ABI_MSG_SECTION([Optimized FFT support])
if test "${sd_linalg_enable}" = "yes"; then
SD_FFT_INIT
SD_FFT_DETECT
else
echo "Skip FFT setting : linalg not enabled..."
fi
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Profiling and performance analysis
#
#ABI_MSG_SECTION([Profiling and performance analysis])
# ---------------------------------------------------------------------------- #
#
# Feature triggers (optional features)
#
ABI_MSG_SECTION([Feature triggers])
# VERY IMPORTANT: THE ORDER IS CRITICAL - DO NOT CHANGE IT!
# Note: some of the following packages are mandatory to run Abinit with
# full capabilities, although internal implementations may provide
# limited functionality in some cases
# ------------------------------ #
# PAPI library support
SD_PAPI_DETECT
AC_MSG_CHECKING([whether to enable the internal Abinit timer])
AC_MSG_RESULT([${abi_timer_enable}])
if test "${sd_papi_ok}" != "yes"; then
if test "${abi_timer_enable}" = "yes"; then
AC_DEFINE([HAVE_TIMER_ABINIT], 1,
[Define to 1 if you want to use the Abinit timer.])
fi
fi
# ------------------------------ #
# HDF5 library support
SD_HDF5_DETECT
AC_MSG_NOTICE([])
AC_MSG_NOTICE([dumping HDF5 parameters for diagnostics])
AC_MSG_NOTICE([---------------------------------------])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ * sd_hdf5_enable = ${sd_hdf5_enable}])
AC_MSG_NOTICE([ * sd_hdf5_status = ${sd_hdf5_status}])
AC_MSG_NOTICE([ * sd_hdf5_h5cc = ${sd_hdf5_h5cc}])
AC_MSG_NOTICE([ * sd_hdf5_has_mpi = ${sd_hdf5_has_mpi}])
AC_MSG_NOTICE([])
## Parallel NetCDF requires a few conditions to work
# TODO abi_netcdf_mpi_enable not defined
#if test "${abi_netcdf_mpi_enable}" = "yes"; then
# if test "${sd_mpi_ok}" != "yes"; then
# AC_MSG_ERROR([parallel NetCDF requested but MPI is not available])
# fi
# if test "${abi_mpi_io_enable}" != "yes"; then
# AC_MSG_ERROR([parallel NetCDF requested but MPI I/O is disabled])
# fi
# if test "${sd_hdf5_mpi_ok}" != "yes"; then
# AC_MSG_ERROR([parallel NetCDF requested but parallel HDF5 is not available])
# fi
#fi
# NetCDF library support (must be done after HDF5)
SD_NETCDF_DETECT
AC_MSG_NOTICE([])
AC_MSG_NOTICE([dumping NetCDF parameters for diagnostics])
AC_MSG_NOTICE([-----------------------------------------])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ * sd_netcdf_ok = ${sd_netcdf_ok}])
AC_MSG_NOTICE([ * sd_netcdf_mpi_ok = ${sd_netcdf_mpi_ok}])
AC_MSG_NOTICE([ * sd_netcdf_enable = ${sd_netcdf_enable}])
AC_MSG_NOTICE([ * sd_netcdf_prefix = ${sd_netcdf_prefix}])
AC_MSG_NOTICE([])
# NetCDF library support (must be done after HDF5)
SD_NETCDF_FORTRAN_DETECT
AC_MSG_NOTICE([])
AC_MSG_NOTICE([dumping NetCDFF parameters for diagnostics])
AC_MSG_NOTICE([------------------------------------------])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ * sd_netcdf_fortran_ok = ${sd_netcdf_fortran_ok}])
AC_MSG_NOTICE([ * sd_netcdf_fortran_mpi_ok = ${sd_netcdf_fortran_mpi_ok}])
AC_MSG_NOTICE([ * sd_netcdf_fortran_enable = ${sd_netcdf_fortran_enable}])
AC_MSG_NOTICE([ * sd_netcdf_fortran_prefix = ${sd_netcdf_fortran_prefix}])
AC_MSG_NOTICE([])
# XMLF90 library support
SD_XMLF90_DETECT
# LibPSML library support
if test "${sd_xmlf90_ok}" = "yes"; then
SD_LIBPSML_DETECT
else
if test "${sd_libpsml_enable}" = "auto"; then
sd_libpsml_enable="no"
else
if test "${sd_libpsml_enable}" != "no"; then
#AC_MSG_ERROR([LibPSML support has been requested but XMLF90 does not work
AC_MSG_WARN([LibPSML support has been requested but XMLF90 does not work
Please point the configuration to a working XMLF90
installation or disable LibPSML support])
fi
fi
fi
AM_CONDITIONAL([DO_BUILD_PSML],
[test "${sd_libpsml_enable}" = "yes " -a "${sd_libpsml_ok}" = "yes"])
# ------------------------------ #
# Levmar library support
SD_LEVMAR_DETECT
# ------------------------------ #
# LibXC library support
#ABI_LIBXC_DETECT(2, 2)
SD_LIBXC_DETECT
AM_CONDITIONAL([DO_BUILD_01_LIBXC_EXT],
[test "${sd_libxc_ok}" = "yes"])
# TRIQS support
SD_TRIQS_DETECT
AM_CONDITIONAL([DO_BUILD_67_TRIQS_EXT],
[test "${sd_triqs_enable}" = "yes" -a "${sd_triqs_ok}" = "yes"])
# Wannier90 library support
SD_WANNIER90_DETECT
# AtomPAW integration support
ABI_CHECK_ATOMPAW_BINS
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Build workflow
#
ABI_MSG_SECTION([Build workflow])
# Initialize the low-level routines of ABINIT as an external component
SD_ABINIT_COMMON_INIT([optional skip])
SD_ABINIT_COMMON_DETECT
# Initialize the LibPAW routines as an external component
SD_LIBPAW_INIT([optional skip])
SD_LIBPAW_DETECT
# ------------------------------ #
# Init BigDFT (requires knowledge about ABINIT Common and LibPAW)
if test "${sd_libxc_enable}" = "yes" -a "${sd_linalg_enable}" = "yes"; then
#SD_BIGDFT_INIT([optional fail])
SD_BIGDFT_INIT([optional warn])
# BigDFT library support (requires linear algebra and LibXC)
SD_BIGDFT_DETECT
else
echo "Skip BIGDFT setting : libxc not enabled..."
fi
# ------------------------------ #
AC_MSG_CHECKING([how to build the components of ABINIT])
abi_build_steps=""
if test "${sd_abinit_common_ok}" = "yes"; then
test "${abi_build_steps}" = "" || abi_build_steps="${abi_build_steps}+"
abi_build_steps="${abi_build_steps}common"
fi
if test "${sd_libpaw_ok}" = "yes"; then
test "${abi_build_steps}" = "" || abi_build_steps="${abi_build_steps}+"
abi_build_steps="${abi_build_steps}libpaw"
fi
if test "${sd_bigdft_ok}" = "yes"; then
test "${abi_build_steps}" = "" || abi_build_steps="${abi_build_steps}+"
abi_build_steps="${abi_build_steps}bigdft"
fi
if test "${abi_build_steps}" = ""; then
abi_build_steps="monolith"
else
abi_build_steps="${abi_build_steps}+core"
fi
AC_MSG_RESULT([${abi_build_steps}])
# Allow the separate build of ABINIT Common
AM_CONDITIONAL([DO_BUILD_SHARED_COMMON],
[test "{sd_abinit_common_ok}" != "yes"])
# Allow the separate build of LibPAW
AM_CONDITIONAL([DO_BUILD_SHARED_LIBPAW],
[test "{sd_libpaw_ok}" != "yes"])
# FIXME: Let LibPAW know it is embedded in ABINIT
AC_DEFINE([HAVE_LIBPAW_ABINIT], 1,
[Must be defined to 1 to have LibPAW properly working.])
# Warn the user if support for wavelets is ill-configured
if test "${abi_build_steps}" = "monolith" -a "${abi_bigdft_enable}" = "yes"; then
AC_MSG_WARN([BigDFT will soon require the separate installation of ABINIT Common and LibPAW])
fi
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
#
# Final check of feature triggers
#
ABI_MSG_SECTION([Feature triggers summary])
# Display summary table
ABI_TRIGGERS_SUMMARY
#------------------------ START JMB --------------------------------------#
# Check status of mandatory fallbacks
status=""
mandatory=""
# Check linalg
if test "${sd_linalg_flavor_req}" != "auto"; then
if test "${sd_linalg_flavor}" != "${sd_linalg_flavor_req}"; then
ABI_MSG_NOTICE_L([linalg-flavor],[__INFO__ : the linalg flavor is not the one requested!])
fi
fi
if test "${sd_linalg_enable}" != "yes"; then
ABI_MSG_NOTICE_L([linalg-mandatory],[__CAUTION__ : linalg is __MANDATORY__ !])
mandatory="#"
fi
# Check HDF5 serial
if test "${sd_hdf5_enable}" = "no"; then
ABI_MSG_NOTICE_L([hdf5-mandatory],[__CAUTION__ : HDF5 is __MANDATORY__ !])
mandatory="#"
else
if test "${sd_hdf5_ok}" != "yes";then
ABI_MSG_NOTICE_L([hdf5-nw],[__WARNING__ : HDF5 is not __WORKING__ !])
status="#"
fi
fi
if test "${sd_hdf5_ok}" = "yes";then
# Check NetCDF
if test "${sd_netcdf_enable}" = "no"; then
ABI_MSG_NOTICE_L([netcdf-mandatory],[__CAUTION__ : NetCDF is __MANDATORY__ !])
mandatory="#"
else
if test "${sd_netcdf_ok}" != "yes";then
ABI_MSG_NOTICE_L([netcdf-nw],[__WARNING__ : NetCDF is not __WORKING__ !])
status="#"
fi
fi
# Check NetCDF_fortran
if test "${sd_netcdf_fortran_enable}" = "no"; then