Bug#1078026: -lmpi_mpifh does not work
Eli Schwartz
eschwartz93 at gmail.com
Tue Aug 6 08:24:34 BST 2024
Package: libopenmpi-dev
Version: 4.1.6-13.3
When I attempt to run the mesonbuild testsuite as downloaded from
https://github.com/mesonbuild/meson, using the following command:
./run_project_tests.py -v --only frameworks/17
it is intended to test that meson can detect openmpi and build a dummy
project against it.
Instead I get this error:
(inprocess) $ setup --prefix /usr --libdir lib 'test cases/frameworks/17
mpi' '/meson/b 6903cddbd2' --backend=ninja -Dmethod=pkg-config
The Meson build system
Version: 1.5.99
Source dir: /meson/test cases/frameworks/17 mpi
Build dir: /meson/b 6903cddbd2
Build type: native build
Project name: mpi
Project version: undefined
C compiler for the host machine: cc (gcc 14.2.0 "cc (Debian 14.2.0-1)
14.2.0")
C linker for the host machine: cc ld.bfd 2.43
C++ compiler for the host machine: c++ (gcc 14.2.0 "c++ (Debian
14.2.0-1) 14.2.0")
C++ linker for the host machine: c++ ld.bfd 2.43
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
Run-time dependency MPI for c found: YES 4.1.6
Run-time dependency MPI for cpp found: YES 4.1.6
Checking if "C++ MPI" with dependency ompi-cxx: links: YES
Fortran compiler for the host machine: gfortran (gcc 14.2.0 "GNU Fortran
(Debian 14.2.0-1) 14.2.0")
Fortran linker for the host machine: gfortran ld.bfd 2.43
Run-time dependency MPI for fortran found: YES 4.1.6
Checking if "Fortran MPI" with dependency ompi-fort: links: YES
Run-time dependency MPI found: YES 4.1.6
Build targets in project: 3
mpi undefined
User defined options
backend: ninja
libdir : lib
method : pkg-config
prefix : /usr
Found ninja-1.12.1 at /usr/bin/ninja
ninja explain: deps for 'exec.p/main.c.o' are missing
ninja explain: exec.p/main.c.o is dirty
ninja explain: exec is dirty
ninja explain: deps for 'execpp.p/main.cpp.o' are missing
ninja explain: execpp.p/main.cpp.o is dirty
ninja explain: execpp is dirty
ninja explain: output exef.p/depscan.dd doesn't exist
ninja explain: deps for 'exef.p/main.f90.o' are missing
ninja explain: exef.p/main.f90.o is dirty
ninja explain: exef is dirty
ninja explain: meson-test-prereq is dirty
ninja explain: output meson-benchmark-prereq of phony edge with no
inputs doesn't exist
ninja explain: meson-benchmark-prereq is dirty
ninja explain: exec is dirty
ninja explain: execpp is dirty
ninja explain: exef is dirty
[1/7] Compiling C object exec.p/main.c.o
[2/7] Linking target exec
[3/7] Module scanner.
ninja explain: loading dyndep file 'exef.p/depscan.dd'
ninja explain: output exef.p/main.f90.o doesn't exist
ninja explain: exef.p/main.f90.o is dirty
ninja explain: exec is dirty
ninja explain: execpp is dirty
ninja explain: exef is dirty
ninja explain: meson-test-prereq is dirty
ninja explain: meson-benchmark-prereq is dirty
ninja explain: exec is dirty
ninja explain: execpp is dirty
ninja explain: exef is dirty
[4/7] Compiling Fortran object exef.p/main.f90.o
[5/7] Linking target exef
FAILED: exef
gfortran -o exef exef.p/main.f90.o -Wl,--no-undefined
-Wl,-rpath,/usr/lib/x86_64-linux-gnu/openmpi/lib/../../fortran/gfortran:/usr/lib/x86_64-linux-gnu/openmpi/lib
-Wl,-rpath-link,/usr/lib/x86_64-linux-gnu/openmpi/lib/../../fortran/gfortran
-Wl,-rpath-link,/usr/lib/x86_64-linux-gnu/openmpi/lib -Wl,--start-group
/usr/lib/x86_64-linux-gnu/openmpi/lib/../../fortran/gfortran/libmpi_usempif08.so
/usr/lib/x86_64-linux-gnu/openmpi/lib/../../fortran/gfortran/libmpi_usempi_ignore_tkr.so
/usr/lib/x86_64-linux-gnu/openmpi/lib/../../fortran/gfortran/libmpi_mpifh.so
/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so -Wl,--end-group
/usr/bin/ld: exef.p/main.f90.o: in function `MAIN__':
/meson/b 6903cddbd2/../test cases/frameworks/17
mpi/main.f90:1:(.text+0x13): undefined reference to `mpi_init_'
/usr/bin/ld: /meson/b 6903cddbd2/../test cases/frameworks/17
mpi/main.f90:1:(.text+0xc3): undefined reference to `mpi_initialized_'
/usr/bin/ld: /meson/b 6903cddbd2/../test cases/frameworks/17
mpi/main.f90:1:(.text+0x16c): undefined reference to `mpi_finalize_'
collect2: error: ld returned 1 exit status
[6/7] Compiling C++ object execpp.p/main.cpp.o
ninja: build stopped: subcommand failed.
Let's see the link flags it finds:
$ pkg-config --libs ompi-fort
-L/usr/lib/x86_64-linux-gnu/openmpi/lib/../../fortran/gfortran
-L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi_usempif08
-lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi
This says to link against:
$ realpath
/usr/lib/x86_64-linux-gnu/openmpi/lib/../../fortran/gfortran/libmpi_mpifh.so
/usr/lib/x86_64-linux-gnu/libmpi_mpifh-gfortran.so.40.30.0
which in turn does not contain the desired symbols:
$ nm -D /usr/lib/x86_64-linux-gnu/libmpi_mpifh-gfortran.so.40.30.0
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
w __cxa_finalize
w __gmon_start__
In fact, I wonder what this library exists for at all. It's not a valid
library for building openmpi software against. It doesn't appear to be
installed by any other distros. It seems like it is something Debian has
patched in, but I cannot figure out why.
--
Eli Schwartz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20240806/a74795f0/attachment-0001.sig>
More information about the debian-science-maintainers
mailing list