Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 7f69027

Browse files
committed
fortran sizeof: ensure mpi_sizeof*f90 is not empty
Per http://www.open-mpi.org/community/lists/devel/2015/08/17775.php, some compilers don't like it when there's a .f90 file that only contains comments (and no actual Fortran code). So if OMPI determines that the Fortran compiler does not support enough Fortran mojo to support MPI_SIZEOF, generate at least one dummy Fortran subroutine that can be compiled in an otherwise barren Fortran landscape that is devoid of life and hope. (cherry picked from commit open-mpi/ompi@d5763a8) (cherry picked from commit open-mpi/ompi@edf4857) (cherry picked from commit open-mpi/ompi@ede9fc1)
1 parent d416e19 commit 7f69027

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

ompi/mpi/fortran/base/gen-mpi-sizeof.pl

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env perl
22
#
3-
# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
3+
# Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
44
# Copyright (c) 2015 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
# $COPYRIGHT$
@@ -218,12 +218,26 @@ sub output_file {
218218
! Specifically: we need support for the INTERFACE keyword,
219219
! ISO_FORTRAN_ENV, and the STORAGE_SIZE() intrinsic on all types.
220220
! Apparently, this compiler does not support both of those things, so
221-
! this file will be blank (i.e., we didn't bother generating the
222-
! necessary stuff for MPI_SIZEOF because the compiler doesn't support
221+
! this file will be (effecitvely) blank (i.e., we didn't bother
222+
! generating the necessary stuff for MPI_SIZEOF because the compiler
223+
! doesn't support
223224
! it).
224225
!
225226
! If you want support for MPI_SIZEOF, please use a different Fortran
226227
! compiler to build Open MPI.\n\n";
228+
229+
if ($want_bodies) {
230+
print OUT "!
231+
! Dummy subroutine, just so that there is *some* Fortran in this file
232+
! (some compilers are unhappy if there are no Fortran statements in this
233+
! file).
234+
subroutine ompi_sad_panda()
235+
implicit none
236+
237+
print *, 'Open MPI is a sad panda because your Fortran compiler'
238+
print *, 'does not support enough Fortran mojo for MPI_SIZEOF'
239+
end subroutine ompi_sad_panda\n\n";
240+
}
227241
}
228242

229243
close(OUT);

0 commit comments

Comments
 (0)