Skip to content

Commit

Permalink
qp, xdp support detection
Browse files Browse the repository at this point in the history
  • Loading branch information
perazz committed Jun 16, 2024
1 parent b6af95f commit 07f8e01
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/fpm_compiler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ module fpm_compiler
procedure :: load_from_toml => compiler_load
!> Fortran feature support
procedure :: check_fortran_source_runs
procedure :: with_xdp
procedure :: with_qp
!> Return compiler name
procedure :: name => compiler_name

Expand Down Expand Up @@ -1478,4 +1480,20 @@ logical function check_fortran_source_runs(self, input) result(success)

end function check_fortran_source_runs

!> Check if the current compiler supports 128-bit real precision
logical function with_qp(self)
!> Instance of the compiler object
class(compiler_t), intent(in) :: self
with_qp = self%check_fortran_source_runs &
('if (selected_real_kind(33) == -1) stop 1; end')
end function with_qp

!> Check if the current compiler supports 80-bit "extended" real precision
logical function with_xdp(self)
!> Instance of the compiler object
class(compiler_t), intent(in) :: self
with_xdp = self%check_fortran_source_runs &
('if (any(selected_real_kind(18) == [-1, selected_real_kind(33)])) stop 1; end')
end function with_xdp

end module fpm_compiler

0 comments on commit 07f8e01

Please sign in to comment.