-
Notifications
You must be signed in to change notification settings - Fork 912
configury: disable f08 fortran bindings if the compiler does #315
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
dnl -*- shell-script -*- | ||
dnl | ||
dnl Copyright (c) 2014 Research Organization for Information Science | ||
dnl and Technology (RIST). All rights reserved. | ||
dnl $COPYRIGHT$ | ||
dnl | ||
dnl Additional copyrights may follow | ||
dnl | ||
dnl $HEADER$ | ||
dnl | ||
|
||
# Check whether or not the Fortran compiler implements or not | ||
# TS 29113 subclause 8.1 : | ||
# Removed restrictions on ISO_C_BINDING module procedures. | ||
|
||
# OMPI_FORTRAN_CHECK_C_FUNLOC([action if found], | ||
# [action if not found]) | ||
# ---------------------------------------------------- | ||
AC_DEFUN([OMPI_FORTRAN_CHECK_C_FUNLOC],[ | ||
AS_VAR_PUSHDEF([c_funloc], [ompi_cv_fortran_c_funloc]) | ||
|
||
AC_CACHE_CHECK([if Fortran compiler implements TS 29113], c_funloc, | ||
[AC_LANG_PUSH([Fortran]) | ||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program main | ||
abstract interface | ||
subroutine MPI_Comm_errhandler_function(comm, error_code) | ||
implicit none | ||
integer :: comm, error_code | ||
end subroutine | ||
end interface | ||
|
||
contains | ||
|
||
subroutine mysub(fn) | ||
use, intrinsic :: iso_c_binding, only : c_funloc, c_funptr | ||
procedure(MPI_Comm_errhandler_function) :: comm_errhandler_fn | ||
type(c_funptr) :: comm_errhandler_fn_c | ||
comm_errhandler_fn_c = c_funloc(comm_errhandler_fn) | ||
end subroutine mysub | ||
end program]])], | ||
[AS_VAR_SET(c_funloc, yes)], | ||
[AS_VAR_SET(c_funloc, no)]) | ||
AC_LANG_POP([Fortran]) | ||
]) | ||
|
||
AS_VAR_IF(c_funloc, [yes], [$1], [$2]) | ||
AS_VAR_POPDEF([c_funloc])dnl | ||
]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
* All rights reserved. | ||
* | ||
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. | ||
* Copyright (c) 2014 Research Organization for Information Science | ||
* and Technology (RIST). All rights reserved. | ||
* $COPYRIGHT$ | ||
* | ||
* Additional copyrights may follow | ||
|
@@ -91,6 +93,7 @@ void oshmem_info_do_config(bool want_all) | |
char *fortran_have_abstract; | ||
char *fortran_have_asynchronous; | ||
char *fortran_have_procedure; | ||
char *fortran_have_c_funloc; | ||
char *fortran_08_using_wrappers_for_choice_buffer_functions; | ||
char *java; | ||
char *heterogeneous; | ||
|
@@ -165,6 +168,7 @@ void oshmem_info_do_config(bool want_all) | |
fortran_have_abstract = OMPI_FORTRAN_HAVE_ABSTRACT ? "yes" : "no"; | ||
fortran_have_asynchronous = OMPI_FORTRAN_HAVE_ASYNCHRONOUS ? "yes" : "no"; | ||
fortran_have_procedure = OMPI_FORTRAN_HAVE_PROCEDURE ? "yes" : "no"; | ||
fortran_have_c_funloc = OMPI_FORTRAN_HAVE_C_FUNLOC ? "yes" : "no"; | ||
fortran_08_using_wrappers_for_choice_buffer_functions = | ||
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES ? "yes" : "no"; | ||
|
||
|
@@ -178,6 +182,7 @@ void oshmem_info_do_config(bool want_all) | |
OMPI_FORTRAN_HAVE_ABSTRACT && | ||
OMPI_FORTRAN_HAVE_ASYNCHRONOUS && | ||
OMPI_FORTRAN_HAVE_PROCEDURE && | ||
OMPI_FORTRAN_HAVE_C_FUNLOC && | ||
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES) { | ||
fortran_usempif08_compliance = strdup("The mpi_f08 module is available, and is fully compliant. w00t!"); | ||
} else { | ||
|
@@ -201,6 +206,9 @@ void oshmem_info_do_config(bool want_all) | |
if (!OMPI_FORTRAN_HAVE_PROCEDURE) { | ||
append(f08, sizeof(f08), &first, "PROCEDUREs"); | ||
} | ||
if (!OMPI_FORTRAN_HAVE_C_FUNLOC) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need this kind of clause in ompi_info, too, right? Did you not add it in ompi_info because we forgot to add some other Fortran features in the ompi_info Fortran compliance string, perchance? |
||
append(f08, sizeof(f08), &first, "C_FUNLOCs"); | ||
} | ||
if (OMPI_FORTRAN_NEED_WRAPPER_ROUTINES) { | ||
append(f08, sizeof(f08), &first, "direct passthru (where possible) to underlying Open MPI's C functionality"); | ||
} | ||
|
@@ -376,6 +384,9 @@ void oshmem_info_do_config(bool want_all) | |
opal_info_out("Fort PROCEDURE", | ||
"compiler:fortran:procedure", | ||
fortran_have_procedure); | ||
opal_info_out("Fort C_FUNLOC", | ||
"compiler:fortran:c_funloc", | ||
fortran_have_c_funloc); | ||
opal_info_out("Fort f08 using wrappers", | ||
"compiler:fortran:08_wrappers", | ||
fortran_08_using_wrappers_for_choice_buffer_functions); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm quite sure that we're not consistent about this, but @bertwesarg is right: test -a is not portable.
Instead, use AS_IF([test ..blah... && test ...blah... ], ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take this back. The rest of ompi_setup_mpi_fortran.m4 uses -a and -o. So go ahead and leave it here.
But let's do another blanket-change commit after this one that changes them all to && and ||.