forked from rose-compiler/rose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
choose-backend-compiler.m4
1176 lines (1049 loc) · 59.2 KB
/
choose-backend-compiler.m4
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
AC_DEFUN([CHOOSE_BACKEND_COMPILER],
dnl Written by Dan Quinlan, 12/17/2001
dnl This macro selects the back-end C++ compiler to use to compile output
dnl generated by preprocessors build using ROSE. This macro needs to be called
dnl before the GET_COMPILER_SPECIFIC_DEFINES macro is called (so that defines
dnl for the correct back-end C++ compiler are identified for use in preprocessors
dnl build using ROSE)
[
# Make sure that we select a backend compiler before building the backend specific header files
# AC_BEFORE([CHOOSE_BACKEND_COMPILER],[GENERATE_BACKEND_COMPILER_SPECIFIC_HEADERS])
AC_BEFORE([CHOOSE_BACKEND_COMPILER],[GENERATE_BACKEND_CXX_COMPILER_SPECIFIC_HEADERS])
ROSE_CONFIGURE_SECTION([Checking ROSE backend])
ROSE_SUPPORT_X10_BACKEND()
AC_ARG_WITH(alternate_backend_Cxx_compiler,
[ --with-alternate_backend_Cxx_compiler=<compiler name>
Specify an alternative C++ back-end compiler],
[
# Use a different compiler for the backend than for the compilation of ROSE source code
BACKEND_CXX_COMPILER=$with_alternate_backend_Cxx_compiler
AC_SUBST(BACKEND_CXX_COMPILER)
AC_MSG_NOTICE(["alternative back-end C++ compiler specified for generated translators to use: "$BACKEND_CXX_COMPILER"])
] ,
[
# Alternatively use the specified C++ compiler
BACKEND_CXX_COMPILER="$CXX"
AC_MSG_NOTICE([default back-end C++ compiler for generated translators to use: "$BACKEND_CXX_COMPILER"])
])
AC_ARG_WITH(alternate_backend_C_compiler,
[ --with-alternate_backend_C_compiler=<compiler name>
Specify an alternative C back-end compiler],
[
# Use a different compiler for the backend than for the compilation of ROSE source code
BACKEND_C_COMPILER=$with_alternate_backend_C_compiler
AC_SUBST(BACKEND_C_COMPILER)
AC_MSG_NOTICE([alternative back-end C compiler specified for generated translators to use: "$BACKEND_C_COMPILER"])
] ,
[
# Alternatively use the specified C compiler
BACKEND_C_COMPILER="$CC"
AC_MSG_NOTICE([default back-end C compiler for generated translators to use: "$BACKEND_C_COMPILER"])
])
AC_MSG_NOTICE([testing value of FC = "$FC"])
# DQ (10/3/2008): Added option to specify backend fortran compiler
AC_ARG_WITH(alternate_backend_fortran_compiler,
[ --with-alternate_backend_fortran_compiler=<compiler name>
Specify an alternative fortran back-end compiler],
[
# Use a different compiler for the backend than for the compilation of ROSE source code
BACKEND_FORTRAN_COMPILER=$with_alternate_backend_fortran_compiler
AC_SUBST(BACKEND_FORTRAN_COMPILER)
AC_MSG_NOTICE([alternative back-end fortran compiler specified for generated translators to use: "$BACKEND_FORTRAN_COMPILER"])
] ,
[
# Alternatively use the specified fortran compiler
BACKEND_FORTRAN_COMPILER="$FC"
# BACKEND_FORTRAN_COMPILER="gfortran"
AC_MSG_NOTICE([default back-end fortran compiler for generated translators to use: "$BACKEND_FORTRAN_COMPILER"])
])
# DQ (4/2/2011): Added option to specify backend Java compiler
AC_ARG_WITH(alternate_backend_java_compiler,
[ --with-alternate_backend_java_compiler=<compiler name>
Specify an alternative java back-end compiler],
[
# Use a different compiler for the backend than for the compilation of ROSE source code
BACKEND_JAVA_COMPILER=$with_alternate_backend_java_compiler
AC_SUBST(BACKEND_JAVA_COMPILER)
AC_MSG_NOTICE([alternative back-end java compiler specified for generated translators to use: "$BACKEND_JAVA_COMPILER"])
] ,
[
# Alternatively use the specified java compiler
BACKEND_JAVA_COMPILER="javac"
AC_MSG_NOTICE([default back-end java compiler for generated translators to use: "$BACKEND_JAVA_COMPILER"])
])
# DQ (29/8/2017): Added option to specify backend Csharp compiler
AC_ARG_WITH(alternate_backend_csharp_compiler,
[ --with-alternate_backend_csharp_compiler=<compiler name>
Specify an alternative csharp back-end compiler],
[
# Use a different compiler for the backend than for the compilation of ROSE source code
BACKEND_CSHARP_COMPILER=$with_alternate_backend_csharp_compiler
AC_SUBST(BACKEND_CSHARP_COMPILER)
AC_MSG_NOTICE([alternative back-end csharp compiler specified for generated translators to use: "$BACKEND_CSHARP_COMPILER"])
] ,
[
# Alternatively use the specified Mono csharp compiler
BACKEND_CSHARP_COMPILER="mcs"
AC_MSG_NOTICE([default back-end csharp compiler for generated translators to use: "$BACKEND_CSHARP_COMPILER"])
])
# DQ (29/8/2017): Added option to specify backend Ada compiler
AC_ARG_WITH(alternate_backend_ada_compiler,
[ --with-alternate_backend_ada_compiler=<compiler name>
Specify an alternative ada back-end compiler],
[
# Use a different compiler for the backend than for the compilation of ROSE source code
BACKEND_ADA_COMPILER=$with_alternate_backend_ada_compiler
AC_SUBST(BACKEND_ADA_COMPILER)
AC_MSG_NOTICE([alternative back-end ada compiler specified for generated translators to use: "$BACKEND_ADA_COMPILER"])
] ,
[
# Alternatively use the specified GNAT Ada compiler
# DQ (9/12/2017): Note that the command needs to be "gnat" and the "compile" option
# must be added into the generated command line for the backend compiler.
# BACKEND_ADA_COMPILER="gnat compile"
BACKEND_ADA_COMPILER="gnat"
AC_MSG_NOTICE([default back-end ada compiler for generated translators to use: "$BACKEND_ADA_COMPILER"])
])
# DQ (29/8/2017): Added option to specify backend Jovial compiler
AC_ARG_WITH(alternate_backend_jovial_compiler,
[ --with-alternate_backend_jovial_compiler=<compiler name>
Specify an alternative jovial back-end compiler],
[
# Use a different compiler for the backend than for the compilation of ROSE source code
BACKEND_ADA_COMPILER=$with_alternate_backend_jovial_compiler
AC_SUBST(BACKEND_JOVIAL_COMPILER)
AC_MSG_NOTICE([alternative back-end jovial compiler specified for generated translators to use: "$BACKEND_JOVIAL_COMPILER"])
] ,
[
# Alternatively use the specified Jovial compiler
BACKEND_JOVIAL_COMPILER="default_jovial_compiler"
AC_MSG_NOTICE([default back-end jovial compiler for generated translators to use: "$BACKEND_JOVIAL_COMPILER"])
])
# Rasmussen (10/30/2017): Added option to specify backend MATLAB compiler
AC_ARG_WITH(alternate_backend_matlab_compiler,
[ --with-alternate_backend_matlab_compiler=<compiler name>
Specify an alternative MATLAB back-end compiler],
[
# Use a different compiler for the backend than for the compilation of ROSE source code
BACKEND_MATLAB_COMPILER=$with_alternate_backend_matlab_compiler
AC_SUBST(BACKEND_MATLAB_COMPILER)
AC_MSG_NOTICE([alternative back-end MATLAB compiler specified for generated translators to use: "$BACKEND_MATLAB_COMPILER"])
] ,
[
# Alternatively use the specified GNU MATLAB compiler
BACKEND_MATLAB_COMPILER="octave"
AC_MSG_NOTICE([default back-end MATLAB compiler for generated translators to use: "$BACKEND_MATLAB_COMPILER"])
])
# DQ (8/29/2005): Added support for version numbering of backend compiler
# BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=`echo|$BACKEND_CXX_COMPILER -dumpversion | cut -d\. -f1`
# BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=`echo|$BACKEND_CXX_COMPILER -dumpversion | cut -d\. -f2`
AC_MSG_NOTICE([BACKEND_CXX_COMPILER = "$BACKEND_CXX_COMPILER"])
if test x$BACKEND_CXX_COMPILER == xclang++; then
AC_MSG_NOTICE([detected Clang compiler for backend compiler with ROSE])
if test "x$OS_vendor" = xapple; then
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=`${srcdir}/config/getAppleClangMajorVersionNumber.sh`
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=`${srcdir}/config/getAppleClangMinorVersionNumber.sh`
else
# `echo|clang --version`
# BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=`clang++ --version | grep -Po '(?<=version )[^;]+' | cut -d\. -f1`
# BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=`clang++ --version | grep -Po '(?<=version )[^;]+' | cut -d\. -f2`
# BACKEND_GCC_MAJOR=`echo|$BACKEND_CXX_COMPILER -v |& grep -Po '(?<=version )[^;]+' | cut -d\. -f1 | cut -d\( -f1`
# BACKEND_GCC_MINOR=`echo|$BACKEND_CXX_COMPILER -v |& grep -Po '(?<=version )[^;]+' | cut -d\. -f2 | cut -d\( -f1`
# ${srcdir}/config/syntax.sh
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=`${srcdir}/config/getClangMajorVersionNumber.sh`
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=`${srcdir}/config/getClangMinorVersionNumber.sh`
fi
AC_MSG_NOTICE([(clang) C++ back-end compiler major version number = "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER"])
AC_MSG_NOTICE([(clang) C++ back-end compiler minor version number = "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER"])
# exit 1
else
# DQ (12/3/2016): Note that even if the backend compiler is specified to be GNU, on a Mac OSX system this will be clang.
# So we can trigger behavior based on the backend compiler name directly when on an OSX system.
if test "x$OS_vendor" = xapple; then
# Rasmussen (2/20/2017): The grep -Po option is not available on Mac OSX without installing a new
# version of grep. In addition, man pages from gnu.org on grep don't provide confidence in using it:
# -P
# --perl-regex
# Interpret the pattern as a Perl-compatible regular expression (PCRE). This is highly experimental,
# particularly when combined with the -z (--null-data) option, and ‘grep -P’ may warn of
# unimplemented features.
#
# Tnerefore, grep -Po usage has been replaced by shell scripts.
# DQ (3/31/2020): Bug fix suggested by Pei-Hung.
# IS_APPLE_GCC=`g++ --version | grep -ci "Apple clang"`
IS_APPLE_GCC=`g++ --version | grep -ci "Apple "`
AC_MSG_NOTICE([IS_APPLE_GCC = "$IS_APPLE_GCC"])
if test $IS_APPLE_GCC -ne 0; then
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=`${srcdir}/config/getAppleClangMajorVersionNumber.sh`
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=`${srcdir}/config/getAppleClangMinorVersionNumber.sh`
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=`${srcdir}/config/getAppleClangPatchVersionNumber.sh`
AC_MSG_NOTICE([(g++ but really clang) C++ back-end compiler major version number = "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER"])
AC_MSG_NOTICE([(g++ but really clang) C++ back-end compiler minor version number = "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER"])
# On an OSX system, the version of Clang is not clear since the "--version" option will report the
# version number of XCode (not clang). So either we map from the version of the OS to the version
# of Clang used in it's version of XCode, or we map from the version of XCode (defined by the current
# values of (CXX_VERSION_MAJOR,CXX_VERSION_MINOR, and CXX_VERSION_PATCH).
#
# Rasmussen (12/21//2020): For mapping between Xcode, clang --version, and LLVM see
# https://en.wikipedia.org/wiki/Xcode#Toolchain_versions
XCODE_VERSION_MAJOR=$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER
XCODE_VERSION_MINOR=$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER
XCODE_VERSION_PATCH=$BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER
if test $XCODE_VERSION_MAJOR -eq 7; then
# The versions of clang all depend upon the minor version number of XCode (for major version number equal to 7).
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=3
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
case "$XCODE_VERSION_MINOR" in
0)
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=7
;;
3)
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=8
;;
*)
AC_MSG_FAILURE([unknown or unsupported version of XCode: XCODE_VERSION_MINOR = "$XCODE_VERSION_MINOR"])
;;
esac
elif test $XCODE_VERSION_MAJOR -eq 8; then
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=3
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
# DQ (3/3//2017): Added latest version information from Craig.
case "$XCODE_VERSION_MINOR" in
0|1)
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=8
;;
*)
AC_MSG_FAILURE([unknown or unsupported version of XCode: XCODE_VERSION_MINOR = "$XCODE_VERSION_MINOR"])
;;
esac
elif test $XCODE_VERSION_MAJOR -eq 9; then
# Rasmussen (10/27//2017): Added results for clang --version 9.0.0
# Rasmussen (04/04//2018): Added results for clang --version 9.0.1
# See https://opensource.apple.com/source/clang/clang-800.0.42.1/src/CMakeLists.txt
# Pei-Hung (01/16/2019): Revised based on https://en.wikipedia.org/wiki/Xcode#Latest_versions
case "$XCODE_VERSION_MINOR" in
0|1)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=4
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
;;
3|4)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=5
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=2
;;
*)
AC_MSG_FAILURE([unknown or unsupported version of XCode: XCODE_VERSION_MINOR = "$XCODE_VERSION_MINOR"])
;;
esac
elif test $XCODE_VERSION_MAJOR -eq 10; then
# Rasmussen (11/21/2018): Fixed results for clang --version 10.0.0
case "$XCODE_VERSION_PATCH" in
0)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=6
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=1
;;
1)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=7
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
;;
*)
AC_MSG_FAILURE([unknown or unsupported version of XCode: XCODE_VERSION_MINOR = "$XCODE_VERSION_MINOR"])
;;
esac
elif test $XCODE_VERSION_MAJOR -eq 11; then
# Rasmussen (12/21/2020): Fixed results for clang --version 11.0.0
case "$XCODE_VERSION_PATCH" in
0)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=8
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
;;
3)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=9
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
;;
*)
AC_MSG_FAILURE([unknown or unsupported version of XCode: XCODE_VERSION_MINOR = "$XCODE_VERSION_MINOR"])
;;
esac
elif test $XCODE_VERSION_MAJOR -eq 12; then
# Rasmussen (12/21/2020): Added results for clang --version 12.0.0
case "$XCODE_VERSION_PATCH" in
0)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=10
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
;;
5)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=11
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=1
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
;;
*)
AC_MSG_FAILURE([unknown or unsupported version of XCode: Major version is 12, XCODE_VERSION_PATCH = "$XCODE_VERSION_PATCH"])
;;
esac
elif test $XCODE_VERSION_MAJOR -eq 13; then
# Rasmussen (05/19/2022): Updated results for clang --version 13.0.0-13.1.6
case "$XCODE_VERSION_MINOR" in
0)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=12
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
;;
1)
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=13
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
;;
*)
AC_MSG_FAILURE([unknown or unsupported version of XCode: Major version is 13, XCODE_VERSION_MINOR = "$XCODE_VERSION_MINOR"])
;;
esac
elif test $XCODE_VERSION_MAJOR -eq 14; then
# Rasmussen (10/13/2022): Updated results for clang --version 14.0.0
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=14
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=0
BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
else
AC_MSG_FAILURE([unknown or unsupported version of XCode: XCODE_VERSION_MAJOR = "$XCODE_VERSION_MAJOR"])
fi
# # Note "build_os" is a variable determined by autoconf.
# case $build_os in
# darwin13*)
# # This is Mac OSX version 10.9 (not clear on what version of clang this maps to via XCode)
# BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=3
# BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=6
# BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
# ;;
# darwin14*)
# # This is Mac OSX version 10.10 (not clear on what version of clang this maps to via XCode)
# BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=3
# BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=8
# BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
# ;;
# darwin15*)
# # This is Mac OSX version 10.11
# BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=3
# BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=8
# BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER=0
# ;;
# *)
# echo "Error: Apple Mac OSX version not recognized as either darwin13, 14, or darwin15 ... (build_os = $build_os)";
# exit 1;
# esac
# DQ (12/3/2016): Added debugging for LLVM on MACOSX.
AC_MSG_NOTICE([compilerVendorName = "$compilerVendorName"])
AC_MSG_NOTICE([BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER = "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER"])
AC_MSG_NOTICE([BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER = "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER"])
AC_MSG_NOTICE([BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER = "$BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER"])
# echo "Detected use of GNU backend compiler name on Mac OSX system"
# exit 1
else
AC_MSG_NOTICE([Detected using MacPorts GCC backend compiler])
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=`echo|$BACKEND_CXX_COMPILER -dumpfullversion -dumpversion | cut -d\. -f1`
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=`echo|$BACKEND_CXX_COMPILER -dumpfullversion -dumpversion | cut -s -d\. -f2`
fi
else
AC_MSG_NOTICE([else case not using Clang (choose backend compiler)])
BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER=`echo|$BACKEND_CXX_COMPILER -dumpfullversion -dumpversion | cut -d\. -f1`
BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER=`echo|$BACKEND_CXX_COMPILER -dumpfullversion -dumpversion | cut -s -d\. -f2`
AC_MSG_NOTICE([(non-clang) C++ back-end compiler major version number = "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER"])
AC_MSG_NOTICE([(non-clang) C++ back-end compiler minor version number = "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER"])
fi
# exit 1
fi
# echo "back-end compiler for generated translators to use will be: $BACKEND_CXX_COMPILER"
AC_MSG_NOTICE([C++ back-end compiler major version number = "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER"])
AC_MSG_NOTICE([C++ back-end compiler minor version number = "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER"])
# echo "Exiting in computing the c++ compiler version number (which has to be different for Clang)"
# exit 1
# Use this to get the major and minor version numbers for gfortran (which maps --version to -dumpversion, unlike gcc and g++)
# gfortran --version | head -1 | cut -f2 -d\) | tr -d \ | cut -d\. -f2
# Or Jeremiah suggests the alternative:
# gfortran --version | sed -n '1s/.*) //;1p'
AC_MSG_NOTICE([BACKEND_FORTRAN_COMPILER = "$BACKEND_FORTRAN_COMPILER"])
FORTRAN_COMPILER_NAME=`basename $BACKEND_FORTRAN_COMPILER`
if test x$BACKEND_FORTRAN_COMPILER == xpgfortran; then
BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER=`echo|$BACKEND_FORTRAN_COMPILER --version 2>1 | grep pgfortran | cut -f2 -d\ | tr -d \ | cut -d\. -f1`
BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER=`echo|$BACKEND_FORTRAN_COMPILER --version 2>1 | grep pgfortran | cut -f2 -d\ | tr -d \ | cut -d\. -f2 | cut -d\- -f1`
else
# DQ (9/15/2009): Normally we expect a string such as "GNU Fortran 95 (GCC) 4.1.2", but
# the GNU 4.0.x compiler's gfortran outputs a string such as "GNU Fortran 95 (GCC 4.0.2)"
# So for this case we detect it explicitly and fill in the values directly!
BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER=`echo|$BACKEND_FORTRAN_COMPILER --version | head -1 | cut -f2 -d\) | tr -d \ | cut -d\. -f1`
BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER=`echo|$BACKEND_FORTRAN_COMPILER --version | head -1 | cut -f2 -d\) | tr -d \ | cut -d\. -f2`
# Test if we computed the major and minor version numbers correctly...recompute if required
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x; then
AC_MSG_NOTICE([BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER = "$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER" (blank) so this is likely the GNU 4.0.x version (try again to get the version number)])
BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER=`echo|$BACKEND_FORTRAN_COMPILER --version | head -1 | sed s/"GNU Fortran 95 (GCC "//g | cut -f1 -d \) | cut -d\. -f1`
BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER=`echo|$BACKEND_FORTRAN_COMPILER --version | head -1 | sed s/"GNU Fortran 95 (GCC "//g | cut -f1 -d \) | cut -d\. -f2`
fi
fi
case "$BACKEND_FORTRAN_COMPILER" in
gfortran*)
AC_DEFINE([BACKEND_FORTRAN_IS_GNU_COMPILER], [1], [Mark that GFORTRAN is used in backend])
;;
ifort*)
AC_DEFINE([BACKEND_FORTRAN_IS_INTEL_COMPILER], [1], [Mark that Intel Fortran is used in backend])
AC_DEFINE([BACKEND_FORTRAN_IS_GNU_COMPILER], [0], [Mark that GFORTRAN is not used in backend ])
AC_CHECK_TOOL(INTEL_FPP_PATH, [fpp], [no])
if test "$INTEL_FPP_PATH" != "no"; then
AC_DEFINE([ROSE_USE_INTEL_FPP], [1], [Mark that Intel FPP is used in backend ])
AC_DEFINE_UNQUOTED([INTEL_FPP_PATH],"$INTEL_FPP_PATH",[Name of Intel Fortran preprocessor])
fi
;;
pgf*)
AC_DEFINE([BACKEND_FORTRAN_IS_PGI_COMPILER], [1], [Mark that PGI Fortran is used in backend])
AC_DEFINE([BACKEND_FORTRAN_IS_GNU_COMPILER], [0], [Mark that GFORTRAN is not used in backend ])
;;
*)
AC_DEFINE([BACKEND_FORTRAN_IS_GNU_COMPILER], [0], [Mark that GFORTRAN is not used in backend ])
;;
esac
# echo "back-end compiler for generated translators to use will be: $BACKEND_CXX_COMPILER"
AC_MSG_NOTICE([Fortran back-end compiler major version number = "$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER"])
AC_MSG_NOTICE([Fortran back-end compiler minor version number = "$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER"])
## Test that we have correctly evaluated the major and minor versions numbers...
# If incorrect better to fail here rather than in build (sage_support.C),
# but only fail if Fortran support is requested [Rasmussen 2019.02.21]
#
if test "x$support_fortran_frontend" = "xyes" ; then
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x; then
AC_MSG_ERROR([could not compute the major version number of "$BACKEND_FORTRAN_COMPILER"])
fi
if test x$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER == x; then
AC_MSG_ERROR([could not compute the minor version number of "$BACKEND_FORTRAN_COMPILER"])
fi
fi
# DQ (9/16/2009): GNU gfortran 4.0 has special problems so we avoid some tests where it fails.
gfortran_version_4_0=no
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test x$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER == x0; then
AC_MSG_NOTICE([we have identified version 4.0 of gfortran])
gfortran_version_4_0=yes
fi
fi
AM_CONDITIONAL(ROSE_USING_GFORTRAN_VERSION_4_0, [test "x$gfortran_version_4_0" = "xyes"])
# DQ (9/17/2009): GNU gfortran 4.1 has special problems so we avoid some tests where it fails.
gfortran_version_4_1=no
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test x$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER == x1; then
AC_MSG_NOTICE([we have identified version 4.1 of gfortran])
gfortran_version_4_1=yes
fi
fi
AM_CONDITIONAL(ROSE_USING_GFORTRAN_VERSION_4_1, [test "x$gfortran_version_4_1" = "xyes"])
# DQ (2/13/2011): GNU gfortran 4.2 is a gnu configuration where I want to have test2010_161.f90 be tested.
# It has previously demonstrated a statistical failure on 4.1.2 and 4.3.2 (running it on 4.2 machines
# is an incremental step to getting it into more uniform testing, since I can't get it to fail locally).
# It also passes valgrind just fine, so this is a bit of a mystery at present.
gfortran_version_4_2=no
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test x$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER == x2; then
AC_MSG_NOTICE([we have identified version 4.2 of gfortran])
gfortran_version_4_2=yes
fi
fi
AM_CONDITIONAL(ROSE_USING_GFORTRAN_VERSION_4_2, [test "x$gfortran_version_4_2" = "xyes"])
# DQ (2/1/2011): GNU gfortran 4.4 has special problems so we avoid some tests where it fails.
gfortran_version_4_4=no
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test x$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER == x4; then
AC_MSG_NOTICE([we have identified version 4.4 of gfortran])
gfortran_version_4_4=yes
fi
fi
AM_CONDITIONAL(ROSE_USING_GFORTRAN_VERSION_4_4, [test "x$gfortran_version_4_4" = "xyes"])
# DQ (4/10/2011): GNU gfortran 4.5 has special problems so we avoid some tests where it fails.
gfortran_version_4_5=no
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test x$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER == x5; then
AC_MSG_NOTICE([we have identified version 4.5 of gfortran])
gfortran_version_4_5=yes
fi
fi
AM_CONDITIONAL(ROSE_USING_GFORTRAN_VERSION_4_5, [test "x$gfortran_version_4_5" = "xyes"])
# DQ (4/10/2011): GNU gfortran 4.6 has special problems so we avoid some tests where it fails.
gfortran_version_4_6=no
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test x$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER == x6; then
AC_MSG_NOTICE([we have identified version 4.6 of gfortran])
gfortran_version_4_6=yes
fi
fi
AM_CONDITIONAL(ROSE_USING_GFORTRAN_VERSION_4_6, [test "x$gfortran_version_4_6" = "xyes"])
# Phlin (8/23/2012): GNU gfortran 4.5+ has special supports.
gfortran_version_later_4_5=no
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test "$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER" -ge "5"; then
AC_MSG_NOTICE([we have identified version 4.5+ of gfortran])
gfortran_version_later_4_5=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "4"; then
gfortran_version_later_4_5=yes
fi
AM_CONDITIONAL(ROSE_USING_GFORTRAN_VERSION_LATER_4_5, [test "x$gfortran_version_later_4_5" = "xyes"])
# Phlin (8/23/2012): GNU gfortran 4.4+ has special supports.
gfortran_version_later_4_4=no
if test x$BACKEND_FORTRAN_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test "$BACKEND_FORTRAN_COMPILER_MINOR_VERSION_NUMBER" -ge "4"; then
AC_MSG_NOTICE([we have identified version 4.4+ of gfortran])
gfortran_version_later_4_4=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "4"; then
gfortran_version_later_4_4=yes
fi
AM_CONDITIONAL(ROSE_USING_GFORTRAN_VERSION_LATER_4_4, [test "x$gfortran_version_later_4_4" = "xyes"])
# DQ (8/15/2014): GNU GCC 4.4 starts more complex Microsoft C++ support.
gcc_version_later_4_4=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "4"; then
AC_MSG_NOTICE([we have identified version 4.4+ of gcc])
gcc_version_later_4_4=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "4"; then
gcc_version_later_4_4=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_4_4, [test "x$gcc_version_later_4_4" = "xyes"])
# DQ (8/15/2014): Added for more complete support of GNU GCC.
gcc_version_later_4_5=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "5"; then
AC_MSG_NOTICE([we have identified version 4.5+ of gcc])
gcc_version_later_4_5=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "4"; then
gcc_version_later_4_5=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_4_5, [test "x$gcc_version_later_4_5" = "xyes"])
# Phlin (8/22/2012): GNU GCC 4.6 starts AVX support.
gcc_version_later_4_6=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "6"; then
AC_MSG_NOTICE([we have identified version 4.6+ of gcc])
gcc_version_later_4_6=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "4"; then
gcc_version_later_4_6=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_4_6, [test "x$gcc_version_later_4_6" = "xyes"])
# DQ (8/15/2014): Added for more complete support of GNU GCC.
gcc_version_later_4_7=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "7"; then
AC_MSG_NOTICE([we have identified version 4.7+ of gcc])
gcc_version_later_4_7=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "4"; then
gcc_version_later_4_7=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_4_7, [test "x$gcc_version_later_4_7" = "xyes"])
# DQ (7/28/2014): GNU GCC 4.8 starts C11 support.
gcc_version_4_8=no
gcc_version_later_4_8=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -eq "8"; then
AC_MSG_NOTICE([we have identified specific version 4.8 of gcc])
gcc_version_4_8=yes
fi
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "8"; then
AC_MSG_NOTICE([we have identified version 4.8+ of gcc])
gcc_version_later_4_8=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "4"; then
gcc_version_later_4_8=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_4_8, [test "x$gcc_version_later_4_8" = "xyes"])
# DQ (7/28/2014): GNU GCC 4.9 adds more C11 support (we need this to control what tests are run).
gcc_version_later_4_9=no
# if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "9"; then
AC_MSG_NOTICE([we have identified version 4.9+ of gcc])
gcc_version_later_4_9=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "4"; then
gcc_version_later_4_9=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_4_9, [test "x$gcc_version_later_4_9" = "xyes"])
# ROSE-1858: A compass example causes a g++ internal error for gcc 4.9.1
gcc_version_equal_4_9_1=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x4; then
if test x$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER == x9; then
if test x$BACKEND_CXX_COMPILER_PATCH_VERSION_NUMBER == x1; then
gcc_version_equal_4_9_1=yes
fi
fi
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_EQUAL_4_9_1, [test "x$gcc_version_equal_4_9_1" = "xyes"])
# DQ (11/9/2016): GNU GCC 5.2 adds more C14 support (we need this to control what tests are run).
gcc_version_later_5_1=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x5; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "1"; then
AC_MSG_NOTICE([we have identified version 5.1+ of gcc])
gcc_version_later_5_1=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "5"; then
gcc_version_later_5_1=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_5_1, [test "x$gcc_version_later_5_1" = "xyes"])
gcc_version_later_5_2=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x5; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "2"; then
AC_MSG_NOTICE([we have identified version 5.2+ of gcc])
gcc_version_later_5_2=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "5"; then
gcc_version_later_5_2=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_5_2, [test "x$gcc_version_later_5_2" = "xyes"])
gcc_version_later_5_3=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x5; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "3"; then
AC_MSG_NOTICE([we have identified version 5.3+ of gcc])
gcc_version_later_5_3=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "5"; then
gcc_version_later_5_3=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_5_3, [test "x$gcc_version_later_5_3" = "xyes"])
gcc_version_later_6_0=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x6; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "0"; then
AC_MSG_NOTICE([we have identified version 6.0+ of gcc])
gcc_version_later_6_0=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "6"; then
gcc_version_later_6_0=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_6_0, [test "x$gcc_version_later_6_0" = "xyes"])
gcc_version_later_6_1=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x6; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "1"; then
AC_MSG_NOTICE([we have identified version 6.1+ of gcc])
gcc_version_later_6_1=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "6"; then
gcc_version_later_6_1=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_6_1, [test "x$gcc_version_later_6_1" = "xyes"])
gcc_version_later_6_2=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x6; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "2"; then
AC_MSG_NOTICE([we have identified version 6.2+ of gcc])
gcc_version_later_6_2=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "6"; then
gcc_version_later_6_2=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_6_2, [test "x$gcc_version_later_6_2" = "xyes"])
gcc_version_later_6_3=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x6; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "3"; then
AC_MSG_NOTICE([we have identified version 6.3+ of gcc])
gcc_version_later_6_3=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "6"; then
gcc_version_later_6_3=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_6_3, [test "x$gcc_version_later_6_3" = "xyes"])
gcc_version_later_6_4=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x6; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "4"; then
AC_MSG_NOTICE([we have identified version 6.4+ of gcc])
gcc_version_later_6_4=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "6"; then
gcc_version_later_6_4=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_6_4, [test "x$gcc_version_later_6_4" = "xyes"])
gcc_version_later_6_5=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x6; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "5"; then
AC_MSG_NOTICE([we have identified version 6.5+ of gcc])
gcc_version_later_6_5=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "6"; then
gcc_version_later_6_5=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_6_5, [test "x$gcc_version_later_6_5" = "xyes"])
gcc_version_later_7_1=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x7; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "1"; then
AC_MSG_NOTICE([we have identified version 7.1+ of gcc])
gcc_version_later_7_1=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "7"; then
gcc_version_later_7_1=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_7_1, [test "x$gcc_version_later_7_1" = "xyes"])
gcc_version_later_7_2=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x7; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "2"; then
AC_MSG_NOTICE([we have identified version 7.2+ of gcc])
gcc_version_later_7_2=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "7"; then
gcc_version_later_7_2=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_7_2, [test "x$gcc_version_later_7_2" = "xyes"])
gcc_version_later_7_3=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x7; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "3"; then
AC_MSG_NOTICE([we have identified version 7.3+ of gcc])
gcc_version_later_7_3=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "7"; then
gcc_version_later_7_3=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_7_3, [test "x$gcc_version_later_7_3" = "xyes"])
gcc_version_later_7_4=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x7; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "4"; then
AC_MSG_NOTICE([we have identified version 7.4+ of gcc])
gcc_version_later_7_4=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "7"; then
gcc_version_later_7_4=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_7_4, [test "x$gcc_version_later_7_4" = "xyes"])
gcc_version_later_7_5=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x7; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "5"; then
AC_MSG_NOTICE([we have identified version 7.5+ of gcc])
gcc_version_later_7_5=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "7"; then
gcc_version_later_7_5=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_7_5, [test "x$gcc_version_later_7_5" = "xyes"])
gcc_version_later_8_1=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x8; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "1"; then
AC_MSG_NOTICE([we have identified version 8.1+ of gcc])
gcc_version_later_8_1=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "8"; then
gcc_version_later_8_1=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_8_1, [test "x$gcc_version_later_8_1" = "xyes"])
gcc_version_later_8_2=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x8; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "2"; then
AC_MSG_NOTICE([we have identified version 8.2+ of gcc])
gcc_version_later_8_2=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "8"; then
gcc_version_later_8_2=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_8_2, [test "x$gcc_version_later_8_2" = "xyes"])
gcc_version_later_8_3=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x8; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "3"; then
AC_MSG_NOTICE([we have identified version 8.3+ of gcc])
gcc_version_later_8_3=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "8"; then
gcc_version_later_8_3=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_8_3, [test "x$gcc_version_later_8_3" = "xyes"])
gcc_version_later_8_4=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x8; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "4"; then
AC_MSG_NOTICE([we have identified version 8.4+ of gcc])
gcc_version_later_8_4=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "8"; then
gcc_version_later_8_4=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_8_4, [test "x$gcc_version_later_8_4" = "xyes"])
gcc_version_later_9_1=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x9; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "1"; then
AC_MSG_NOTICE([we have identified version 9.1+ of gcc])
gcc_version_later_9_1=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "9"; then
gcc_version_later_9_1=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_9_1, [test "x$gcc_version_later_9_1" = "xyes"])
gcc_version_later_9_2=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x9; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "2"; then
AC_MSG_NOTICE([we have identified version 9.2+ of gcc])
gcc_version_later_9_2=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "9"; then
gcc_version_later_9_2=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_9_2, [test "x$gcc_version_later_9_2" = "xyes"])
gcc_version_later_9_3=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x9; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "3"; then
AC_MSG_NOTICE([we have identified version 9.3+ of gcc])
gcc_version_later_9_3=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "9"; then
gcc_version_later_9_3=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_9_3, [test "x$gcc_version_later_9_3" = "xyes"])
gcc_version_later_10_1=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x10; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "1"; then
AC_MSG_NOTICE([we have identified version 10.1+ of gcc])
gcc_version_later_10_1=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "10"; then
gcc_version_later_10_1=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_10_1, [test "x$gcc_version_later_10_1" = "xyes"])
gcc_version_later_10_2=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x10; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "2"; then
AC_MSG_NOTICE([we have identified version 10.2+ of gcc])
gcc_version_later_10_2=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "10"; then
gcc_version_later_10_2=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_10_2, [test "x$gcc_version_later_10_2" = "xyes"])
gcc_version_later_10_3=no
if test x$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == x10; then
if test "$BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER" -ge "3"; then
AC_MSG_NOTICE([we have identified version 10.3+ of gcc])
gcc_version_later_10_3=yes
fi
elif test "$BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER" -gt "10"; then
gcc_version_later_10_3=yes
fi
AM_CONDITIONAL(ROSE_USING_GCC_VERSION_LATER_10_3, [test "x$gcc_version_later_10_3" = "xyes"])
# echo "Exiting after test of backend version number support ..."
# exit 1
# We use the name of the backend C++ compiler to generate a compiler name that will be used
# elsewhere (CXX_ID might be a better name to use, instead we use basename to strip the path).
# compilerName=`basename $BACKEND_CXX_COMPILER`
C_COMPILER_NAME=`basename $BACKEND_C_COMPILER`
COMPILER_NAME=`basename $BACKEND_CXX_COMPILER`
# echo "default back-end compiler for generated preprocessors will be: $BACKEND_CXX_COMPILER"
# export BACKEND_CXX_COMPILER
# AC_DEFINE_UNQUOTED([CXX_COMPILER_NAME],"$BACKEND_CXX_COMPILER",[Name of backend C++ compiler.])
# echo "default back-end compiler for generated preprocessors will be: $BACKEND_CXX_COMPILER compiler name = $compilerName"
# DQ (1/15/2007): This does not work, it seems that BACKEND_C_COMPILER must be a simple name not a compound name using an option!
# Specify any option that specific backend compiler require (e.g. -restrict)
case $COMPILER_NAME in
gcc*|g++*)
;;
icc|icpc)
# BACKEND_C_COMPILER="$BACKEND_C_COMPILER -restrict"
# BACKEND_CXX_COMPILER="$BACKEND_CXX_COMPILER -restrict"
;;
"KCC --c" | mpKCC|KCC)
;;
cc|CC)
;;
esac
AC_MSG_NOTICE([after adding (required) options BACKEND_C_COMPILER = "$BACKEND_C_COMPILER"])
AC_MSG_NOTICE([after adding (required) options BACKEND_CXX_COMPILER = "$BACKEND_CXX_COMPILER"])
AC_MSG_NOTICE([default back-end compiler for generated preprocessors will be "$BACKEND_CXX_COMPILER", compiler name = "$COMPILER_NAME"])
# export BACKEND_CXX_COMPILER
# AC_DEFINE_UNQUOTED([CXX_COMPILER_NAME],"$BACKEND_CXX_COMPILER",[Name of backend C++ compiler.])
# This will be used to select options based on which backend compiler is used (g++, xlC, icc, etc.)
# we can't use the basename of the compiler to execute because it might be link using a non-standard name (e.g. mpig++-3.4.1)
export COMPILER_NAME
AC_DEFINE_UNQUOTED([BACKEND_CXX_COMPILER_NAME_WITHOUT_PATH],"$COMPILER_NAME",[Name of backend C++ compiler excluding path (used to select code generation options).])
export C_COMPILER_NAME
AC_DEFINE_UNQUOTED([BACKEND_C_COMPILER_NAME_WITHOUT_PATH],"$C_COMPILER_NAME",[Name of backend C compiler excluding path (used to select code generation options).])
export FORTRAN_COMPILER_NAME
AC_DEFINE_UNQUOTED([BACKEND_FORTRAN_COMPILER_NAME_WITHOUT_PATH],"$FORTRAN_COMPILER_NAME",[Name of backend Fortran compiler excluding path (used to select code generation options).])
# This will be called to execute the backend compiler (for C++)
export BACKEND_CXX_COMPILER
AC_DEFINE_UNQUOTED([BACKEND_CXX_COMPILER_NAME_WITH_PATH],"$BACKEND_CXX_COMPILER",[Name of backend C++ compiler including path (may or may not explicit include path; used to call backend).])
# This will be called to execute the backend compiler (for C)
export BACKEND_C_COMPILER
AC_DEFINE_UNQUOTED([BACKEND_C_COMPILER_NAME_WITH_PATH],"$BACKEND_C_COMPILER",[Name of backend C compiler including path (may or may not explicit include path; used to call backend).])
# This will be called to execute the backend compiler (for Fortran)
export BACKEND_FORTRAN_COMPILER
AC_DEFINE_UNQUOTED([BACKEND_FORTRAN_COMPILER_NAME_WITH_PATH],"$BACKEND_FORTRAN_COMPILER",[Name of backend Fortran compiler including path (may or may not explicit include path; used to call backend).])
# DQ (4/2/2011): Added some support for the name of the backend Java compiler.
# This will be called to execute the backend compiler (for Java)
export BACKEND_JAVA_COMPILER
AC_DEFINE_UNQUOTED([BACKEND_JAVA_COMPILER_NAME_WITH_PATH],"$BACKEND_JAVA_COMPILER",[Name of backend Java compiler including path (may or may not explicit include path; used to call backend).])
# DQ (29/8/2017): Adding more general language support.
export BACKEND_CSHARP_COMPILER
AC_DEFINE_UNQUOTED([BACKEND_CSHARP_COMPILER_NAME_WITH_PATH],"$BACKEND_CSHARP_COMPILER",[Name of backend Csharp compiler including path (may or may not explicit include path; used to call backend).])
# DQ (29/8/2017): Adding more general language support.
export BACKEND_ADA_COMPILER
AC_DEFINE_UNQUOTED([BACKEND_ADA_COMPILER_NAME_WITH_PATH],"$BACKEND_ADA_COMPILER",[Name of backend Ada compiler including path (may or may not explicit include path; used to call backend).])
# DQ (29/8/2017): Adding more general language support.
export BACKEND_JOVIAL_COMPILER
AC_DEFINE_UNQUOTED([BACKEND_JOVIAL_COMPILER_NAME_WITH_PATH],"$BACKEND_JOVIAL_COMPILER",[Name of backend Jovial compiler including path (may or may not explicit include path; used to call backend).])
# DQ (30/8/2017): Testing the new language support.
AC_MSG_NOTICE([BACKEND_CXX_COMPILER = "$BACKEND_CXX_COMPILER"])
AC_MSG_NOTICE([BACKEND_C_COMPILER = "$BACKEND_C_COMPILER"])
AC_MSG_NOTICE([BACKEND_FORTRAN_COMPILER = "$BACKEND_FORTRAN_COMPILER"])
AC_MSG_NOTICE([BACKEND_JAVA_COMPILER = "$BACKEND_JAVA_COMPILER"])
AC_MSG_NOTICE([BACKEND_CSHARP_COMPILER = "$BACKEND_CSHARP_COMPILER"])
AC_MSG_NOTICE([BACKEND_ADA_COMPILER = "$BACKEND_ADA_COMPILER"])
AC_MSG_NOTICE([BACKEND_JOVIAL_COMPILER = "$BACKEND_JOVIAL_COMPILER"])
# These are useful in handling differences between different versions of the backend compiler
# we assume that the C and C++ compiler version number match and only record version information
# for the backend C++ compiler. (for example, this helps us generated different code for
# g++ 3.3.x and 3.4.x backend compilers).
export BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER