Build failures, but build succeds
I'm getting build errors in the FreeBSD port with the version 3.0.0:
/usr/local/bin/mpicc -DNDEBUG -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -fPIC -c _configtest.c -o _configtest.o
/usr/local/bin/mpicc /usr/local/lib/gcc7/libgcc_s.so -lmpifort -Wl,-rpath=/usr/local/lib/gcc7 -L/usr/local/lib/gcc7 -B/usr/local/bin -fstack-protector -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer _configtest.o -lvt.mpi -o _configtest
/usr/local/bin/ld: cannot find -lvt.mpi
cc: error: linker command failed with exit code 1 (use -v to see invocation)
/usr/local/bin/mpicc /usr/local/lib/gcc7/libgcc_s.so -lmpifort -Wl,-rpath=/usr/local/lib/gcc7 -L/usr/local/lib/gcc7 -B/usr/local/bin -fstack-protector -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer _configtest.o -L/usr/local/lib -Lbuild/temp.freebsd-11.2-STABLE-amd64-2.7 -o _configtest
_configtest.o: In function `main':
_configtest.c:(.text+0x9): undefined reference to `MPI_Status_c2f'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Despite the errors, build succeeds and the tests pass.
Comments (11)
-
-
reporter $ mpif90 -show gfortran7 -Wl,-rpath=/usr/local/lib/gcc7 -L/usr/local/lib/gcc7 -B/usr/local/bin -I/usr/local/include -I/usr/local/include -L/usr/local/lib -lmpifort -Wl,-rpath -Wl,/usr/local/lib -lmpi
-
Does
libmpifort.so
actually exists? Can you figure out if the symbolMPI_Status_c2f
is available on any of the MPICH shared libraries? -
reporter libmpifort.so
exists.This symbol is in
libmpi
$ nm /usr/local/lib/libmpi.a | grep MPI_Status_c2f 0000000000000000 T PMPI_Status_c2f
pkg-config
says that libmpi is what should be linked:$ pkg-config --libs mpich -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib -lmpi -lpthread
-
libmpi.a
is static, so we should not be looking at that one. You should really look atlibmpi.so
, but given than the symbol is inlibmpi.a
, it should be inlibmpi.so
(I hope). Doesnm
work onlibmpi.so
to double check?About
pkg-config
saying that libmpi is what should be linked, please note mpi4py is using thempicc
compiler wrapper, that it should take care of that, runmpicc -link-info
to confirm.But wait! The symbol name in your
libmpi.a
starts withPMPI_
(corresponds to the MPI profiling interface), and notMPI_
(the regular MPI calls), look what I get in my Fedora system:$ readelf -s /usr/lib64/mpich/lib/libmpi.so | grep MPI_Status_c2 447: 00000000000e7760 94 FUNC GLOBAL DEFAULT 11 PMPI_Status_c2f 572: 00000000000e7760 94 FUNC WEAK DEFAULT 11 MPI_Status_c2f
So something weird is going on with the MPICH library in your system, something about Fortran interoperability seems to be broken. You should report it to the MPICH package maintainers.
All that being said, mpi4py should build and run just fine if some pieces of Fortran interoperability are missing/broken. If the MPICH library gets fixed eventually, you should rebuild the mpi4py package.
-
reporter *.a
libraries should have about the same symbol set as their*.so
counterpart. But yes,MPI_Status_c2f
is missing inlibmpi.so
for an unknown reason. -
Well, at this point, you have no other option than reporting this issue to the FreeBSD MPICH package maintainers. In the mean time, you can build and use mpi4py without major issues. I do not expect too much code (if any) making use of Python <-> Fortran conversions for
MPI_Status
. -
reporter Unfortunately,
mpich
package is unmaintained, and I will have to fix this myself. I will ask on the mpich ML. -
Can you point me to the build script that is being used to configure and build MPICH?
-
reporter The
mpich
port is here: https://svnweb.freebsd.org/ports/head/net/mpich/ -
- changed status to resolved
- Log in to comment
Yes, these are configure tests to check for the availability of extra stuff. However, it seems that something is wrong with Fortran stuff. What's the output of
mpif90 -show
?