mirror of
https://github.com/reactos/CMake.git
synced 2024-12-04 09:54:15 +00:00
Merge topic 'findmpi-overhaul'
bf1e606f
FindMPI: Add support for FreeBSD and SLES2f673da6
FindMPI: Support components for various languages9a58e69c
FindMPI: Modernization from ground up Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !893
This commit is contained in:
commit
bc2009b724
16
Help/release/dev/FindMPI-overhaul.rst
Normal file
16
Help/release/dev/FindMPI-overhaul.rst
Normal file
@ -0,0 +1,16 @@
|
||||
findmpi-overhaul
|
||||
----------------
|
||||
|
||||
* :module:`FindMPI` gained a number of new features, including:
|
||||
|
||||
* Language-specific components have been added to the module.
|
||||
* Many more MPI environments are now supported.
|
||||
* The environmental support for Fortran has been improved.
|
||||
* A user now has fine-grained control over the MPI selection process,
|
||||
including passing custom parameters to the MPI compiler.
|
||||
* The version of the implemented MPI standard is now being exposed.
|
||||
* MPI-2 C++ bindings can now be detected and also suppressed if so desired.
|
||||
* The available Fortran bindings are now being detected and verified.
|
||||
* Various MPI-3 information can be requested, including the library version
|
||||
and Fortran capabilities of the individual bindings.
|
||||
* Statically linked MPI implementations are supported.
|
File diff suppressed because it is too large
Load Diff
4
Modules/FindMPI/fortranparam_mpi.f90.in
Normal file
4
Modules/FindMPI/fortranparam_mpi.f90.in
Normal file
@ -0,0 +1,4 @@
|
||||
program mpi_ver
|
||||
@MPI_Fortran_INCLUDE_LINE@
|
||||
print *, 'INFO:SUBARRAYS[', MPI_SUBARRAYS_SUPPORTED, ']-ASYNCPROT[', MPI_ASYNC_PROTECTS_NONBLOCKING, ']'
|
||||
end program mpi_ver
|
19
Modules/FindMPI/libver_mpi.c
Normal file
19
Modules/FindMPI/libver_mpi.c
Normal file
@ -0,0 +1,19 @@
|
||||
#include <mpi.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <cstdio>
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
char mpilibver_str[MPI_MAX_LIBRARY_VERSION_STRING];
|
||||
int mpilibver_len;
|
||||
MPI_Get_library_version(mpilibver_str, &mpilibver_len);
|
||||
#ifdef __cplusplus
|
||||
std::puts(mpilibver_str);
|
||||
#else
|
||||
puts(mpilibver_str);
|
||||
#endif
|
||||
}
|
7
Modules/FindMPI/libver_mpi.f90.in
Normal file
7
Modules/FindMPI/libver_mpi.f90.in
Normal file
@ -0,0 +1,7 @@
|
||||
program mpi_ver
|
||||
@MPI_Fortran_INCLUDE_LINE@
|
||||
character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: mpilibver_str
|
||||
integer(kind=MPI_INTEGER_KIND) :: ierror, reslen
|
||||
call MPI_GET_LIBRARY_VERSION(mpilibver_str, reslen, ierror)
|
||||
print *, mpilibver_str
|
||||
end program mpi_ver
|
10
Modules/FindMPI/mpiver.f90.in
Normal file
10
Modules/FindMPI/mpiver.f90.in
Normal file
@ -0,0 +1,10 @@
|
||||
program mpi_ver
|
||||
@MPI_Fortran_INCLUDE_LINE@
|
||||
integer(kind=kind(MPI_VERSION)), parameter :: zero = ichar('0')
|
||||
character, dimension(17), parameter :: mpiver_str =&
|
||||
(/ 'I', 'N', 'F', 'O', ':', 'M', 'P', 'I', '-', 'V', 'E', 'R', '[', &
|
||||
char(zero + MPI_VERSION), &
|
||||
'.', &
|
||||
char(zero + MPI_SUBVERSION), ']' /)
|
||||
print *, mpiver_str
|
||||
end program mpi_ver
|
37
Modules/FindMPI/test_mpi.c
Normal file
37
Modules/FindMPI/test_mpi.c
Normal file
@ -0,0 +1,37 @@
|
||||
#include <mpi.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <cstdio>
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
|
||||
const char mpiver_str[] = { 'I', 'N',
|
||||
'F', 'O',
|
||||
':', 'M',
|
||||
'P', 'I',
|
||||
'-', 'V',
|
||||
'E', 'R',
|
||||
'[', ('0' + MPI_VERSION),
|
||||
'.', ('0' + MPI_SUBVERSION),
|
||||
']', '\0' };
|
||||
#endif
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
|
||||
#ifdef __cplusplus
|
||||
std::puts(mpiver_str);
|
||||
#else
|
||||
puts(mpiver_str);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef TEST_MPI_MPICXX
|
||||
MPI::MPI_Init(&argc, &argv);
|
||||
MPI::MPI_Finalize();
|
||||
#else
|
||||
MPI_Init(&argc, &argv);
|
||||
MPI_Finalize();
|
||||
#endif
|
||||
}
|
6
Modules/FindMPI/test_mpi.f90.in
Normal file
6
Modules/FindMPI/test_mpi.f90.in
Normal file
@ -0,0 +1,6 @@
|
||||
program hello
|
||||
@MPI_Fortran_INCLUDE_LINE@
|
||||
integer@MPI_Fortran_INTEGER_LINE@ ierror
|
||||
call MPI_INIT(ierror)
|
||||
call MPI_FINALIZE(ierror)
|
||||
end program
|
@ -20,12 +20,17 @@ foreach(c C CXX Fortran)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||
set(MPI_CXX_VALIDATE_SKIP_MPICXX TRUE)
|
||||
find_package(MPI REQUIRED)
|
||||
|
||||
foreach(c C CXX Fortran)
|
||||
if(NOT "${MPI_TEST_${c}}")
|
||||
continue()
|
||||
endif()
|
||||
if(${c} STREQUAL CXX AND MPI_MPICXX_FOUND)
|
||||
message(FATAL_ERROR "Could not suppress MPI-2 C++ bindings for this MPI.")
|
||||
endif()
|
||||
source_code_mapper_helper(${c})
|
||||
add_executable(test_tgt_${c} ${MPITEST_SOURCE_FILE})
|
||||
target_link_libraries(test_tgt_${c} MPI::MPI_${c})
|
||||
|
Loading…
Reference in New Issue
Block a user