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



> 	OK, I have found information on several web pages and I have added to
> option.mk:
>
> CONFIGURE_ARGS+=   FFLAGS=-m64 FCFLAGS=-m64
>
> 	In /etc/mk.conf, I have added:
>
> PKG_OPTIONS.mpich=f90

Hmm.  The package's options.mk already has

PKG_SUGGESTED_OPTIONS=  f90

so that option should be "default on".

Otherwise, I did my build on a 32-bit (non-i386) host, so didn't
hit the first one above.

> 	Now, mpich is configured. But after a few seconds, compilation aborts
> with :
>
>   CC       src/sock/mpl_sockaddr.lo
> src/sock/mpl_sockaddr.c: In function 'MPL_get_sockaddr':
> src/sock/mpl_sockaddr.c:101:24: error: 'AI_V4MAPPED' undeclared (first
> use in this function)
>      ai_hint.ai_flags = AI_V4MAPPED;
>                         ^~~~~~~~~~~
> src/sock/mpl_sockaddr.c:101:24: note: each undeclared identifier is
> reported only once for each function it appears in
> *** [src/sock/mpl_sockaddr.lo] Error code 1
>
> 	I have added in file:
> #define AI_V4MAPPED 0x10000
> to compile object as AI_V4MAPPED is not implemented.

I have a fix lined up for this along the lines of

: {9} cat patches/patch-src_mpi_romio_mpl_src_sock_mpl__sockaddr.c
$NetBSD$

Conditionalize use of AI_V4MAPPED (not present on NetBSD).

--- src/mpi/romio/mpl/src/sock/mpl_sockaddr.c.orig      2021-12-16 16:59:29.000000000 +0000
+++ src/mpi/romio/mpl/src/sock/mpl_sockaddr.c
@@ -98,7 +98,9 @@ int MPL_get_sockaddr(const char *s_hostn
     ai_hint.ai_family = af_type;
     ai_hint.ai_socktype = SOCK_STREAM;
     ai_hint.ai_protocol = IPPROTO_TCP;
+#ifdef AI_V4MAPPED
     ai_hint.ai_flags = AI_V4MAPPED;
+#endif
     ret = getaddrinfo(s_hostname, NULL, &ai_hint, &ai_list);
     if (ret) {
         return ret;
: {10} 

There are three more files which has the same construct, ref:

? patches/patch-src_mpi_romio_mpl_src_sock_mpl__sockaddr.c
? patches/patch-src_mpl_src_sock_mpl__sockaddr.c
? patches/patch-src_pm_hydra2_mpl_src_sock_mpl__sockaddr.c
? patches/patch-src_pm_hydra_mpl_src_sock_mpl__sockaddr.c

(partial update from my "cvs update")

As far as I know, the NetBSD socket API doesn'ta support
dual-address-family IPv4 / IPv6 sockets and reception of IPv4
traffic via a "v4-address-mapped-into-ipv6" address on one and
the same socket as can be used for IPv6.  I only know of Linux
which supports that, and I suspect the spec says AI_V4MAPPED is
an optional symbol.  Code which cares about portability should
therefore not make unconditional use of that symbol.

> 	With these modifications, make create libraries and programs. But make
> package fails with :
>
> => Automatic manual page handling
> => Generating post-install file lists
> pkg_create: can't stat
> `/usr/src/pkgsrc/parallel/mpi-ch/work/.destdir/usr/pkg/include/mpi_c_interface_cdesc.mod'

I see the same (same set of files which fails to be installed).

I don't know why the set of files installed apparently varies
with OS / platform.  It's conceivable that those entries should
be made conditional; I've not looked further at that.

> 	How can I build this package?

You could fudge the PLIST locally until this build issue is
properly sorted in pkgsrc:

% make print-PLIST > PLIST.new

The old PLIST from the entries starting with "man" needs to be
sorted to minimize the diff...  I used

% vi PLIST
/^man
!}sort
ZZ

Check what appears to be changed:

% diff -u PLIST PLIST.new

Some of the entries in the old PLIST are conditional on "f90", so
that needs to be carried forward.  Fix up PLIST.new according to
the diff, insert ${PLIST.f90} in front of the entries which need
that.  In the end, I ended up with this diff:

% diff -u PLIST PLIST.new
--- PLIST       2022-10-01 15:58:10.306641807 +0200
+++ PLIST.new   2022-10-01 16:01:48.523812366 +0200
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.25 2022/08/25 21:46:53 thor Exp $
+@comment $NetBSD$
 bin/hydra_nameserver
 bin/hydra_persist
 bin/hydra_pmi_proxy
@@ -18,23 +18,12 @@
 include/mpi.h
 ${PLIST.f90}include/mpi.mod
 ${PLIST.f90}include/mpi_base.mod
-${PLIST.f90}include/mpi_c_interface_cdesc.mod
-${PLIST.f90}include/mpi_c_interface_glue.mod
-${PLIST.f90}include/mpi_c_interface.mod
-${PLIST.f90}include/mpi_c_interface_nobuf.mod
-${PLIST.f90}include/mpi_c_interface_types.mod
 ${PLIST.f90}include/mpi_constants.mod
 ${PLIST.f90}include/mpi_sizeofs.mod
-${PLIST.f90}include/mpi_f08_callbacks.mod
-${PLIST.f90}include/mpi_f08_compile_constants.mod
-${PLIST.f90}include/mpi_f08_link_constants.mod
-${PLIST.f90}include/mpi_f08.mod
-${PLIST.f90}include/mpi_f08_types.mod
 include/mpicxx.h
 ${PLIST.f90}include/mpif.h
 include/mpio.h
 include/mpiof.h
-${PLIST.f90}include/pmpi_f08.mod
 ${PLIST.f90}lib/libfmpich.so
 lib/libmpi.la
 lib/libmpich.so
%

With this in place, you can do:

% mv PLIST PLIST.old
% mv PLIST.new PLIST
% rm work/.PLIST*
% make install

and the package should install.

Best regards,

- Håvard


Home | Main Index | Thread Index | Old Index