forked from bsc-pm/mcxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
2478 lines (2118 loc) · 78 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
dnl Package definition: name, version, mail
AC_INIT([mcxx],[2.3.0],[[email protected]])
configure_orig_arguments="$@"
dnl Where are we ?
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl A rather recent version
AC_PREREQ(2.61)
AC_CONFIG_MACRO_DIR([m4])
dnl Initialization of Automake
dnl We require at least 1.9 (next will be 1.11)
AM_INIT_AUTOMAKE([1.9 dist-bzip2 -Wno-portability subdir-objects foreign])
dnl Enable silent rules if available
supported_silent_rules=1
m4_ifdef([AM_SILENT_RULES],
[AM_SILENT_RULES([yes])],
[supported_silent_rules=0])
AM_CONDITIONAL([SUPPORTED_SILENT_RULES], test x$supported_silent_rules = x1)
dnl Simple check of code existence
AC_CONFIG_SRCDIR(src/frontend/cxx03.y.in)
dnl Config header
AC_CONFIG_HEADERS([config.h])
dnl Checks in C
AC_LANG([C])
dnl Check install
AC_PROG_INSTALL
AC_CHECK_PROG([GCC], [gcc], [gcc])
AC_CHECK_PROG([GXX], [g++], [g++])
AC_CHECK_PROG([GFORTRAN], [gfortran], [gfortran])
# GCC / GXX environment variables may be overwritten by AC_PROG_CC /
# AC_PROG_CXX (respectively). For this reason we save their values at this point!
GCC_BE=$GCC
GXX_BE=$GXX
GCC=
GXX=
AC_PROG_CC
AM_PROG_CC_C_O
dnl Check libtool
LT_INIT([disable-static,win32-dll])
dnl Which library we need to use to dlopen
LT_LIB_DLLOAD
dnl Check cpp
AC_PROG_CPP
dnl Check c++
AC_PROG_CXX
dnl Check for sed
AC_PROG_SED
dnl Check LN_S
AC_PROG_LN_S
dnl Check fortran compiler
AC_PROG_FC
dnl C++11 -std=c++11
AX_CXX_COMPILE_STDCXX_11([noext],[optional])
dnl Check GNU Bash.
AC_PATH_PROG([BASH], [bash], [])
# Prioritize Python 3.x
if test -n "$PYTHON"; then
# When PYTHON is not empty, AM_PATH_PYTHON always fails with a hard error
# if the Python is too old so we first check if will fail or not.
AM_PYTHON_CHECK_VERSION([$PYTHON], [3.0],
[AM_PATH_PYTHON([3.0])],
[AM_PATH_PYTHON([2.7])])
else
AM_PATH_PYTHON([3.0],, [:])
dnl Fallback to 2.7
if test "$PYTHON" = ":"; then
# The earlier result is cached which would make the next check a no-op
unset PYTHON
unset ac_cv_path_PYTHON
unset am_cv_pathless_PYTHON
AM_PATH_PYTHON([2.7])
fi
fi
if test x$BASH = x; then
# If GNU Bash isn't available, use the current shell and hope for
# the best.
AC_MSG_WARN([GNU Bash not found, falling back to $SHELL])
BASH="$SHELL"
fi
dnl --------------------- Basic toolchain setup -----------------
if test x$FC = x; then
AC_MSG_ERROR([Fortran compiler not found])
fi
CC_FOR_BUILD=$CC
dnl If we are cross compiling ensure that we are using
dnl the proper build cc
if test x$cross_compiling = xyes;
then
dnl This will only work with gcc
CC_FOR_BUILD=gcc
fi
AC_SUBST([CC_FOR_BUILD])
dnl --------------------- End Basic toolchain setup -----------------
dnl --------------------- Check we are not using too old gcc compilers ----
AC_MSG_CHECKING([whether gcc is new enough])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[
#ifdef __GNUC__
#if __GNUC__ <= 3
#error "Too old compiler"
#endif
#if __GNUC__ == 4
#if __GNUC_MINOR__ <= 0
#error "Too old compiler"
#endif
#endif
#endif
]])],
[AC_MSG_RESULT([ok])],
[AC_MSG_ERROR([too old compiler, gcc 4.1 or upper is requested])]
)
dnl --------------------- end check of old gcc ---
INSTALL_CONFIG_FILES="00.config.plain"
# Our configuration file with utilities is always installed although it doesn't
# generate any binary
INSTALL_CONFIG_FILES="${INSTALL_CONFIG_FILES} 02.config.utilities"
# Note that these profiles are just for testing, no soft link is created for them
INSTALL_CONFIG_FILES="${INSTALL_CONFIG_FILES} 10.config.hlt"
# CUDA auxiliary profile should be always installed
INSTALL_CONFIG_FILES="${INSTALL_CONFIG_FILES} 40.config.cuda"
# plaincxx is always installed as a binary
COMPILER_NAMES="plaincc plainfc plainf95"
SCRIPT_COMPILER_NAMES=""
dnl ----- SQLITE - Required only for fortran ---
PKG_PROG_PKG_CONFIG
if test -z "$PKG_CONFIG";
then
AC_MSG_ERROR([Could not find pkg-config.
* You may not have pkg-config installed
- In Ubuntu/Debian: apt-get install pkg-config
- In RHEL/Fedora: yum install pkgconfig
- In SuSE: zypper install pkg-config
- Install from sources at http://www.freedesktop.org/wiki/Software/pkg-config/
* If it is installed but not in the PATH then you may want to set the PKG_CONFIG variable])
fi
PKG_CHECK_MODULES([sqlite3], [sqlite3 >= 3.6.16],
[],
AC_MSG_ERROR([Fortran support requires development files of sqlite3.
* In Ubuntu/Debian: apt-get install libsqlite3-dev
* In RHEL/Fedora: yum install sqlite-devel
* In SuSE: zypper install sqlite3-devel
* Install from sources at http://www.sqlite.org:
- Use sqlite-autoconf-xxx.tar.gz
- Make sure PKG_CONFIG_PATH points to <sqlite3-install-dir>/lib/pkgconfig])
)
AC_SUBST([sqlite3_CFLAGS])
AC_SUBST([sqlite3_LIBS])
dnl ----- End Sqlite ---------------------------
dnl --- Suport for Extrae --------------
extrae_support="no"
AC_MSG_CHECKING([if Extrae support has been enabled])
AC_ARG_ENABLE([extrae],
AS_HELP_STRING([--enable-extrae], [Enables Extrae instrumentation of Mercurium itself]),
[
if test x$enableval = xyes -o x$enableval = x;
then
extrae_support="yes"
AC_DEFINE([EXTRAE_ENABLED], 1, [Define to enable instrumentation of Mercurium using Extrae])
AC_MSG_RESULT([yes])
else if test x$enableval = xno;
then
extrae_support="no"
AC_MSG_RESULT([no])
else
AC_MSG_ERROR([This option can only be given 'yes' or 'no' values])
fi
fi
],
[
AC_MSG_RESULT([no])
]
)
extrae_lib=""
extrae_include=""
if test x$extrae_support = xyes;
then
AC_ARG_WITH([extrae],
AS_HELP_STRING([--with-extrae=dir], [Directory of Extrae installation]),
[
extrae_include="${withval}/include"
extrae_lib="${withval}/lib"
]
)
AC_ARG_WITH([extrae-include],
AS_HELP_STRING([--with-extrae-include=dir], [Directory of Extrae headers]),
[
extrae_include="${withval}"
]
)
AC_ARG_WITH([extrae-lib],
AS_HELP_STRING([--with-extrae-lib=dir], [Directory of Extrae libraries]),
[
extrae_lib="${withval}"
]
)
fi
EXTRAE_LIB=$extrae_lib
EXTRAE_INCLUDE=$extrae_include
AC_SUBST([EXTRAE_LIB])
AC_SUBST([EXTRAE_INCLUDE])
AM_CONDITIONAL([EXTRAE_ENABLED], test x$extrae_support = xyes)
dnl --- End of support for Extrae ------------
dnl --- Support for Transparent Checkpoint Library ------------
tcl_support="no"
TCL_GATE=":false:"
AC_ARG_WITH([tcl],
AS_HELP_STRING([--with-tcl=dir], [Directory of TCL installation]),
[
tcl_support="yes"
TCL_GATE=":true:"
tcl_include="${withval}/include"
tcl_lib="${withval}/lib"
]
)
AC_ARG_WITH([tcl-include],
AS_HELP_STRING([--with-tcl-include=dir], [Directory of TCL headers]),
[
tcl_support="yes"
TCL_GATE=":true:"
tcl_include="${withval}"
]
)
AC_ARG_WITH([tcl-lib],
AS_HELP_STRING([--with-tcl-lib=dir], [Directory of TCL libraries]),
[
tcl_support="yes"
TCL_GATE=":true:"
tcl_lib="${withval}"
]
)
AM_CONDITIONAL([BUILD_TCL], test x$tcl_support = xyes)
AC_SUBST([TCL_GATE])
AC_SUBST([TCL_INCLUDES], ["${tcl_include}"])
AC_SUBST([TCL_LIB], ["${tcl_lib}"])
dnl --- End support for Transparent Checkpoint Library ------------
dnl -- Fortran tests ---
fortran_tests_enabled="yes"
AC_MSG_CHECKING([if Fortran tests have been disabled])
AC_ARG_ENABLE([fortran-tests],
AS_HELP_STRING([--disable-fortran-tests], [Disables all Fortran tests]),
[
if test x$enableval = xyes -o x$enableval = x;
then
fortran_tests_enabled="yes"
dnl no, they have not been disabled
AC_MSG_RESULT([no])
else if test x$enableval = xno;
then
fortran_tests_enabled="no"
dnl yes, they DO have been disabled
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([This option can only be given 'yes' or 'no' values])
fi
fi
],
[
AC_MSG_RESULT([no])
]
)
FORTRAN_TESTS_ENABLED=$fortran_tests_enabled
AC_SUBST([FORTRAN_TESTS_ENABLED])
dnl -- End Fortran tests ---
dnl -- Use GNU Fortran compiler >= 8 array descriptors
AC_MSG_CHECKING([whether the GNU Fortran compiler >= 8 array descriptors are explicitly enabled])
AC_ARG_ENABLE([gfortran-8-or-greater-array-descriptors],
AS_HELP_STRING([--enable-gfortran-8-or-greater-array-descriptors], [Enable GNU Fortran compiler > 8 array descriptors (disabled by default)]),
[ ], # enable_gfortran_8_or_greater_array_descriptors=$enableval
[ enable_gfortran_8_or_greater_array_descriptors="no" ])
AC_MSG_RESULT([$enable_gfortran_8_or_greater_array_descriptors])
if test x"$enable_gfortran_8_or_greater_array_descriptors" = x"yes";
then
GFORTRAN_8_OR_GREATER_ARRAY_DESCRIPTORS="--fortran-array-descriptor=gfortran-8-or-greater"
fi
AC_SUBST([GFORTRAN_8_OR_GREATER_ARRAY_DESCRIPTORS])
dnl --------------- Extra Compilers ---------------------
dnl --------------- IBM Compilers ---------------------
AC_MSG_CHECKING([whether support for IBM XL Fortran/C/C++ compilers is enabled])
AC_ARG_ENABLE([ibm-compilers],
AS_HELP_STRING([--disable-ibm-compilers], [Disables support for IBM XL Fortran/C/C++ compilers (enabled by default)]),
[ ], # enable_ibm_compilers=$enableval
[ enable_ibm_compilers="yes"])
AC_MSG_RESULT([$enable_ibm_compilers])
XLF=
XLC=
XLCXX=
if test x"$enable_ibm_compilers" = x"yes";
then
AC_PATH_TARGET_TOOL([XLF], [xlf95], [$XLF])
AC_PATH_TARGET_TOOL([XLC], [xlc], [$XLC])
AC_PATH_TARGET_TOOL([XLCXX], [xlC], [$XLCXX])
fi
dnl --------------- END IBM Compilers ---------------------
dnl --------------- Intel Compilers ---------------------
AC_MSG_CHECKING([whether support for Intel Fortran/C/C++ compilers is enabled])
AC_ARG_ENABLE([intel-compilers],
AS_HELP_STRING([--disable-intel-compilers], [Disables support for Intel Fortran/C/C++ compilers (enabled by default)]),
[ ], # enable_intel_compilers=$enableval
[ enable_intel_compilers="yes"])
AC_MSG_RESULT([$enable_intel_compilers])
IFORT=
ICC=
ICPC=
if test x"$enable_intel_compilers" = x"yes";
then
AC_CHECK_PROG([IFORT], [ifort], [ifort])
AC_CHECK_PROG([ICC], [icc], [icc])
AC_CHECK_PROG([ICPC], [icpc], [icpc])
fi
dnl --------------- END Intel Compilers ---------------------
mic_compilation="no"
mic_testing="no"
mic_testing_device="no"
if test x"$ICC" != x;
then
AC_MSG_CHECKING([if support for Intel Xeon Phi was enabled])
AC_ARG_ENABLE([mic],
AS_HELP_STRING([--enable-mic], [Enables support for Intel Xeon Phi]),
[
if test x"$enableval" = x"yes" -o x"$enableval" = x"";
then
mic_compilation="yes"
AC_MSG_RESULT([yes])
else if test x"$enableval" = x"no";
then
AC_MSG_RESULT([no])
mic_compilation="no"
else
AC_MSG_ERROR([This option can only be given 'yes' or 'no' values])
fi
fi
],
[AC_MSG_RESULT([no])]
)
AC_MSG_CHECKING([if testing for Intel Xeon Phi was enabled])
AC_ARG_ENABLE([mic-testing],
AS_HELP_STRING([--enable-mic-testing=mic_dev], [Sets 'mic_dev' as the remote host used for Intel Xeon Phi testing]),
[
if test x$enableval != x;
then
AC_MSG_RESULT([yes])
mic_testing_device="$enableval"
mic_testing="yes"
else
AC_MSG_RESULT([--enable-mic-testing requires the name of a remote host])
fi
],
[AC_MSG_RESULT([no])]
)
fi
dnl --------------- Cray Compilers ---------------------
AC_MSG_CHECKING([whether support for Cray Fortran/C/C++ compilers is enabled])
AC_ARG_ENABLE([cray-compilers],
AS_HELP_STRING([--disable-cray-compilers], [Disables support for Cray Fortran/C/C++ compilers (enabled by default)]),
[ ], # enable_cray_compilers=$enableval
[ enable_cray_compilers="yes"])
AC_MSG_RESULT([$enable_cray_compilers])
CRAYFC=
CRAYCC=
CRAYCXX=
if test x"$enable_cray_compilers" = x"yes";
then
AC_CHECK_PROG([CRAYFC], [ftn], [ftn])
# If the Cray Fortran compiler (i.e. 'ftn' binary) is present in the $PATH, we
# will look for 'cc' and 'CC' binaries. We do not directly check for them because
# there are other vendors that also define the 'cc' binary
if test x"$CRAYFC" != x;
then
AC_CHECK_PROG([CRAYCC], [cc], [cc])
AC_CHECK_PROG([CRAYCXX], [CC], [CC])
fi
fi
dnl --------------- END Cray Compilers ---------------------
dnl ----------------- PGI Compilers ------------------------
AC_MSG_CHECKING([whether support for PGI Fortran/C/C++ compilers is enabled])
AC_ARG_ENABLE([pgi-compilers],
AS_HELP_STRING([--disable-pgi-compilers], [Disables support for PGI Fortran/C/C++ compilers (enabled by default)]),
[ ], # enable_pgi_compilers=$enableval
[ enable_pgi_compilers="yes"])
AC_MSG_RESULT([$enable_pgi_compilers])
PGIFC=
PGICC=
PGICXX=
if test x"$enable_pgi_compilers" = x"yes";
then
AC_CHECK_PROG([PGIFC], [pgf90], [pgf90])
AC_CHECK_PROG([PGICC], [pgcc], [pgcc])
AC_CHECK_PROG([PGICXX],[pgc++],[pgc++])
fi
# Check the case it isn't in the PATH, or we don't want to load the module (e.g. CTE-P9)
if test x"$PGICXX" = x"" -o x"$PGICC" = x"" -o x"$PGIFC" = x"";
then
AC_ARG_WITH([pgi-installation],
AS_HELP_STRING([--with-pgi-installation=prefix], [specify the installation prefix of PGI compilers]),
[ ac_cv_use_pgi_prefix=$withval ],
[ ac_cv_use_pgi_prefix="" ]
)
if test x"$ac_cv_use_pgi_prefix" != x"";
then
AC_PATH_PROG([PGIFC], [pgf90], [], [ ${ac_cv_use_pgi_prefix}/bin ])
AC_PATH_PROG([PGICC], [pgcc], [], [ ${ac_cv_use_pgi_prefix}/bin ])
AC_PATH_PROG([PGICXX], [pgc++], [], [ ${ac_cv_use_pgi_prefix}/bin ])
# Checking return value of just 1 of them is enough
if test x"$PGICXX" != x"";
then
enable_pgi_compilers=yes
fi
else
enable_pgi_compilers=no
fi
fi
if test x"$enable_pgi_compilers" = x"yes";
then
# Detect version to check the float128 support, as this will determine
# if there is need to pass --disable-float128-token in the config file:
# match "XX.YY", e.g. 19.10, 20.7 etc. using grep regex match
# (extra [] because m4 neutralizes it)
pgi_VERSION=`${PGICXX} --version | grep -Eo ['[0-9]+[.][0-9]+']`
case $pgi_VERSION in
19.*|20.*)
pgi_float128_support=no
;;
21.*)
pgi_float128_support=yes
;;
*)
AC_MSG_WARN([The detected PGI version is not tested])
pgi_float128_support=no
;;
esac
if test x"$pgi_float128_support" = x"no";
then
PGI_FLOAT128_OPTION="--disable-float128-token"
fi
fi
AC_SUBST([PGI_FLOAT128_OPTION])
dnl ----------------- END PGI Compilers ------------------------
dnl --------------------- Support for plain profiles for Intel Compilers -------------
if test x"$ICC" != x -o x"$ICPC" != x -o x"$IFORT" != x;
then
INSTALL_CONFIG_FILES="${INSTALL_CONFIG_FILES} 01.config.intel-plain"
# Intel C/C++/Fortran
if test x"$ICC" != x;
then
COMPILER_NAMES="${COMPILER_NAMES} plainicc"
fi
if test x"$ICPC" != x;
then
COMPILER_NAMES="${COMPILER_NAMES} plainicpc"
fi
if test -x"$IFORT" != x;
then
COMPILER_NAMES="${COMPILER_NAMES} plainifort ifort-plainfc"
fi
fi
dnl --------------------- End support for plain profiles for Intel Compilers ---------
dnl -- End of extra compiler checks ---
dnl --------------------- Support for OmpSs ------------------------------------------
is_enabled_ompss="no"
AC_MSG_CHECKING([if enabled OmpSs support in the compiler for Nanos++])
AC_ARG_ENABLE([ompss],
AS_HELP_STRING([--enable-ompss], [Enables support of OmpSs Programming Model using Nanos++ (default is disabled)]),
[
if test x$enableval = xyes -o x$enableval = x;
then
is_enabled_ompss="yes"
AC_MSG_RESULT([yes])
else if test x$enableval = xno;
then
is_enabled_ompss="no"
AC_MSG_RESULT([no])
else
AC_MSG_ERROR([This option can only be given 'yes' or 'no' values])
fi
fi
],
[
AC_MSG_RESULT([no])
]
)
dnl --------------------- End of Support for OmpSs ------------------------------------------
dnl --------------------- Support for OpenMP --------------------------------------
is_enabled_openmp="no"
AC_MSG_CHECKING([if enabled OpenMP support in the compiler for Nanos++])
AC_ARG_ENABLE([openmp],
AS_HELP_STRING([--enable-openmp], [Enables support of OpenMP using Nanos++ (default is disabled, unless OmpSs is enabled)]),
[
if test x$enableval = xyes -o x$enableval = x;
then
is_enabled_openmp="yes"
AC_MSG_RESULT([yes])
else if test x$enableval = xno;
then
AC_MSG_RESULT([no])
is_enabled_openmp="no"
else
AC_MSG_ERROR([This option can only be given 'yes' or 'no' values])
fi
fi
],
[
if test x$is_enabled_ompss = xyes;
then
is_enabled_openmp="yes"
AC_MSG_RESULT([yes])
else
is_enabled_openmp="no"
AC_MSG_RESULT([no])
fi
]
)
dnl --------------------- End of Support for OpenMP --------------------------------------
dnl --------------------- Support for OmpSs-2 --------------------------------------
is_enabled_ompss_2="no"
AC_MSG_CHECKING([if enabled OmpSs-2 support in the compiler for Nanos6])
AC_ARG_ENABLE([ompss-2],
AS_HELP_STRING([--enable-ompss-2], [Enables support of OmpSs-2 using Nanos6 (default is disabled)]),
[
if test x$enableval = xyes -o x$enableval = x;
then
is_enabled_ompss_2="yes"
AC_MSG_RESULT([yes])
else if test x$enableval = xno;
then
is_enabled_ompss_2="no"
AC_MSG_RESULT([no])
else
AC_MSG_ERROR([This option can only be given 'yes' or 'no' values])
fi
fi
],
[
is_enabled_ompss_2="no"
AC_MSG_RESULT([no])
]
)
dnl --------------------- End of Support for OmpSs-2 --------------------------------------
dnl --------------------- Support for OmpSs / OpenMP Nanox --------------------------------------
is_enabled_tl_omp_nanox="no"
if test x$is_enabled_openmp = xyes -o x$is_enabled_ompss = xyes;
then
is_enabled_tl_omp_nanox="yes"
fi
nanox_include=""
nanox_lib=""
nanox=""
nanox_mic_include=""
nanox_mic_lib=""
nanox=""
# Nanos++ automatic features detection mechanism
nanox_auto_feat_detection="new"
NANOX=""
NANOX_ENABLED="$is_enabled_tl_omp_nanox"
NANOX_INCLUDES=""
NANOX_LIBS=""
NANOX_GNU_LDFLAGS=""
NANOX_IBM_LDFLAGS=""
NANOX_MIC=""
NANOX_MIC_INCLUDES=""
NANOX_MIC_LIBS=""
nanox_mic_enabled=no
MIC_TOOLS="/usr/linux-k1om-4.7/x86_64-k1om-linux/bin/"
show_mic_tools_warning=NO
MIC_LIBS=""
NANOX_GATE=":false:"
NANOX_DYNAMIC_LIST=":false:"
if test x$is_enabled_tl_omp_nanox = xyes;
then
NANOX_GATE=":true:"
AC_ARG_WITH([nanox],
AS_HELP_STRING([--with-nanox=dir], [Directory of Nanos++ installation]),
[
nanox_include="${withval}/include/nanox"
nanox_lib="${withval}/lib"
nanox="${withval}"
if test -d "${withval}/lib64";
then
nanox_lib="${withval}/lib64"
fi
]
)
AC_ARG_WITH([nanox-include],
AS_HELP_STRING([--with-nanox-include=dir], [Directory of Nanos++ headers]),
[
nanox_include="${withval}"
]
)
AC_ARG_WITH([nanox-lib],
AS_HELP_STRING([--with-nanox-lib=dir], [Directory of Nanos++ libraries]),
[
nanox_lib="${withval}"
]
)
CPPFLAGSBACKUP="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$nanox_include"
AC_CHECK_HEADER([nanos.h],
[break],
[AC_MSG_ERROR([Nanos++ support was required but 'nanos.h' was not found])])
AC_MSG_CHECKING([Checking Nanos++ RTL automatic features detection mechanism version])
AC_PREPROC_IFELSE(
[AC_LANG_SOURCE([[
#include "nanos_version.h"
#if NANOS_API_MASTER < 5040
#error "old runtime"
#endif
]])],
[
AC_MSG_RESULT([new version])
nanox_auto_feat_detection="new"
],
[
AC_MSG_RESULT([old version])
nanox_auto_feat_detection="old"
])
if test x$nanox_auto_feat_detection = xnew;
then
NANOX_DYNAMIC_LIST=":false:"
else
NANOX_DYNAMIC_LIST=":true:"
fi
CPPFLAGS="$CPPFLAGSBACKUP"
AC_ARG_WITH([nanox-mic],
AS_HELP_STRING([--with-nanox-mic=dir], [Directory of Nanos++ MIC installation]),
[
nanox_mic_include="${withval}/include/nanox"
nanox_mic_lib="${withval}/lib"
nanox_mic="${withval}"
nanox_mic_enabled=yes
if test -d "${withval}/lib64";
then
nanox_mic_lib="${withval}/lib64"
fi
]
)
AC_ARG_WITH([nanox-mic-include],
AS_HELP_STRING([--with-nanox-mic-include=dir], [Directory of Nanos++ MIC headers]),
[
nanox_mic_include="${withval}"
nanox_mic_enabled=yes
]
)
AC_ARG_WITH([nanox-mic-lib],
AS_HELP_STRING([--with-nanox-mic-lib=dir], [Directory of Nanos++ MIC libraries]),
[
nanox_mic_lib="${withval}"
nanox_mic_enabled=yes
]
)
if test x$nanox_mic_include = x -o x$nanox_mic_lib = x;
then
nanox_mic_include=$nanox_include
nanox_mic_lib=$nanox_lib
fi
NANOX_MIC_INCLUDES="${nanox_mic_include}"
NANOX_MIC_LIBS="${nanox_mic_lib}"
NANOX_MIC="${nanox_mic}"
AC_ARG_WITH([mic-tools],
AS_HELP_STRING([--with-mic-tools=dir], [Directory where MIC (k1om arch) tools are located (objcopy,objdump & ar)]),
[
MIC_TOOLS="${withval}/"
#some machines seem to add a prefix to objdump, ar...
AC_CHECK_FILE(${MIC_TOOLS}objdump, [], [MIC_TOOLS="${MIC_TOOLS}x86_64-k1om-linux-"])
if test x$NANOX_MIC_ENABLED = xyes;
then
AC_CHECK_FILE(${MIC_TOOLS}objdump, [], [show_mic_tools_warning=YES])
fi
]
)
AC_ARG_WITH([mic-libs],
AS_HELP_STRING([--with-mic-libs=dir], [Location of MIC libraries. If not specified, the ones located in current icc installation will be used,
if not found/valid LD_LIBRARY_PATH will have to be passed to the spawned processes]),
[
MIC_LIBS="${withval}"
],
[
MIC_LIBS=${ICC%icc}/../../compiler/lib/mic/
])
if test x$nanox_include = x -o x$nanox_lib = x;
then
AC_MSG_ERROR([OpenMP support requires '--with-nanox=dir'. See --help.])
fi
NANOX_INCLUDES="${nanox_include}"
NANOX_LIBS="${nanox_lib}"
NANOX="${nanox}"
INSTALL_CONFIG_FILES="${INSTALL_CONFIG_FILES} 57.config.omp.smp"
COMPILER_NAMES="${COMPILER_NAMES} smpfc smpcc smpcxx"
fi
AC_SUBST([NANOX_ENABLED])
AC_SUBST([NANOX_GATE])
AC_SUBST([NANOX_DYNAMIC_LIST])
AM_CONDITIONAL([BUILD_NANOS_COMMON], test x$is_enabled_tl_omp_nanox = xyes)
AM_CONDITIONAL([BUILD_NANOX_NODECL], test x$is_enabled_tl_omp_nanox = xyes)
AM_CONDITIONAL([BUILD_NANOX_DEVICE_SMP], test x$is_enabled_tl_omp_nanox = xyes)
AM_CONDITIONAL([BUILD_NANOX_NANOSMAIN], test x$is_enabled_tl_omp_nanox = xyes)
AM_CONDITIONAL([DISTRIBUTE_NANOS_EXPORTS], test x$nanox_auto_feat_detection = xold)
NANOX_INSTRUMENTATION=""
NANOX_MIC_INSTRUMENTATION=""
AC_MSG_CHECKING([whether used installation of Nanos++ has instrumentation support])
if test -e "${nanox_lib}/instrumentation" -a -d "${nanox_lib}/instrumentation";
then
NANOX_INSTRUMENTATION="yes"
AC_MSG_RESULT([yes])
else
if test -e "${nanox_lib}";
then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([no, Nanos++ library directory does not exist])
fi
fi
if test -e "${nanox_mic_lib}/instrumentation" -a -d "${nanox_mic_lib}/instrumentation";
then
NANOX_MIC_INSTRUMENTATION="yes"
fi
AC_SUBST([NANOX])
AC_SUBST([NANOX_INCLUDES])
AC_SUBST([NANOX_LIBS])
AC_SUBST([NANOX_GNU_LDFLAGS])
AC_SUBST([NANOX_IBM_LDFLAGS])
AC_SUBST([NANOX_INSTRUMENTATION])
AC_SUBST([NANOX_MIC_INCLUDES])
AC_SUBST([NANOX_MIC])
AC_SUBST([NANOX_MIC_LIBS])
AC_SUBST([NANOX_MIC_INSTRUMENTATION])
AC_SUBST([MIC_TOOLS])
dnl --------------------- End of Support for OpenMP Nanox -------------------------------
dnl --------------------- Support for CUDA devices in Nanox --------------------------------
AC_MSG_CHECKING([whether the CUDA Nanos++ Lowering is enabled])
AC_ARG_ENABLE([nanox-cuda-device],
AS_HELP_STRING([--disable-nanox-cuda-device], [Disables the CUDA Nanos++ Lowering phase in Mercurium (enabled by default)]),
[ ], # enable_nanox_cuda_device=$enableval
[ enable_nanox_cuda_device="yes" ])
AC_MSG_RESULT([$enable_nanox_cuda_device])
nanox_supports_cuda=no
if test x"$is_enabled_tl_omp_nanox" = x"yes" -a x"$enable_nanox_cuda_device" = x"yes";
then
AC_CHECK_FILE([$nanox_include/nanos-gpu.h],[nanox_supports_cuda=yes])
AC_MSG_CHECKING([whether Nanos++ was configured with CUDA support])
AC_MSG_RESULT([$nanox_supports_cuda])
fi
ENABLE_CUDA=":false:"
ompss_supports_cuda="no"
if test x"$enable_nanox_cuda_device" = x"yes" -a x"$nanox_supports_cuda" = x"yes";
then
ompss_supports_cuda="yes"
ENABLE_CUDA=":true:"
fi
AM_CONDITIONAL([BUILD_NANOX_DEVICE_CUDA], test x"$ompss_supports_cuda" = x"yes")
AC_SUBST([ENABLE_CUDA])
AC_SUBST([ompss_supports_cuda])
dnl --------------------- End of Support for CUDA in Nanox --------------------------------
dnl --------------------- Support for FPGA in Nanox --------------------------------
AC_MSG_CHECKING([whether the FPGA Nanos++ Lowering is enabled])
AC_ARG_ENABLE([nanox-fpga-device],
AS_HELP_STRING([--disable-nanox-fpga-device], [Disables the FPGA Nanos++ Lowering phase in Mercurium (enabled by default)]),
[ ], #enable_nanox_fpga_device=$enableval
[ enable_nanox_fpga_device="yes"])
AC_MSG_RESULT([$enable_nanox_fpga_device])
FPGA_CC=""
AC_ARG_WITH([fpga-cc],
AS_HELP_STRING([--with-fpga-cc=comp], [Prefix for the fpga system cross compiler for arm]),
[
FPGA_CC="${withval}"
],
[
FPGA_CC="arm-linux-gnueabi-"
])
AC_SUBST([FPGA_CC])
if test x$is_enabled_tl_omp_nanox = xyes -a x"$enable_nanox_fpga_device" = x"yes";
then
INSTALL_CONFIG_FILES="${INSTALL_CONFIG_FILES} 50.config.omp.fpga"
COMPILER_NAMES="${COMPILER_NAMES} fpgacc fpgacxx"
fi
AM_CONDITIONAL([BUILD_NANOX_DEVICE_FPGA], test x$is_enabled_tl_omp_nanox = xyes -a x"$enable_nanox_fpga_device" = x"yes")
dnl --------------------- End of Support for FPGA in Nanox --------------------------------
dnl --------------------- Start OpenCL support in Mercurium --------------------------------
opencl_valid=no
AC_MSG_CHECKING([whether the OpenCL Nanos++ Lowering is enabled])
AC_ARG_ENABLE([nanox-opencl-device],
AS_HELP_STRING([--disable-nanox-opencl-device], [Disables the OpenCL Nanos++ Lowering phase in Mercurium (enabled by default)]),
[ ], # enable_nanox_opencl_device=$enableval
[ enable_nanox_opencl_device="yes" ])
AC_MSG_RESULT($enable_nanox_opencl_device)
if test x$"$enable_nanox_opencl_device" = x"yes";
then
AC_MSG_CHECKING([if nanox has opencl header installed])
#tests if opencl headers are usable and correct
#backup vars before we do the tests
CPPFLAGSBACKUP="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$nanox_include"
AC_CHECK_HEADER([nanos-opencl.h], [opencl_valid=yes], [opencl_valid=no])
CPPFLAGS="$CPPFLAGSBACKUP"
fi
ENABLE_OPENCL=":false:"
if test x$is_enabled_tl_omp_nanox = xyes -a x$opencl_valid = xyes; then
ENABLE_OPENCL=":true:"
fi
AC_SUBST([opencl_valid])
AC_SUBST([ENABLE_OPENCL])
AM_CONDITIONAL([BUILD_NANOX_DEVICE_OPENCL], test x$is_enabled_tl_omp_nanox = xyes -a x$opencl_valid = xyes)
dnl --------------------- End OpenCL support in Nanox --------------------------------
dnl --------------------- Start MPI support in Mercurium --------------------------------
AC_MSG_CHECKING([whether the MPI Nanos++ Lowering is enabled])
AC_ARG_ENABLE([nanox-mpi-device],
AS_HELP_STRING([--disable-nanox-mpi-device], [Disables the MPI Nanos++ Lowering phase in Mercurium (enabled by default)]),
[ ], # enable_nanox_mpi_device=$enableval
[ enable_nanox_mpi_device="yes" ])
AC_MSG_RESULT($enable_nanox_mpi_device)
mpi_valid=no
if test x"$enable_nanox_mpi_device" = x"yes";
then
mpi_found=no
mpi_forced=no
MPIPATH=""
#check the directory and get the right compiler path and name
AC_ARG_WITH([mpi],
AS_HELP_STRING([--with-mpi=dir], [Directory of mpi installation]),
[
MPIPATH="${withval}"
mpi_forced=yes
],
[
AC_CHECK_PROG([MPIICC], [mpiicc], [mpiicc])
MPIPATH=${MPIICC%mpiicc}
if test x$MPIPATH = x; then
AC_CHECK_PROG([MPICC], [mpicc], [mpicc])
MPIPATH=${MPICC%mpicc}
fi
]
)
# First attempt: try to find Intel MPI wrappers
if test x$mpi_found = xno; then
MPI_CNAME=mpiicc
MPI_CXXNAME=mpiicpc
MPI_FORTNAME=mpiifort
# Checking the presence of these wrappers in $MPIPATH (???) and $MPIPATH/bin
if test -f $MPIPATH/$MPI_CNAME; then
mpi_found=yes
MPICC=$MPI_CNAME
MPICXX=$MPI_CXXNAME
MPIFORT=$MPI_FORTNAME
elif test -f $MPIPATH/bin/$MPI_CNAME; then
mpi_found=yes
MPICC=$MPI_CNAME
MPICXX=$MPI_CXXNAME
MPIFORT=$MPI_FORTNAME
fi
fi