get_compiler_version Function

public function get_compiler_version() result(compiler_version)

Arguments

None

Return Value character(len=:), allocatable


Called by

proc~~get_compiler_version~~CalledByGraph proc~get_compiler_version get_compiler_version proc~output_system_log output_system_log proc~output_system_log->proc~get_compiler_version interface~output_system_log type_output%output_system_log interface~output_system_log->proc~output_system_log

Source Code

    function get_compiler_version() result(compiler_version)
        implicit none
        character(:), allocatable :: compiler_version
        integer(int32) :: year, major, minor

#ifdef __GFORTRAN__
#ifdef __GNUC__
        compiler_version = to_string(__GNUC__)//"."//to_string(__GNUC_MINOR__)//"."//to_string(__GNUC_PATCHLEVEL__)
#else
        compiler_version = "Unknown Compiler Version"
#endif
#elif defined(__INTEL_COMPILER)
        year = __INTEL_COMPILER / 10000
        major = mod(__INTEL_COMPILER / 100, 100)
        minor = mod(__INTEL_COMPILER, 100)

        compiler_version = to_string(year)//"."//to_string(major)//"."//to_string(minor)
#elif defined(__PGI) || defined(__NVCOMPILER)
        compiler_version = to_string(__NVCOMPILER_MAJOR__)//"."//to_string(__NVCOMPILER_MINOR__)//"."//to_string(__NVCOMPILER_PATCHLEVEL__)
#else
        compiler_version = "Unknown Compiler Version"
#endif

    end function get_compiler_version