CMakeFortranCompilerId.F90.in 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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]'
  11. #elif defined(_COMPILER_VERSION)
  12. PRINT *, 'INFO:compiler[MIPSpro]'
  13. ! This compiler is either not known or is too old to define an
  14. ! identification macro. Try to identify the platform and guess that
  15. ! it is the native compiler.
  16. #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
  17. PRINT *, 'INFO:compiler[VisualAge]'
  18. #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
  19. PRINT *, 'INFO:compiler[MIPSpro]'
  20. #elif defined(__hpux) || defined(__hpux__)
  21. PRINT *, 'INFO:compiler[HP]'
  22. #else
  23. PRINT *, 'INFO:compiler[]'
  24. #endif
  25. ! Identify the platform
  26. #if defined(__linux) || defined(__linux__) || defined(linux)
  27. PRINT *, 'INFO:platform[Linux]'
  28. #elif defined(__CYGWIN__)
  29. PRINT *, 'INFO:platform[Cygwin]'
  30. #elif defined(__MINGW32__)
  31. PRINT *, 'INFO:platform[MinGW]'
  32. #elif defined(__APPLE__)
  33. PRINT *, 'INFO:platform[Darwin]'
  34. #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
  35. PRINT *, 'INFO:platform[Windows]'
  36. #elif defined(__FreeBSD__) || defined(__FreeBSD)
  37. PRINT *, 'INFO:platform[FreeBSD]'
  38. #elif defined(__NetBSD__) || defined(__NetBSD)
  39. PRINT *, 'INFO:platform[NetBSD]'
  40. #elif defined(__OpenBSD__) || defined(__OPENBSD)
  41. PRINT *, 'INFO:platform[OpenBSD]'
  42. #elif defined(__sun) || defined(sun)
  43. PRINT *, 'INFO:platform[SunOS]'
  44. #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
  45. PRINT *, 'INFO:platform[AIX]'
  46. #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
  47. PRINT *, 'INFO:platform[IRIX]'
  48. #elif defined(__hpux) || defined(__hpux__)
  49. PRINT *, 'INFO:platform[HP-UX]'
  50. #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
  51. PRINT *, 'INFO:platform[BeOS]'
  52. #elif defined(__QNX__) || defined(__QNXNTO__)
  53. PRINT *, 'INFO:platform[QNX]'
  54. #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
  55. PRINT *, 'INFO:platform[Tru64]'
  56. #elif defined(__riscos) || defined(__riscos__)
  57. PRINT *, 'INFO:platform[RISCos]'
  58. #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
  59. PRINT *, 'INFO:platform[SINIX]'
  60. #elif defined(__UNIX_SV__)
  61. PRINT *, 'INFO:platform[UNIX_SV]'
  62. #elif defined(__bsdos__)
  63. PRINT *, 'INFO:platform[BSDOS]'
  64. #elif defined(_MPRAS) || defined(MPRAS)
  65. PRINT *, 'INFO:platform[MP-RAS]'
  66. #elif defined(__osf) || defined(__osf__)
  67. PRINT *, 'INFO:platform[OSF1]'
  68. #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
  69. PRINT *, 'INFO:platform[SCO_SV]'
  70. #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
  71. PRINT *, 'INFO:platform[ULTRIX]'
  72. #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
  73. PRINT *, 'INFO:platform[Xenix]'
  74. #else
  75. PRINT *, 'INFO:platform[]'
  76. #endif
  77. END PROGRAM