[Dune-devel] Building dune-common with gcc-4.8 fails
Christian Engwer
christian.engwer at uni-muenster.de
Fri Jul 3 16:39:02 CEST 2015
Hi Carsten,
I can confirm this behaviour for debian testing.
The problem seems to be inherent to mpich, as the mpicc.mpich always
uses these flags, regardless of the chosen compiler, this
mpicc -cc=/usr/bin/gcc-4.8 ...
will results in the same problem.
I think we have to work around this. How about just removing all
"-f..." options from MPI flags?
Christian
On Wed, Jul 01, 2015 at 10:20:57PM +0200, Carsten Gräser wrote:
> Am 01.07.2015 um 15:50 schrieb Carsten Gräser:
> > Am 01.07.2015 um 15:40 schrieb Jö Fahlke:
> >> Am Wed, 1. Jul 2015, 15:35:12 +0200 schrieb Carsten Gräser:
> >>> Date: Wed, 01 Jul 2015 15:35:12 +0200
> >>> From: Carsten Gräser <graeser at mi.fu-berlin.de>
> >>> To: "dune-devel at dune-project.org" <dune-devel at dune-project.org>
> >>> Subject: Re: [Dune-devel] Building dune-common with gcc-4.8 fails
> >>>
> >>> Hi Jö,
> >>
> >>> CMakeCache shows that this flag is also present in MPI_CXX_COMPILE_FLAGS
> >>> and MPI_C_COMPILE_FLAGS.
> >>
> >> In your other Mail you bisected the problem to the patch that enabled mpi by
> >> default in cmake. So this sounds very mpi-related. Maybe that flag is
> >> extracted from mpicc? And you don't have a problem before the patch because
> >> dune-common did not look for mpi then, but is doing it now?
> >>
> >> Which MPI are you using?
> > It's mpich-3.1.
> >
> > I also noticed that passing the compiler to mpic++ via -cxx preserves
> > this -fstack-protector-strong option which seems to be the ubuntu default.
>
> I guess I've found the origin of the problem, but I don't now
> who's to blame and how to fix this: Recent Ubuntu decided to enable
>
> -D_FORTIFY_SOURCE=2 -fstack-protector-strong
>
> by default for security reasons. This also seems to imply that these
> flags are by default used with the mpi compiler wrappers, at least
> according to
>
> mpicxx -show
>
> Not surprisingly the cmake module FindMPI detects these flags and
> stores them in MPI_C_COMPILER_FLAGS which we forwarded to
> MPI_DUNE_COMPILE_FLAGS and thus use when building dune
> applications with mpi. The problem is that the second flag is
> not supported with gcc versions < 4.9, but the flag is always passed.
> It's a little unclear, who is to blame for this problem:
>
> a)Dune is blindly passing the mpi compile flags regardless of the
> selected compiler.
>
> b)FindMPI does not allow to pass a compiler in order to detect
> suitable flags.
>
> c)Even "mpicc -cc=/usr/bin/gcc-4.8" does not provide suitable flags.
>
> d)Is it a ubuntu bug to always provide these flags with mpi,
> regardless of the compiler?
>
> I'd like to at least circumvent the problem to be able to test
> with all my compilers, but it seems that one cannot overwrite
> the MPI_C_COMPILER_FLAGS with a command line argument.
> For now I have to manually remove the flag in the cache
> if I want to test with a packaged but older compiler. Does
> anybody more familiar with mpi and cmake now a better way
> to get around this?
>
> Best,
> Carsten
>
>
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel
--
Prof. Dr. Christian Engwer
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster
E-Mail christian.engwer at uni-muenster.de
Telefon +49 251 83-35067
FAX +49 251 83-32729
More information about the Dune-devel
mailing list