[Dune] strange MPI with CMAKE

Aleksejs Fomins aleksejs.fomins at lspr.ch
Wed Jan 21 17:46:47 CET 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear Dominic,

Works. Very precise. Thank you :)

Aleksejs

On 21/01/15 17:42, Dominic Kempf wrote:
> Dear Alekseij,
> 
> you are not adding the MPI flags to your second target, that is why
> any MPI related names are not found.
> 
> You have to call
> 
> add_dune_mpi_flags(target)
> 
> on a target in order to add mpi flags. add_dune_parmetis_flags
> internally calls that macro. That is why you dont experience
> problems with parmetis applications.
> 
> Dominic
> 
> On Wed, Jan 21, 2015 at 5:31 PM, Aleksejs Fomins
> <aleksejs.fomins at lspr.ch> wrote:
> 
>> Dear Dune,
>> 
>> I have 1 test program, which compiles and runs. It uses MPI and
>> ParMetis I have now written a 2nd test program. It uses MPI but
>> does not use ParMetis. I compile the 2nd test and I get the
>> error
>> 
>> error: ‘MPI_Comm’ was not declared in this scope MPI_Comm comm =
>> Dune::MPIHelper::getCommunicator();
>> 
>> although statements like that work no problem in the 1st test.
>> From my point of view, the ONLY difference between the tests in
>> terms of CMAKE is that one of them uses ParMetis and the other
>> does not.
>> 
>> 
>> Now here is the trick. I decided to make the tests completely
>> symmetric by
>> 
>> if(HAVE_MPI) add_dune_parmetis_flags(test1) 
>> add_dune_parmetis_flags(test2)   # I inserted this line 
>> endif(HAVE_MPI)
>> 
>> Now both tests compile.
>> 
>> 
>> I mean, this solution works, but I am sure I am doing something
>> wrong.
>> 
>> Opts file and cmake file attached
>> 
>> Cheers, Aleksejs
>> 
>> _______________________________________________ Dune mailing
>> list Dune at dune-project.org 
>> http://lists.dune-project.org/mailman/listinfo/dune
>> 
>> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJUv9f3AAoJEDkNM7UOEwMZm/YQAIQlbdreDIO7N3cQwxOsGrZk
dBUrMfaGMp4eD0MYxXfUwBqy83jHUspKLoWXuJPr2WIc0MC0LmEDn18rDjwurQZ0
90aCNx2XQrrvvAynzFP5EHy1LgPjif+oJbSTuRBkc+uo/Lh+lk5HRfo31EQ0DMIS
NK+ajPj5p4sNFLT3b0QDq0Sl0H/ovtFXa9EVL4MSFba/VwkrtLxxnJIS+cxCn2ka
J7hB/E0/+AjznAzx7uuFN6rKE2Pfjg0QK1uvw35vxPAFpD9gFZR8gzGwcKzIAOIH
JVvDLWxjRDsgEGuIvwUOccoAoaDh4ce2qq4Huatt/EX/z9OILHnkAPLqHEtsGMgE
iaoe5vfIT/Um8n5PLzDuunVhkYVyV2NHlPOk5S3Tqfhdd6rlEwJL4A+teyZR1hch
pUnEf30awHbaOkiIqusXxbvFv/BF8TNUjoAfovNBJhnD05ng96uR5i6caasfZiNI
lumCSEowsfphsIvT1AM5g9jM+tFAnYaDs2BGS5YNipv5sTY0ZQGs+46cH82361q0
QdeLgFPCHMgJUNVuaSsMIv7h5VUJtj9/GXFOkT08WsoXGGEHA2fIqLKxchJ0ra0S
vAcWinyQYnmUrQu1fAQxj1dvBjTgp1nXjmIeQrx1fcg5ZBcrRIxRhUjZCxxhmC+4
fwKUO23sFLDZOmqZ6QmE
=0Hzk
-----END PGP SIGNATURE-----




More information about the Dune mailing list