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

Fortran: disable real128 when compiler does not support #4005

Closed
keszybz opened this issue Aug 28, 2019 · 12 comments · Fixed by #5205
Closed

Fortran: disable real128 when compiler does not support #4005

keszybz opened this issue Aug 28, 2019 · 12 comments · Fixed by #5205

Comments

@keszybz
Copy link
Contributor

keszybz commented Aug 28, 2019

Fails with v3.3.1, v.3.2.1 is OK:

src/binding/fortran/use_mpi_f08/mpi_f08_types.f90:355:16:

  355 |     real(real128),dimension(..) :: x
      |                1
Error: Kind -1 not supported for type REAL at (1)
src/binding/fortran/use_mpi_f08/mpi_f08_types.f90:385:19:

  385 |     complex(real128),dimension(..) :: x
      |                   1
Error: Kind -1 not supported for type COMPLEX at (1)
src/binding/fortran/use_mpi_f08/mpi_f08_types.f90:383:36:

  383 | subroutine MPI_Sizeof_xcomplex128 (x, size, ierror)
      |                                    1
Error: Symbol ‘x’ at (1) has no IMPLICIT type
src/binding/fortran/use_mpi_f08/mpi_f08_types.f90:353:33:

  353 | subroutine MPI_Sizeof_xreal128 (x, size, ierror)
      |                                 1
Error: Symbol ‘x’ at (1) has no IMPLICIT type
src/binding/fortran/use_mpi_f08/mpi_f08_types.f90:353:30:

  353 | subroutine MPI_Sizeof_xreal128 (x, size, ierror)
      |                              1
......
  383 | subroutine MPI_Sizeof_xcomplex128 (x, size, ierror)
      |                                 2
Error: Ambiguous interfaces in generic interface 'mpi_sizeof' for ‘mpi_sizeof_xreal128’ at (1) and ‘mpi_sizeof_xcomplex128’ at (2)
make: *** [Makefile:48733: src/binding/fortran/use_mpi_f08/mpi_f08_types.stamp] Error 1

Fails in Fedora rawhide, F31, F30.

@keszybz
Copy link
Contributor Author

keszybz commented Aug 28, 2019

I now built it with a simple patch which removes those MPI_Sizeof_xcomplex128, MPI_Sizeof_xreal128. Not sure if it'll cause any problems down the road ;)

@nmorey
Copy link

nmorey commented Sep 26, 2019

I'm also seeing this issue on SUSE Tumbleweed. This also impacts mvapich2 2.3.2.

@keszybz Would you mind sharing the patch ?

@keszybz
Copy link
Contributor Author

keszybz commented Sep 26, 2019

... but I'm only applying it on arm (https://src.fedoraproject.org/rpms/mpich/blob/master/f/mpich.spec#_111). It'd have to be conditionalized to apply everywhere.

@nmorey
Copy link

nmorey commented Sep 27, 2019

@keszybz Thanks. Will do the same for now until a proper fix is available.
Note: this applies cleanly to mvapich2 2.3.1 aswell

@harisubramoni
Copy link

@keszybz @nmorey - Thanks for the discussion and the patch.

@raffenet - do you recommend that I take this into the MVAPICH2 codebase in the interim while you guys work on a full solution?

Thx,
Hari.

@hzhou
Copy link
Contributor

hzhou commented Sep 29, 2019

The only side effects removing MPI_Sizeof_xreal128 is on system that do support real128, which is real*16 I believe, and the user write code call MPI_Sizeof(x, size_x, ierror) where x is of that long double type, the compilation will fail. A proper fix probably need check configure.

In the interim, removing them essentially just removed the support of real128 for the MPI_Sizeof. Both the usage of real128 and MPI_Sizeof as well as use mpi_f08 are rare anyway, so the impact is likely minimal.

@hzhou
Copy link
Contributor

hzhou commented Oct 19, 2019

Currently we generate the fortran bindings at autogen time, before configure. In order to use configure, we generate .in files with autoconf macros in them and run them through configure. This is convoluted and limited. The proper way is have configure test features, then run buildiface as ac_config_commands so it can generate interfaces that reflect feature options directly.

@hzhou
Copy link
Contributor

hzhou commented Oct 19, 2019

Tagging PR #3819

@raffenet
Copy link
Contributor

The proper way is have configure test features, then run buildiface as ac_config_commands so it can generate interfaces that reflect feature options directly.

Yes! This way --disable-fortran would actually save buildiface from running.

@swepettax
Copy link

I ran in to the same problem today, using Arch Linux on my RPI. Any solution yet?

@hzhou hzhou changed the title compilation failure on arm Fortran: disable real128 when compiler does not support Mar 14, 2021
@everythingfunctional
Copy link

Found this issue today trying to build a Pi cluster for testing parallel Fortran code. Just made the fix myself, but it would be nice if the configure step could do it 😉

nmorey added a commit to nmorey/mpich that referenced this issue Apr 28, 2021
Fixe a fortran compilation failure on ARM
pmodels#4005

Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
nmorey added a commit to nmorey/mvapich2 that referenced this issue Apr 28, 2021
See pmodels/mpich#4005

Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
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

Successfully merging a pull request may close this issue.

7 participants