Skip to content

Commit 8ef32a8

Browse files
committed
Merge branch 'clang-isofortran-workaround'
2 parents e31c8c8 + c70d46c commit 8ef32a8

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ message( STATUS
1212
============================================================
1313
")
1414

15+
message( STATUS "Running with CMake from: ${CMAKE_COMMAND}" )
16+
message( STATUS "Current source dir (for OpenCoarrays): ${CMAKE_CURRENT_SOURCE_DIR}")
17+
1518
# Add option and check environment to determine if developer tests should be run
1619
if($ENV{OPENCOARRAYS_DEVELOPER})
1720
option(CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" ON)
@@ -80,8 +83,10 @@ string(REGEX REPLACE "-rc[0-9]+$"
8083
"${OpenCoarraysVersion}")
8184

8285
project(opencoarrays VERSION "${OPENCOARRAYS_CMAKE_PROJECT_VERSION}" LANGUAGES C Fortran)
86+
8387
message( STATUS "Building OpenCoarrays version: ${full_git_describe}" )
8488
set(OpenCoarrays_dist_string "OpenCoarrays-${full_git_describe}")
89+
message( STATUS "Building for target architecture: ${CMAKE_SYSTEM_PROCESSOR}" )
8590

8691
#Print an error message on an attempt to build inside the source directory tree:
8792
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
@@ -838,7 +843,9 @@ include(cmake/AddInstallationScriptTest.cmake )
838843
add_installation_script_test(installation-scripts.sh src/tests/installation/)
839844

840845
# Test ISO_Fortran_binding library
841-
if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
846+
if( (( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" ) AND ( "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" ))
847+
OR ( CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} ) )
848+
# See https://github.com/sourceryinstitute/OpenCoarrays/issues/523#issuecomment-401613209
842849
add_test(NAME ISO_Fortran_binding_tests COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ISO_Fortran_binding_tests")
843850
endif()
844851

src/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
set(directories_to_build mpi tests)
2-
3-
if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
4-
LIST( APPEND directories_to_build iso-fortran-binding )
5-
endif()
6-
1+
set(directories_to_build mpi tests iso-fortran-binding)
72
foreach(directory ${directories_to_build})
83
add_subdirectory(${directory})
94
endforeach()

src/mpi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (mpi_version_out MATCHES "[Oo]pen[ -][Mm][Pp][Ii]")
2121
message( STATUS "OpenMPI detected")
2222
set ( openmpi true PARENT_SCOPE)
2323
# Write out a host file because OMPI's mpiexec is dumb
24-
file(APPEND ${CMAKE_BINARY_DIR}/hostfile "${HOST_NAME} slots=${N_CPU}\n")
24+
file(WRITE ${CMAKE_BINARY_DIR}/hostfile "${HOST_NAME} slots=${N_CPU}\n")
2525
endif ()
2626

2727
if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")

src/tests/unit/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ if (${opencoarrays_aware_compiler})
55
add_subdirectory(collectives)
66
add_subdirectory(sync)
77
add_subdirectory(events)
8-
add_subdirectory(iso-fortran-binding)
98
if (gfortran_compiler)
109
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7)
1110
add_subdirectory(fail_images)
@@ -17,3 +16,7 @@ if (${opencoarrays_aware_compiler})
1716
else()
1817
add_subdirectory(extensions)
1918
endif()
19+
if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
20+
(CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
21+
add_subdirectory(iso-fortran-binding)
22+
endif()

0 commit comments

Comments
 (0)