Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile Fortran application with -std=f2008 using mpi_f08 module #1323

Closed
paulromano opened this issue Jan 25, 2016 · 7 comments
Closed

Comments

@paulromano
Copy link

I have a Fortran application that uses MPI (via mpi_f08) and is normally compiled with gfortran -std=f2008. When trying to compile against OpenMPI 1.10.2, I get the following build errors:

/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_comm_copy_attr_function’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_type_copy_attr_function’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_win_copy_attr_function’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_comm_copy_attr_function’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_type_copy_attr_function’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_win_copy_attr_function’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_comm_dup_fn’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_comm_null_copy_fn’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_type_dup_fn’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_type_null_copy_fn’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_win_dup_fn’
/home/romano/openmc/src/message_passing.F90:5:6:

   use mpi_f08
      1
Error: GNU Extension: LOGICAL dummy argument ‘flag’ at (1) with non-C_Bool kind in BIND(C) procedure ‘mpi_win_null_copy_fn’

I should note that the errors still persist with -std=f2008ts as well. I'm on Ubuntu 15.10 with gfortran 5.2.1 which I used to build OpenMPI from source. Not sure if there is a solution for this given the problems with logicals and C interoperability...

@ggouaillardet
Copy link
Contributor

@paulromano thanks for the report
so gfortran 5.2.1 is more strict than previous versions when compiling with -std=f2008

at first glance, there is no need for C/Fortran interoperability here (though it is simple and convenient). i ll try to find a solution for that.

@jsquyres
Copy link
Member

@ggouaillardet Looks like this is the fault of open-mpi/ompi-release#851 -- that PR introduced some BIND(C)'s to subroutines with LOGICAL parameters, which is not allowed.

@jsquyres
Copy link
Member

PR to fix this issue: #1327

@jsquyres
Copy link
Member

jsquyres commented Feb 1, 2016

@paulromano Just curious: is there a reason you have to use the -std=f2008ts flag?

@paulromano
Copy link
Author

@jsquyres No reason that I have to, per se. It's just part of the style guide for my code that any new additions should be F2008 compliant. When I get a pull request from someone with a change to the code, having -std=f2008 gives added assurance that no compiler-specific extensions have been used.

@jsquyres
Copy link
Member

@paulromano I realized I never ACKed your response -- oops! Ok, thanks for the info. I don't think Github sends mails for the related PRs and issues opened on this ticket, but we've split the solution into 2 parts: 1) fix the accidental LOGICAL pollution of BIND(C) stuff, and 2) re-implement the MPI default attribute handling callbacks in the referenced Github PRs.

@paulromano
Copy link
Author

@jsquyres @ggouaillardet Thanks for the quick action on this issue; look forward to the next version!

ggouaillardet added a commit to ggouaillardet/ompi-release that referenced this issue Feb 12, 2016
ggouaillardet added a commit to ggouaillardet/ompi-release that referenced this issue Feb 12, 2016
ggouaillardet added a commit to ggouaillardet/ompi-release that referenced this issue Feb 15, 2016
ggouaillardet added a commit to ggouaillardet/ompi-release that referenced this issue Feb 15, 2016
ggouaillardet added a commit to ggouaillardet/ompi-release that referenced this issue Feb 15, 2016
ggouaillardet added a commit to ggouaillardet/ompi-release that referenced this issue Feb 17, 2016
bosilca pushed a commit to bosilca/ompi that referenced this issue Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants