pFUnit icon indicating copy to clipboard operation
pFUnit copied to clipboard

Build fails when Real128 not available

Open jacobmerson opened this issue 3 years ago • 1 comments

There are a few places where the REAL128 type specification is used that is not behind include guards which prevents pfunit from building.

jacobmerson avatar Feb 02 '22 05:02 jacobmerson

I just hit this myself in test building pFUnit on an M1 Mac with a hand-built GCC.

To wit, I found I needed for pFUnit v4.3.0:

diff --git a/src/funit/fhamcrest/BaseDescription.F90 b/src/funit/fhamcrest/BaseDescription.F90
index 0eda5a4..0775fbf 100644
--- a/src/funit/fhamcrest/BaseDescription.F90
+++ b/src/funit/fhamcrest/BaseDescription.F90
@@ -40,10 +40,14 @@ module pf_BaseDescription
       module procedure description_of_int64
       module procedure description_of_real32
       module procedure description_of_real64
+#if (defined(_ISO_REAL128) && (_ISO_REAL128 != _REAL_DEFAULT_KIND) && (_ISO_REAL128 != _DOUBLE_DEFAULT_KIND))
       module procedure description_of_real128
+#endif
       module procedure description_of_complex32
       module procedure description_of_complex64
+#if (defined(_ISO_REAL128) && (_ISO_REAL128 != _REAL_DEFAULT_KIND) && (_ISO_REAL128 != _DOUBLE_DEFAULT_KIND))
       module procedure description_of_complex128
+#endif
    end interface description_of

 contains

mathomp4 avatar May 12 '22 15:05 mathomp4