[Dune-devel] Building dune-common with gcc-4.8 fails

Carsten Gräser graeser at mi.fu-berlin.de
Tue Jul 7 07:24:03 CEST 2015


Hi Christian,

Am 03.07.2015 um 16:39 schrieb Christian Engwer:
> Hi Carsten,
> 
> I can confirm this behaviour for debian testing.
that's a little sad, because it means that none of our
debian-using dev's has lately tested the release branch
with any but the newest compilers.

> 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?
I don't know if this is viable. Maybe some of them are necessary
to compile with mpi?

Unfortunately cmake does not allow to overwrite these flags
properly. For the moment I use the attached patch and pass
the corresponding flag via CMAKE_FLAGS.

Carsten



> 
> 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. Carsten Gräser
Freie Universität Berlin
Institut für Mathematik
Arnimallee 6
14195 Berlin, Germany
phone: +49 30 838 72637
fax  : +49 30 838 472637
email: graeser at mi.fu-berlin.de
URL  : http://page.mi.fu-berlin.de/graeser
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dune-common-overwrite-MPI_C_COMPILE_FLAGS.patch
Type: text/x-patch
Size: 715 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20150707/066cd013/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20150707/066cd013/attachment.sig>


More information about the Dune-devel mailing list