Goddard-Fortran-Ecosystem / pFUnit

Parallel Fortran Unit Testing Framework
Other
172 stars 45 forks source link

Build fails when Real128 not available #338

Open jacobmerson opened 2 years ago

jacobmerson commented 2 years ago

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

mathomp4 commented 2 years ago

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