Bug#791676: libmpich-dev: mpicc adds compiler specific flags and fails for older gcc versions
Christian Engwer
christi at mathe-macht-spass.de
Tue Jul 7 13:55:27 UTC 2015
Package: libmpich-dev
Version: 3.1-5+b2
Severity: normal
Dear Maintainer,
the mpicc.mpich allows to exchange the underlying compiler via the "-cc="
parameter.
Calling
> mpicc.mpich -cc=gcc-4.8 test.c
fails, as gcc will complain about unknown compiler flags.
I'd expect that passing different compiler via -cc=... results working mpi
program.
%%%%%%%%%%
Let's look at this in a bit more details...
The problem underneath becomes obvious when asking for the compiler flags:
> mpicc.mpich -compile_info
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror
=format-security -Wl,-z,relro -I/usr/include/mpich -L/usr/lib/x86_64-linux-gnu
-lmpich -lopa -lmpl -lrt -lcr -lpthread
the output contains the "-fstack-protector-strong" parameter, which is not
available with gcc-4.8
alternatively you can ask via pkg-config
> pkg-config --cflags mpich
-D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-
security -I/usr/include/mpich
The problem is here that the actual compiler flags and the compiler are mixed.
When switching to use "-fstack-protector-strong" Debian basically decided to
use a different compiler, so in my opinion the right configuration is (in make-
style):
CC="gcc -fstack-protector-strong"
CFLAGS="-D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Werror=format-security
-I/usr/include/mpich"
When the "-fstack-protector-strong" parameter is part of the compiler command,
the compiler can be exchanged without problems.
-- System Information:
Debian Release: stretch/sid
APT prefers proposed-updates
APT policy: (500, 'proposed-updates'), (500, 'oldoldstable'), (500, 'testing'), (400, 'stable'), (300, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages libmpich-dev depends on:
ii g++ 4:4.9.2-4
ii gfortran 4:4.9.2-4
ii libc6 2.19-18
ii libcr-dev 0.8.5-2.2
ii libcr0 0.8.5-2.2
ii libmpich12 3.1-5+b2
ii libmpl-dev 3.1-5+b2
ii libopa-dev 3.1-5+b2
Versions of packages libmpich-dev recommends:
ii mpich 3.1-5+b2
libmpich-dev suggests no packages.
-- no debconf information
More information about the debian-science-maintainers
mailing list