pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [2022Q3] mpich-3.4.3 compilation failure



>> It seems, though, that we don't deal with NetBSD specifics
>> here, but a compiler that does f90 without f08 support. I
>> presumed that people would use a compiler that supports Fortran
>> 2008 at least.
>
> What makes you say that?  Ref. the above wrt. which compiler is
> used.  Maybe I'll need to look further into why those files are
> either not built or installed.

Hmm...  The autoconf setup of mpi-ci has its own test whether f2008 is
sufficiently supported, as part of the PAC_FC_2008_SUPPORT autoconf
function -- there are apparently several copies of it in the mpi-ch
tree.  As part of this, it tries to build a C file which contains

#include <ISO_Fortran_binding.h>

This include file is installed as part of the gcc10 package, as

/usr/pkg/gcc10/lib/gcc/powerpc--netbsd/10.4.0/include/ISO_Fortran_binding.h

but is not installed as part of the base OS C compiler, most
probably because that version of GCC is not configured for Fortran.

The default C compiler is the base OS C compiler, and it will not
look in the above directory, so the autoconf test fails with

conftest.c:151:10: fatal error: ISO_Fortran_binding.h: No such file or directory
  151 | #include <ISO_Fortran_binding.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~

So even though the gfortran compiler sufficiently supports the f2008
standard, the package autoconf setup ends up concluding that it's
not sufficiently supported.

If I paste that C snippet from config.log into a file and explicitly
build it with "/usr/pkg/gcc10/bin/gcc -c f.c", it succeeds.

Looking a bit around, mk/compiler/gcc.mk indicates we can set
USE_PKGSRC_GCC=yes to force the use of pkgsrc gcc, and can also use
GCC_REQD to force indicate a minimal version.  Let's try that...

Yep, with this patch it installs with no PLIST conflicts:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/parallel/mpi-ch/Makefile,v
retrieving revision 1.99
diff -u -r1.99 Makefile
--- Makefile    25 Aug 2022 21:46:53 -0000      1.99
+++ Makefile    2 Oct 2022 11:56:10 -0000
@@ -52,6 +52,12 @@
 
 TEST_TARGET=   check
 
+.if ${OPSYS} == "NetBSD"
+# Needed for <ISO_Fortran_binding.h>
+USE_PKGSRC_GCC=                yes
+GCC_REQD=              10
+.endif
+
 # Re-enable when at version 2.x.
 #.include "../../parallel/hwloc/buildlink3.mk"
 .include "../../parallel/openpa/buildlink3.mk"

The pick of 10 as the GCC version can probably be discussed,
mk/compiler/gfortran.mk will typically either use 10 or 7, in my
case I already had 10 installed so went with that.

Regards,

- Havard


Home | Main Index | Thread Index | Old Index