1 PROGRAM CMakeFortranCompilerId
2 ! Identify the compiler
3 #if defined(__INTEL_COMPILER) || defined(__ICC)
4 PRINT *, 'INFO:compiler[Intel]'
5 #elif defined(__SUNPRO_F90) || defined(__SUNPRO_F95)
6 PRINT *, 'INFO:compiler[SunPro]'
7 #elif defined(__GNUC__)
8 PRINT *, 'INFO:compiler[GNU]'
9 #elif defined(__IBM__) || defined(__IBMC__)
10 PRINT *, 'INFO:compiler[VisualAge]'
12 PRINT *, 'INFO:compiler[PGI]'
13 #elif defined(_COMPILER_VERSION)
14 PRINT *, 'INFO:compiler[MIPSpro]'
15 ! This compiler is either not known or is too old to define an
16 ! identification macro. Try to identify the platform and guess that
17 ! it is the native compiler.
18 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
19 PRINT *, 'INFO:compiler[VisualAge]'
20 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
21 PRINT *, 'INFO:compiler[MIPSpro]'
22 #elif defined(__hpux) || defined(__hpux__)
23 PRINT *, 'INFO:compiler[HP]'
25 PRINT *, 'INFO:compiler[]'
28 ! Identify the platform
29 #if defined(__linux) || defined(__linux__) || defined(linux)
30 PRINT *, 'INFO:platform[Linux]'
31 #elif defined(__CYGWIN__)
32 PRINT *, 'INFO:platform[Cygwin]'
33 #elif defined(__MINGW32__)
34 PRINT *, 'INFO:platform[MinGW]'
35 #elif defined(__APPLE__)
36 PRINT *, 'INFO:platform[Darwin]'
37 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
38 PRINT *, 'INFO:platform[Windows]'
39 #elif defined(__FreeBSD__) || defined(__FreeBSD)
40 PRINT *, 'INFO:platform[FreeBSD]'
41 #elif defined(__NetBSD__) || defined(__NetBSD)
42 PRINT *, 'INFO:platform[NetBSD]'
43 #elif defined(__OpenBSD__) || defined(__OPENBSD)
44 PRINT *, 'INFO:platform[OpenBSD]'
45 #elif defined(__sun) || defined(sun)
46 PRINT *, 'INFO:platform[SunOS]'
47 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
48 PRINT *, 'INFO:platform[AIX]'
49 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
50 PRINT *, 'INFO:platform[IRIX]'
51 #elif defined(__hpux) || defined(__hpux__)
52 PRINT *, 'INFO:platform[HP-UX]'
53 #elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
54 PRINT *, 'INFO:platform[Haiku]'
55 ! Haiku also defines __BEOS__ so we must
56 ! put it prior to the check for __BEOS__
57 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
58 PRINT *, 'INFO:platform[BeOS]'
59 #elif defined(__QNX__) || defined(__QNXNTO__)
60 PRINT *, 'INFO:platform[QNX]'
61 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
62 PRINT *, 'INFO:platform[Tru64]'
63 #elif defined(__riscos) || defined(__riscos__)
64 PRINT *, 'INFO:platform[RISCos]'
65 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
66 PRINT *, 'INFO:platform[SINIX]'
67 #elif defined(__UNIX_SV__)
68 PRINT *, 'INFO:platform[UNIX_SV]'
69 #elif defined(__bsdos__)
70 PRINT *, 'INFO:platform[BSDOS]'
71 #elif defined(_MPRAS) || defined(MPRAS)
72 PRINT *, 'INFO:platform[MP-RAS]'
73 #elif defined(__osf) || defined(__osf__)
74 PRINT *, 'INFO:platform[OSF1]'
75 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
76 PRINT *, 'INFO:platform[SCO_SV]'
77 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
78 PRINT *, 'INFO:platform[ULTRIX]'
79 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
80 PRINT *, 'INFO:platform[Xenix]'
82 PRINT *, 'INFO:platform[]'