get_default_cxx_compiler Subroutine

public subroutine get_default_cxx_compiler(f_compiler, cxx_compiler)

Get C++ Compiler.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: f_compiler
character(len=:), intent(out), allocatable :: cxx_compiler

Variables

Type Visibility Attributes Name Initial
integer(kind=compiler_enum), public :: id

Source Code

subroutine get_default_cxx_compiler(f_compiler, cxx_compiler)
    character(len=*), intent(in) :: f_compiler
    character(len=:), allocatable, intent(out) :: cxx_compiler
    integer(compiler_enum) :: id

    id = get_compiler_id(f_compiler)

    select case(id)

    case(id_intel_classic_nix, id_intel_classic_mac, id_intel_classic_windows)
        cxx_compiler = 'icpc'

    case(id_intel_llvm_nix,id_intel_llvm_windows)
        cxx_compiler = 'icpx'

    case(id_flang, id_flang_new, id_f18)
        cxx_compiler='clang++'

    case(id_ibmxl)
        cxx_compiler='xlc++'

    case(id_lfortran)
        cxx_compiler = 'cc'

    case(id_gcc)
        cxx_compiler = 'g++'

    case default
        ! Fall-back to using Fortran compiler
        cxx_compiler = f_compiler
    end select

end subroutine get_default_cxx_compiler