Skip to content

Commit 2f47abe

Browse files
committed
cmake flang
1 parent b7a32ac commit 2f47abe

File tree

3 files changed

+20
-28
lines changed

3 files changed

+20
-28
lines changed

.appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ stack: python 3
77
environment:
88
MINGW_DIR: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin
99
PY_DIR: C:\Python36-x64
10-
TRAVIS: 1
1110

1211
clone_depth: 3
1312

@@ -18,6 +17,7 @@ before_build:
1817
- cmd: set FC=%MINGW_DIR%\gfortran
1918
- cmd: set CXX=%MINGW_DIR%\g++
2019
- cmd: set CC=%MINGW_DIR%\gcc
20+
- cmd: mklink bin\make.exe %MINGW_DIR%\mingw32-make.exe
2121

2222
- sh: sudo apt -yq update > /dev/null
2323
- sh: sudo apt install -yq --no-install-suggests --no-install-recommends gfortran cmake make > /dev/null
@@ -26,15 +26,15 @@ before_build:
2626

2727
build_script:
2828
- cmd: cmake -G "MinGW Makefiles" ..
29-
- cmd: mingw32-make
30-
3129
- sh: cmake ..
32-
- sh: make
30+
31+
- make
3332

3433
- cd ..
3534
- cmd: where python
3635
- pip -q install -e .[tests]
3736

3837
after_build:
38+
- make test
3939
- pytest -v
4040

CMakeLists.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
cmake_minimum_required(VERSION 2.8.12)
2-
project( morecvutils Fortran )
1+
cmake_minimum_required(VERSION 3.0)
2+
project(lineclip Fortran)
3+
enable_testing()
34

45
add_compile_options(-O3 -mtune=native -g)
56

6-
if(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
7+
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU)
78
add_compile_options(-Wall -Wextra -Wpedantic -Werror=array-bounds -fbacktrace -fexceptions)
89
if(NOT CYGWIN AND NOT WIN32)
910
add_compile_options(-fstack-protector-all)
@@ -13,18 +14,24 @@ endif()
1314

1415
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL Intel)
1516
add_compile_options(-coarray=shared)# -check all)
16-
link_libraries(-coarray=shared) # seems silly but that's what's needed at object code step for ifort
17+
link_libraries(-coarray=shared)
1718
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU)
18-
if ($ENV{TRAVIS}) # on Travis-CI
19-
add_compile_options(-fcoarray=single)
20-
else()
19+
find_package(OpenCoarrays)
20+
21+
if(OpenCoarrays_FOUND)
2122
add_compile_options(-fcoarray=lib)
22-
set(FCAF ${FCAF} caf_mpi)
23+
link_libraries(caf_mpi)
24+
else()
25+
add_compile_options(-fcoarray=single)
2326
endif()
27+
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL Flang)
28+
link_libraries(-static-flang-libs)
2429
endif()
2530

2631
add_library(lineclip lineclipping.f90)
27-
target_link_libraries(lineclip ${FCAF})
32+
target_link_libraries(lineclip)
2833

2934
add_executable(RunLineclip DemoLineclip.f90 assert.f90)
3035
target_link_libraries(RunLineclip lineclip)
36+
37+
add_test(NAME clip COMMAND ./RunLineclip)

cmake/Modules/FindCAF.cmake

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)