2009-06-25 16:45:19 +04:00
|
|
|
PROGRAM CMakeFortranCompilerId
|
|
|
|
#if 0
|
|
|
|
! Identify the compiler
|
|
|
|
#endif
|
|
|
|
#if defined(__INTEL_COMPILER) || defined(__ICC)
|
|
|
|
PRINT *, 'INFO:compiler[Intel]'
|
2015-02-17 21:26:14 +03:00
|
|
|
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
|
|
|
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
|
|
|
# if defined(__INTEL_COMPILER_UPDATE)
|
|
|
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
|
|
|
# else
|
|
|
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
|
|
|
# endif
|
|
|
|
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
|
|
|
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
|
|
|
# endif
|
|
|
|
|
2013-10-11 21:54:50 +04:00
|
|
|
# if defined(_MSC_VER)
|
|
|
|
PRINT *, 'INFO:simulate[MSVC]'
|
2015-10-26 20:00:15 +03:00
|
|
|
# if _MSC_VER >= 1900
|
|
|
|
PRINT *, 'INFO:simulate_version[019.00]'
|
|
|
|
# elif _MSC_VER >= 1800
|
2013-10-11 21:54:50 +04:00
|
|
|
PRINT *, 'INFO:simulate_version[018.00]'
|
|
|
|
# elif _MSC_VER >= 1700
|
|
|
|
PRINT *, 'INFO:simulate_version[017.00]'
|
|
|
|
# elif _MSC_VER >= 1600
|
|
|
|
PRINT *, 'INFO:simulate_version[016.00]'
|
|
|
|
# elif _MSC_VER >= 1500
|
|
|
|
PRINT *, 'INFO:simulate_version[015.00]'
|
|
|
|
# elif _MSC_VER >= 1400
|
|
|
|
PRINT *, 'INFO:simulate_version[014.00]'
|
|
|
|
# elif _MSC_VER >= 1310
|
|
|
|
PRINT *, 'INFO:simulate_version[013.01]'
|
2013-10-16 23:27:14 +04:00
|
|
|
# else
|
2013-10-11 21:54:50 +04:00
|
|
|
PRINT *, 'INFO:simulate_version[013.00]'
|
|
|
|
# endif
|
|
|
|
# endif
|
2015-02-17 21:27:22 +03:00
|
|
|
#elif defined(__SUNPRO_F95)
|
2009-06-25 16:45:19 +04:00
|
|
|
PRINT *, 'INFO:compiler[SunPro]'
|
2015-02-17 21:27:22 +03:00
|
|
|
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F95>>8)
|
|
|
|
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F95>>4 & 0xF)
|
|
|
|
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F95 & 0xF)
|
|
|
|
#elif defined(__SUNPRO_F90)
|
|
|
|
PRINT *, 'INFO:compiler[SunPro]'
|
|
|
|
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F90>>8)
|
|
|
|
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F90>>4 & 0xF)
|
|
|
|
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F90 & 0xF)
|
2010-11-12 17:12:08 +03:00
|
|
|
#elif defined(_CRAYFTN)
|
|
|
|
PRINT *, 'INFO:compiler[Cray]'
|
2009-10-23 16:25:43 +04:00
|
|
|
#elif defined(__G95__)
|
|
|
|
PRINT *, 'INFO:compiler[G95]'
|
2015-02-17 21:32:28 +03:00
|
|
|
# define COMPILER_VERSION_MAJOR DEC(__G95__)
|
|
|
|
# define COMPILER_VERSION_MINOR DEC(__G95_MINOR__)
|
2010-01-13 20:12:39 +03:00
|
|
|
#elif defined(__PATHSCALE__)
|
|
|
|
PRINT *, 'INFO:compiler[PathScale]'
|
2015-02-17 21:28:45 +03:00
|
|
|
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
|
|
|
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
|
|
|
# if defined(__PATHCC_PATCHLEVEL__)
|
|
|
|
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
|
|
|
# endif
|
2011-01-21 21:09:22 +03:00
|
|
|
#elif defined(__ABSOFT__)
|
|
|
|
PRINT *, 'INFO:compiler[Absoft]'
|
2009-06-25 16:45:19 +04:00
|
|
|
#elif defined(__GNUC__)
|
|
|
|
PRINT *, 'INFO:compiler[GNU]'
|
2015-02-17 21:29:33 +03:00
|
|
|
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
|
|
|
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
|
|
|
# if defined(__GNUC_PATCHLEVEL__)
|
|
|
|
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
|
|
|
# endif
|
2009-08-07 18:13:07 +04:00
|
|
|
#elif defined(__IBMC__)
|
|
|
|
# if defined(__COMPILER_VER__)
|
|
|
|
PRINT *, 'INFO:compiler[zOS]'
|
|
|
|
# elif __IBMC__ >= 800
|
|
|
|
PRINT *, 'INFO:compiler[XL]'
|
2015-02-17 21:30:19 +03:00
|
|
|
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
|
|
|
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
|
|
|
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
2009-08-07 18:13:07 +04:00
|
|
|
# else
|
2009-06-25 16:45:19 +04:00
|
|
|
PRINT *, 'INFO:compiler[VisualAge]'
|
2015-02-17 21:30:19 +03:00
|
|
|
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
|
|
|
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
|
|
|
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
2009-08-07 18:13:07 +04:00
|
|
|
# endif
|
2009-06-25 16:45:19 +04:00
|
|
|
#elif defined(__PGI)
|
|
|
|
PRINT *, 'INFO:compiler[PGI]'
|
2015-02-17 21:31:45 +03:00
|
|
|
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
|
|
|
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
|
|
|
# if defined(__PGIC_PATCHLEVEL__)
|
|
|
|
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
|
|
|
# endif
|
2009-07-14 23:17:21 +04:00
|
|
|
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
|
2009-06-25 16:45:19 +04:00
|
|
|
PRINT *, 'INFO:compiler[MIPSpro]'
|
|
|
|
# if 0
|
|
|
|
! This compiler is either not known or is too old to define an
|
|
|
|
! identification macro. Try to identify the platform and guess that
|
|
|
|
! it is the native compiler.
|
|
|
|
# endif
|
|
|
|
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
|
|
|
PRINT *, 'INFO:compiler[VisualAge]'
|
|
|
|
#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
|
|
|
|
PRINT *, 'INFO:compiler[MIPSpro]'
|
|
|
|
#elif defined(__hpux) || defined(__hpux__)
|
|
|
|
PRINT *, 'INFO:compiler[HP]'
|
2009-07-14 23:16:59 +04:00
|
|
|
#elif 1
|
|
|
|
# if 0
|
|
|
|
! The above 'elif 1' instead of 'else' is to work around a bug in the
|
|
|
|
! SGI preprocessor which produces both the __sgi and else blocks.
|
|
|
|
# endif
|
2009-06-25 16:45:19 +04:00
|
|
|
PRINT *, 'INFO:compiler[]'
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
! Identify the platform
|
|
|
|
#endif
|
|
|
|
#if defined(__linux) || defined(__linux__) || defined(linux)
|
|
|
|
PRINT *, 'INFO:platform[Linux]'
|
|
|
|
#elif defined(__CYGWIN__)
|
|
|
|
PRINT *, 'INFO:platform[Cygwin]'
|
|
|
|
#elif defined(__MINGW32__)
|
|
|
|
PRINT *, 'INFO:platform[MinGW]'
|
|
|
|
#elif defined(__APPLE__)
|
|
|
|
PRINT *, 'INFO:platform[Darwin]'
|
|
|
|
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
|
|
|
PRINT *, 'INFO:platform[Windows]'
|
|
|
|
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
|
|
|
PRINT *, 'INFO:platform[FreeBSD]'
|
|
|
|
#elif defined(__NetBSD__) || defined(__NetBSD)
|
|
|
|
PRINT *, 'INFO:platform[NetBSD]'
|
|
|
|
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
|
|
|
PRINT *, 'INFO:platform[OpenBSD]'
|
|
|
|
#elif defined(__sun) || defined(sun)
|
|
|
|
PRINT *, 'INFO:platform[SunOS]'
|
|
|
|
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
|
|
|
PRINT *, 'INFO:platform[AIX]'
|
|
|
|
#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
|
|
|
|
PRINT *, 'INFO:platform[IRIX]'
|
|
|
|
#elif defined(__hpux) || defined(__hpux__)
|
|
|
|
PRINT *, 'INFO:platform[HP-UX]'
|
2013-01-08 00:52:45 +04:00
|
|
|
#elif defined(__HAIKU__)
|
2009-06-25 16:45:19 +04:00
|
|
|
PRINT *, 'INFO:platform[Haiku]'
|
|
|
|
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
|
|
|
PRINT *, 'INFO:platform[BeOS]'
|
|
|
|
#elif defined(__QNX__) || defined(__QNXNTO__)
|
|
|
|
PRINT *, 'INFO:platform[QNX]'
|
|
|
|
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
|
|
|
PRINT *, 'INFO:platform[Tru64]'
|
|
|
|
#elif defined(__riscos) || defined(__riscos__)
|
|
|
|
PRINT *, 'INFO:platform[RISCos]'
|
|
|
|
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
|
|
|
PRINT *, 'INFO:platform[SINIX]'
|
|
|
|
#elif defined(__UNIX_SV__)
|
|
|
|
PRINT *, 'INFO:platform[UNIX_SV]'
|
|
|
|
#elif defined(__bsdos__)
|
|
|
|
PRINT *, 'INFO:platform[BSDOS]'
|
|
|
|
#elif defined(_MPRAS) || defined(MPRAS)
|
|
|
|
PRINT *, 'INFO:platform[MP-RAS]'
|
|
|
|
#elif defined(__osf) || defined(__osf__)
|
|
|
|
PRINT *, 'INFO:platform[OSF1]'
|
|
|
|
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
|
|
|
PRINT *, 'INFO:platform[SCO_SV]'
|
|
|
|
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
|
|
|
PRINT *, 'INFO:platform[ULTRIX]'
|
|
|
|
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
|
|
|
PRINT *, 'INFO:platform[Xenix]'
|
2009-07-14 23:16:59 +04:00
|
|
|
#elif 1
|
|
|
|
# if 0
|
|
|
|
! The above 'elif 1' instead of 'else' is to work around a bug in the
|
|
|
|
! SGI preprocessor which produces both the __sgi and else blocks.
|
|
|
|
# endif
|
2009-06-25 16:45:19 +04:00
|
|
|
PRINT *, 'INFO:platform[]'
|
2010-12-16 17:33:06 +03:00
|
|
|
#endif
|
|
|
|
#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC))
|
|
|
|
# if defined(_M_IA64)
|
|
|
|
PRINT *, 'INFO:arch[IA64]'
|
|
|
|
# elif defined(_M_X64) || defined(_M_AMD64)
|
|
|
|
PRINT *, 'INFO:arch[x64]'
|
|
|
|
# elif defined(_M_IX86)
|
|
|
|
PRINT *, 'INFO:arch[X86]'
|
|
|
|
# endif
|
2009-06-25 16:45:19 +04:00
|
|
|
#endif
|
2015-02-17 21:24:31 +03:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
! Encode compiler version digits
|
|
|
|
#endif
|
|
|
|
#define DEC_8(n) (((n) / 10000000) % 10)
|
|
|
|
#define DEC_7(n) (((n) / 1000000) % 10)
|
|
|
|
#define DEC_6(n) (((n) / 100000) % 10)
|
|
|
|
#define DEC_5(n) (((n) / 10000) % 10)
|
|
|
|
#define DEC_4(n) (((n) / 1000) % 10)
|
|
|
|
#define DEC_3(n) (((n) / 100) % 10)
|
|
|
|
#define DEC_2(n) (((n) / 10) % 10)
|
|
|
|
#define DEC_1(n) (((n) ) % 10)
|
|
|
|
#define HEX_8(n) ((n)>>28 & 0xF)
|
|
|
|
#define HEX_7(n) ((n)>>24 & 0xF)
|
|
|
|
#define HEX_6(n) ((n)>>20 & 0xF)
|
|
|
|
#define HEX_5(n) ((n)>>16 & 0xF)
|
|
|
|
#define HEX_4(n) ((n)>>12 & 0xF)
|
|
|
|
#define HEX_3(n) ((n)>>8 & 0xF)
|
|
|
|
#define HEX_2(n) ((n)>>4 & 0xF)
|
|
|
|
#define HEX_1(n) ((n) & 0xF)
|
|
|
|
@CMAKE_Fortran_COMPILER_ID_VERSION_INFO@
|
|
|
|
|
2009-06-25 16:45:19 +04:00
|
|
|
END
|