Skip to content

Commit 531134c

Browse files
committed
Never build ISO_Fortran_BINDING by default
- Added option `-DCAF_ENABLE_ISO_Fortran_BINDING` which defaults to `OFF` - Attempt to build and test if OPENCOARRAYS_DEVELOPER or options is explicitly requested.
1 parent 2714399 commit 531134c

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

CMakeLists.txt

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ message( STATUS "Running with CMake from: ${CMAKE_COMMAND}" )
1616
message( STATUS "Current source dir (for OpenCoarrays): ${CMAKE_CURRENT_SOURCE_DIR}")
1717

1818
# Add option and check environment to determine if developer tests should be run
19+
set( _TF OFF )
20+
if( NOT DEFINED ENV{OPENCOARRAYS_DEVELOPER})
21+
set ( ENV{OPENCOARRAYS_DEVELOPER} FALSE )
22+
endif()
1923
if($ENV{OPENCOARRAYS_DEVELOPER})
20-
option(CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" ON)
21-
else()
22-
option(CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" OFF)
24+
set( _TF ON )
2325
endif()
26+
option(CAF_RUN_DEVELOPER_TESTS "Run tests intended only for developers" ${_TF})
2427
mark_as_advanced(CAF_RUN_DEVELOPER_TESTS)
28+
option( CAF_ENABLE_ISO_Fortran_BINDING
29+
"Build and install F2018 C interop iso_fortran_binding.h header; experimental!"
30+
${_TF} )
2531

26-
if( NOT DEFINED ENV{OPENCOARRAYS_DEVELOPER})
27-
set ( ENV{OPENCOARRAYS_DEVELOPER} FALSE )
28-
endif()
2932

3033
# Name project and specify source languages
3134
# Parse version from .VERSION file so that more info can be added and easier to get from scripts
@@ -842,9 +845,17 @@ endif()
842845
include(cmake/AddInstallationScriptTest.cmake )
843846
add_installation_script_test(installation-scripts.sh src/tests/installation/)
844847

848+
if( CAF_ENABLE_FAILED_IMAGES AND ( NOT
849+
( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" ) AND ( "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" ) )
850+
)
851+
message ( WARNING
852+
"ISO_Fortran_BINDING has only been tested with recent GCC C compilers on x86_64 architectures!
853+
Some people have reported problems on other architectures or using other C compilers (Clang).
854+
There are likely bugs present; use at your own risk!")
855+
endif()
856+
845857
# Test ISO_Fortran_binding library
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} ) )
858+
if( CAF_ENABLE_ISO_Fortran_BINDING OR ( CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} ) )
848859
# See https://github.com/sourceryinstitute/OpenCoarrays/issues/523#issuecomment-401613209
849860
add_test(NAME ISO_Fortran_binding_tests COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ISO_Fortran_binding_tests")
850861
endif()

src/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
set(directories_to_build mpi tests iso-fortran-binding)
1+
set(directories_to_build mpi tests)
2+
if( CAF_ENABLE_ISO_Fortran_BINDING OR ( CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} ) )
3+
list( APPEND directories_to_build iso-fortran-binding )
4+
endif()
25
foreach(directory ${directories_to_build})
36
add_subdirectory(${directory})
47
endforeach()

src/tests/unit/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ if (${opencoarrays_aware_compiler})
1616
else()
1717
add_subdirectory(extensions)
1818
endif()
19-
if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
20-
(CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
19+
if( CAF_ENABLE_ISO_Fortran_BINDING OR ( CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER} ) )
2120
add_subdirectory(iso-fortran-binding)
2221
endif()

0 commit comments

Comments
 (0)