Skip to content

Commit 07f8e01

Browse files
committed
qp, xdp support detection
1 parent b6af95f commit 07f8e01

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/fpm_compiler.F90

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ module fpm_compiler
121121
procedure :: load_from_toml => compiler_load
122122
!> Fortran feature support
123123
procedure :: check_fortran_source_runs
124+
procedure :: with_xdp
125+
procedure :: with_qp
124126
!> Return compiler name
125127
procedure :: name => compiler_name
126128

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

14791481
end function check_fortran_source_runs
14801482

1483+
!> Check if the current compiler supports 128-bit real precision
1484+
logical function with_qp(self)
1485+
!> Instance of the compiler object
1486+
class(compiler_t), intent(in) :: self
1487+
with_qp = self%check_fortran_source_runs &
1488+
('if (selected_real_kind(33) == -1) stop 1; end')
1489+
end function with_qp
1490+
1491+
!> Check if the current compiler supports 80-bit "extended" real precision
1492+
logical function with_xdp(self)
1493+
!> Instance of the compiler object
1494+
class(compiler_t), intent(in) :: self
1495+
with_xdp = self%check_fortran_source_runs &
1496+
('if (any(selected_real_kind(18) == [-1, selected_real_kind(33)])) stop 1; end')
1497+
end function with_xdp
1498+
14811499
end module fpm_compiler

0 commit comments

Comments
 (0)