1 PROGRAM CMakeFortranCompilerId
3 ! Identify the compiler
5 #if defined(__INTEL_COMPILER) || defined(__ICC)
6 PRINT *, 'INFO:compiler[Intel]'
7 #elif defined(__SUNPRO_F90) || defined(__SUNPRO_F95)
8 PRINT *, 'INFO:compiler[SunPro]'
10 PRINT *, 'INFO:compiler[G95]'
11 #elif defined(__GNUC__)
12 PRINT *, 'INFO:compiler[GNU]'
13 #elif defined(__IBMC__)
14 # if defined(__COMPILER_VER__)
15 PRINT *, 'INFO:compiler[zOS]'
16 # elif __IBMC__ >= 800
17 PRINT *, 'INFO:compiler[XL]'
19 PRINT *, 'INFO:compiler[VisualAge]'
22 PRINT *, 'INFO:compiler[PGI]'
23 #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
24 PRINT *, 'INFO:compiler[MIPSpro]'
26 ! This compiler is either not known or is too old to define an
27 ! identification macro. Try to identify the platform and guess that
28 ! it is the native compiler.
30 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
31 PRINT *, 'INFO:compiler[VisualAge]'
32 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
33 PRINT *, 'INFO:compiler[MIPSpro]'
34 #elif defined(__hpux) || defined(__hpux__)
35 PRINT *, 'INFO:compiler[HP]'
38 ! The above 'elif 1' instead of 'else' is to work around a bug in the
39 ! SGI preprocessor which produces both the __sgi and else blocks.
41 PRINT *, 'INFO:compiler[]'
45 ! Identify the platform
47 #if defined(__linux) || defined(__linux__) || defined(linux)
48 PRINT *, 'INFO:platform[Linux]'
49 #elif defined(__CYGWIN__)
50 PRINT *, 'INFO:platform[Cygwin]'
51 #elif defined(__MINGW32__)
52 PRINT *, 'INFO:platform[MinGW]'
53 #elif defined(__APPLE__)
54 PRINT *, 'INFO:platform[Darwin]'
55 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
56 PRINT *, 'INFO:platform[Windows]'
57 #elif defined(__FreeBSD__) || defined(__FreeBSD)
58 PRINT *, 'INFO:platform[FreeBSD]'
59 #elif defined(__NetBSD__) || defined(__NetBSD)
60 PRINT *, 'INFO:platform[NetBSD]'
61 #elif defined(__OpenBSD__) || defined(__OPENBSD)
62 PRINT *, 'INFO:platform[OpenBSD]'
63 #elif defined(__sun) || defined(sun)
64 PRINT *, 'INFO:platform[SunOS]'
65 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
66 PRINT *, 'INFO:platform[AIX]'
67 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
68 PRINT *, 'INFO:platform[IRIX]'
69 #elif defined(__hpux) || defined(__hpux__)
70 PRINT *, 'INFO:platform[HP-UX]'
71 #elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
72 PRINT *, 'INFO:platform[Haiku]'
74 ! Haiku also defines __BEOS__ so we must
75 ! put it prior to the check for __BEOS__
77 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
78 PRINT *, 'INFO:platform[BeOS]'
79 #elif defined(__QNX__) || defined(__QNXNTO__)
80 PRINT *, 'INFO:platform[QNX]'
81 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
82 PRINT *, 'INFO:platform[Tru64]'
83 #elif defined(__riscos) || defined(__riscos__)
84 PRINT *, 'INFO:platform[RISCos]'
85 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
86 PRINT *, 'INFO:platform[SINIX]'
87 #elif defined(__UNIX_SV__)
88 PRINT *, 'INFO:platform[UNIX_SV]'
89 #elif defined(__bsdos__)
90 PRINT *, 'INFO:platform[BSDOS]'
91 #elif defined(_MPRAS) || defined(MPRAS)
92 PRINT *, 'INFO:platform[MP-RAS]'
93 #elif defined(__osf) || defined(__osf__)
94 PRINT *, 'INFO:platform[OSF1]'
95 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
96 PRINT *, 'INFO:platform[SCO_SV]'
97 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
98 PRINT *, 'INFO:platform[ULTRIX]'
99 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
100 PRINT *, 'INFO:platform[Xenix]'
103 ! The above 'elif 1' instead of 'else' is to work around a bug in the
104 ! SGI preprocessor which produces both the __sgi and else blocks.
106 PRINT *, 'INFO:platform[]'