Skip to content

Commit e31c8c8

Browse files
authored
Merge pull request #557 from sourceryinstitute/clang-isofortran-workaround
Don't compile ISO_Fortran_binding unless GCC - Fixes #554
2 parents c0e3ffb + aa27f7b commit e31c8c8

File tree

5 files changed

+49
-16
lines changed

5 files changed

+49
-16
lines changed

CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ endif()
7878
string(REGEX REPLACE "-rc[0-9]+$"
7979
".0" OPENCOARRAYS_CMAKE_PROJECT_VERSION
8080
"${OpenCoarraysVersion}")
81+
8182
project(opencoarrays VERSION "${OPENCOARRAYS_CMAKE_PROJECT_VERSION}" LANGUAGES C Fortran)
8283
message( STATUS "Building OpenCoarrays version: ${full_git_describe}" )
8384
set(OpenCoarrays_dist_string "OpenCoarrays-${full_git_describe}")
@@ -645,7 +646,12 @@ if(opencoarrays_aware_compiler)
645646
add_caf_test(register_vector 2 register_vector)
646647
add_caf_test(register_alloc_vector 2 register_alloc_vector)
647648
add_caf_test(allocate_as_barrier 2 allocate_as_barrier)
648-
add_caf_test(allocate_as_barrier_proc 8 allocate_as_barrier_proc)
649+
if(gfortran_compiler AND (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
650+
if( CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 )
651+
message( AUTHOR_WARNING "Developer tests requested and GFortran < 7: test allocate_as_barrier_proc may fail" )
652+
endif()
653+
add_caf_test(allocate_as_barrier_proc 8 allocate_as_barrier_proc)
654+
endif()
649655
if (gfortran_compiler AND (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
650656
message( STATUS "Allocatable components of coarray derived types only supported in GFortran >= 7 with OpenCoarrays > 1.8.4" )
651657
message( STATUS "(but full support not anticipated until OpenCoarrays 2.0 release)" )
@@ -832,7 +838,9 @@ include(cmake/AddInstallationScriptTest.cmake )
832838
add_installation_script_test(installation-scripts.sh src/tests/installation/)
833839

834840
# Test ISO_Fortran_binding library
835-
add_test(NAME ISO_Fortran_binding_tests COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ISO_Fortran_binding_tests")
841+
if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
842+
add_test(NAME ISO_Fortran_binding_tests COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ISO_Fortran_binding_tests")
843+
endif()
836844

837845
# Lint the Travis-CI scripts
838846
set(TRAVIS_SCRIPTS

src/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
set(directories_to_build mpi tests iso-fortran-binding)
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+
27
foreach(directory ${directories_to_build})
38
add_subdirectory(${directory})
49
endforeach()

src/iso-fortran-binding/ISO_Fortran_binding.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
OpenCoarrays is distributed under the OSI-approved BSD 3-clause License:
33
OpenCoarrays -- ISO_Fortran_binding standard-compliant interoperability with
44
C.
5-
Copyright (c) 2015, Sourcery, Inc.
6-
Copyright (c) 2015, Sourcery Institute
5+
Copyright (c) 2018, Sourcery, Inc.
6+
Copyright (c) 2018, Sourcery Institute
77
All rights reserved.
88
99
Redistribution and use in source and binary forms, with or without

src/iso-fortran-binding/ISO_Fortran_binding.h

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
/*
22
OpenCoarrays is distributed under the OSI-approved BSD 3-clause License:
33
OpenCoarrays -- ISO_Fortran_binding standard-compliant interoperability with C.
4-
Copyright (c) 2015, Sourcery, Inc.
5-
Copyright (c) 2015, Sourcery Institute
4+
Copyright (c) 2018, Sourcery, Inc.
5+
Copyright (c) 2018, Sourcery Institute
66
All rights reserved.
77
8-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9-
10-
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
11-
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12-
3. Neither the names of the copyright holders nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13-
14-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8+
Redistribution and use in source and binary forms, with or without
9+
modification, are permitted provided that the following conditions
10+
are met:
11+
12+
1. Redistributions of source code must retain the above copyright
13+
notice, this list of conditions and the following disclaimer.
14+
2. Redistributions in binary form must reproduce the above
15+
copyright notice, this list of conditions and the following
16+
disclaimer in the documentation and/or other materials provided
17+
with the distribution.
18+
3. Neither the names of the copyright holders nor the names of
19+
their contributors may be used to endorse or promote products
20+
derived from this software without specific prior written
21+
permission.
22+
23+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27+
COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31+
HnnnOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34+
OF THE POSSIBILITY OF SUCH DAMAGE.
1535
*/
1636

1737
#ifndef ISO_FORTRAN_BINDING_H

src/tests/unit/iso-fortran-binding/ISO_Fortran_binding_tests.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
OpenCoarrays is distributed under the OSI-approved BSD 3-clause License:
33
OpenCoarrays -- ISO_Fortran_binding standard-compliant interoperability with
44
C.
5-
Copyright (c) 2015, Sourcery, Inc.
6-
Copyright (c) 2015, Sourcery Institute
5+
Copyright (c) 2018, Sourcery, Inc.
6+
Copyright (c) 2018, Sourcery Institute
77
All rights reserved.
88
99
Redistribution and use in source and binary forms, with or without

0 commit comments

Comments
 (0)