Skip to content

Commit

Permalink
Merge branch 'clang-isofortran-workaround'
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeekman committed Jul 2, 2018
2 parents e31c8c8 + c70d46c commit 8ef32a8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ message( STATUS
============================================================
")

message( STATUS "Running with CMake from: ${CMAKE_COMMAND}" )
message( STATUS "Current source dir (for OpenCoarrays): ${CMAKE_CURRENT_SOURCE_DIR}")

# Add option and check environment to determine if developer tests should be run
if($ENV{OPENCOARRAYS_DEVELOPER})
option(CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" ON)
Expand Down Expand Up @@ -80,8 +83,10 @@ string(REGEX REPLACE "-rc[0-9]+$"
"${OpenCoarraysVersion}")

project(opencoarrays VERSION "${OPENCOARRAYS_CMAKE_PROJECT_VERSION}" LANGUAGES C Fortran)

message( STATUS "Building OpenCoarrays version: ${full_git_describe}" )
set(OpenCoarrays_dist_string "OpenCoarrays-${full_git_describe}")
message( STATUS "Building for target architecture: ${CMAKE_SYSTEM_PROCESSOR}" )

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

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

Expand Down
7 changes: 1 addition & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
set(directories_to_build mpi tests)

if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
LIST( APPEND directories_to_build iso-fortran-binding )
endif()

set(directories_to_build mpi tests iso-fortran-binding)
foreach(directory ${directories_to_build})
add_subdirectory(${directory})
endforeach()
Expand Down
2 changes: 1 addition & 1 deletion src/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (mpi_version_out MATCHES "[Oo]pen[ -][Mm][Pp][Ii]")
message( STATUS "OpenMPI detected")
set ( openmpi true PARENT_SCOPE)
# Write out a host file because OMPI's mpiexec is dumb
file(APPEND ${CMAKE_BINARY_DIR}/hostfile "${HOST_NAME} slots=${N_CPU}\n")
file(WRITE ${CMAKE_BINARY_DIR}/hostfile "${HOST_NAME} slots=${N_CPU}\n")
endif ()

if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
Expand Down
5 changes: 4 additions & 1 deletion src/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ if (${opencoarrays_aware_compiler})
add_subdirectory(collectives)
add_subdirectory(sync)
add_subdirectory(events)
add_subdirectory(iso-fortran-binding)
if (gfortran_compiler)
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7)
add_subdirectory(fail_images)
Expand All @@ -17,3 +16,7 @@ if (${opencoarrays_aware_compiler})
else()
add_subdirectory(extensions)
endif()
if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
(CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
add_subdirectory(iso-fortran-binding)
endif()

0 comments on commit 8ef32a8

Please sign in to comment.