[Pkg-openmpi-maintainers] Bug#812991: openmpi-common: mpicc fails when both openmpi and lam are installed due to -L/usr/lib in mpicc-wrapper-data.txt
Tomas Forsman
stric at cs.umu.se
Thu Jan 28 12:19:21 UTC 2016
Package: openmpi-common
Version: 1.6.5-9.1
Severity: important
Tags: patch
Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
User tried to compile openmpi program with mpicc.openmpi, while having
liblam4-dev installed at the same time.
* What exactly did you do (or not do) that was effective (or
ineffective)?
mpicc.openmpi -o outfile infile.c
* What was the outcome of this action?
infile.c:(.text+0x40): undefined reference to `ompi_mpi_comm_world'
infile.c:(.text+0x51): undefined reference to `ompi_mpi_comm_world'
infile.c:(.text+0x9e): undefined reference to `ompi_mpi_comm_world'
infile.c:(.text+0xa8): undefined reference to `ompi_mpi_char'
infile.c:(.text+0xeb): undefined reference to `ompi_mpi_comm_world'
infile.c:(.text+0xf5): undefined reference to `ompi_mpi_char'
* What outcome did you expect instead?
Silence and a linked binary.
*** End of the template - remove these template lines ***
Problem:
lrwxrwxrwx 1 root root 27 Jun 26 2015 /usr/lib/libmpi.so ->
/etc/alternatives/libmpi.so
lrwxrwxrwx 1 root root 18 Jun 26 2015 /etc/alternatives/libmpi.so ->
/usr/lib/liblam.so
mpicc.openmpi gathers compile info from /usr/share/openmpi/mpicc.openmpi-
wrapper-data.txt
which contains:
linker_flags= -L/usr//lib
libs=-lmpi -ldl -lhwloc
libdir=${libdir}
'mpicc.openmpi -showme' gives:
gcc -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread
-L/usr//lib -L/usr/lib/openmpi/lib -lmpi -ldl -lhwloc
Meaning it will pick -lmpi from /usr/lib (the LAM one) instead of
/usr/lib/openmpi/lib (the openmpi one)
Solution:
Removing '-L/usr//lib' from the linker_flags line seems to work fine.
-- System Information:
Debian Release: 8.3
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
-- no debconf information
More information about the Pkg-openmpi-maintainers
mailing list