new_compiler Subroutine

public subroutine new_compiler(self, fc, cc, cxx, echo, verbose)

Create new compiler instance

Arguments

Type IntentOptional Attributes Name
type(compiler_t), intent(out) :: self

New instance of the compiler

character(len=*), intent(in) :: fc

Fortran compiler name or path

character(len=*), intent(in) :: cc

C compiler name or path

character(len=*), intent(in) :: cxx

C++ Compiler name or path

logical, intent(in) :: echo

Echo compiler command

logical, intent(in) :: verbose

Verbose mode: dump compiler output


Source Code

subroutine new_compiler(self, fc, cc, cxx, echo, verbose)
    !> New instance of the compiler
    type(compiler_t), intent(out) :: self
    !> Fortran compiler name or path
    character(len=*), intent(in) :: fc
    !> C compiler name or path
    character(len=*), intent(in) :: cc
    !> C++ Compiler name or path
    character(len=*), intent(in) :: cxx
    !> Echo compiler command
    logical, intent(in) :: echo
    !> Verbose mode: dump compiler output
    logical, intent(in) :: verbose

    self%id = get_compiler_id(fc)

    self%echo = echo
    self%verbose = verbose
    self%fc = fc
    if (len_trim(cc) > 0) then
      self%cc = cc
    else
      call get_default_c_compiler(self%fc, self%cc)
    end if

    if (len_trim(cxx) > 0) then
      self%cxx = cxx
    else
      call get_default_cxx_compiler(self%fc, self%cxx)
    end if

end subroutine new_compiler