Skip to content

Commit

Permalink
Support gfortran 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Jul 11, 2022
1 parent ec242bd commit 52b86a5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ authors:
given-names: Erik
orcid: 0000-0002-4518-9017
title: MPItrampoline
version: v4.0.2
version: v4.1.0
doi: 10.5281/zenodo.6174408
date-released: 2022-05-07
date-released: 2022-07-11
29 changes: 28 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12...3.20)
project(
MPItrampoline VERSION 4.0.2
MPItrampoline VERSION 4.1.0
DESCRIPTION "MPI trampoline"
HOMEPAGE_URL "https://github.com/eschnett/MPItrampoline"
LANGUAGES NONE
Expand Down Expand Up @@ -36,6 +36,21 @@ if(ENABLE_FORTRAN)
if(Fortran_flag_cray_pointer)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer")
endif()
check_fortran_source_compiles(
"
end
subroutine attr(buf)
integer buf
!gcc$ attributes no_arg_check :: buf
end
"
Fortran_attribute_gcc_attributes_no_arg_check
SRC_EXT f90)
if(Fortran_attribute_gcc_attributes_no_arg_check)
set(GCC_ATTRIBUTES_NO_ARG_CHECK "") # enabled
else()
set(GCC_ATTRIBUTES_NO_ARG_CHECK "! ") # disabled
endif()
add_compile_definitions(ENABLE_FORTRAN)
else()
message(STATUS "Disabling Fortran support")
Expand Down Expand Up @@ -75,6 +90,18 @@ if(ENABLE_FORTRAN)
FILES "${CMAKE_CURRENT_BINARY_DIR}/include/mpif_version.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

configure_file(include/mpi.f90.in include/mpi.f90 @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/include/mpi.f90"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

configure_file(include/mpi_f08.f90.in include/mpi_f08.f90 @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/include/mpi_f08.f90"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
endif()

configure_file(src/mpi_defaults.h.in src/mpi_defaults.h @ONLY)
Expand Down
5 changes: 2 additions & 3 deletions include/mpi.f90 → include/mpi.f90.in
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module mpi
subroutine mpi_send(buf, count, datatype, dest, tag, comm, ierror)
implicit none
!dir$ ignore_tkr(tkr) buf
!gcc$ attributes no_arg_check :: buf
@GCC_ATTRIBUTES_NO_ARG_CHECK@ !gcc$ attributes no_arg_check :: buf
integer, intent(in) :: buf(*)
integer, intent(in) :: count
integer, intent(in) :: datatype
Expand All @@ -117,8 +117,7 @@ end subroutine mpi_send
subroutine mpi_recv(buf, count, datatype, source, tag, comm, status, ierror)
import mpi_status_size
implicit none
!dir$ ignore_tkr(tkr) buf
!gcc$ attributes no_arg_check :: buf
@GCC_ATTRIBUTES_NO_ARG_CHECK@ !gcc$ attributes no_arg_check :: buf
integer :: buf(*)
integer, intent(in) :: count
integer, intent(in) :: datatype
Expand Down
4 changes: 2 additions & 2 deletions include/mpi_f08.f90 → include/mpi_f08.f90.in
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ end function mpi_win_ne
subroutine mpi_send_impl(buf, count, datatype, dest, tag, comm, ierror)
use mpi, only: mpi_send
!dir$ ignore_tkr(tkr) buf
!gcc$ attributes no_arg_check :: buf
@GCC_ATTRIBUTES_NO_ARG_CHECK@ !gcc$ attributes no_arg_check :: buf
integer, intent(in) :: buf
integer, intent(in) :: count
type(mpi_datatype), intent(in) :: datatype
Expand All @@ -393,7 +393,7 @@ end subroutine mpi_send_impl
subroutine mpi_recv_impl(buf, count, datatype, source, tag, comm, status, ierror)
use mpi, only: mpi_source, mpi_tag, mpi_error, mpi_recv
!dir$ ignore_tkr(tkr) buf
!gcc$ attributes no_arg_check :: buf
@GCC_ATTRIBUTES_NO_ARG_CHECK@ !gcc$ attributes no_arg_check :: buf
integer :: buf
integer, intent(in) :: count
type(mpi_datatype), intent(in) :: datatype
Expand Down

0 comments on commit 52b86a5

Please sign in to comment.