Skip to content

Commit

Permalink
Merge pull request #21 from yanjen/intel-ci
Browse files Browse the repository at this point in the history
Add support for Intel and NAG compilers
  • Loading branch information
artemis-beta committed Dec 29, 2023
2 parents 1f005b0 + 322e139 commit 8486192
Show file tree
Hide file tree
Showing 26 changed files with 337 additions and 272 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/futs_intel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: FortUTF Ubuntu Intel 2023

on: [push]

jobs:
build:
name: Intel Latest Tests
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v3
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: '3.27.x'
- name: Setup Intel ifort compiler
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: intel
version: '2023.2'
- name: Build Tests
run: |
ifort --version
cmake -H. -Bbuild -DBUILD_TESTS=ON -DCMAKE_Fortran_COMPILER=ifort
cmake --build build
- name: Run Tests
run: |
./build/FortUTF_Tests
if [ $? -eq 0 ]; then
echo "Unit Tests completed successfully"
exit 0
else
echo "Unit Tests failed"
exit 1
fi
- name: Run Test List
run: |
./build/FortUTF_Tests TEST_FAIL_EQUAL_CHAR TEST_EQUAL_CHAR
if [ $? -eq 0 ]; then
echo "Unit Tests completed succesfully"
exit 0
else
echo "Unit Tests failed"
exit 1
fi
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ if(NOT BUILD_TESTS)
endif()

if(BUILD_TESTS)
set(CMAKE_Fortran_FLAGS "-Wall -Wextra -Wno-compare-reals -Wno-maybe-uninitialized -Wno-uninitialized -O3 -g -fprofile-arcs -ftest-coverage")
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set(CMAKE_Fortran_FLAGS "-Wall -Wextra -Wno-compare-reals -Wno-maybe-uninitialized -Wno-uninitialized -O3 -g -fprofile-arcs -ftest-coverage")
else()
set(CMAKE_Fortran_FLAGS "-O3")
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/fortutf.cmake)
set(FORTUTF_PROJECT_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
set(FORTUTF_PROJECT_TEST_FILES ${CMAKE_SOURCE_DIR}/tests/test_suite/unfinished_test_check.f90)
Expand Down
6 changes: 4 additions & 2 deletions examples/demo_project/src/demo_functions.f90
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
MODULE DEMO_FUNCTIONS
IMPLICIT NONE

INTEGER, PARAMETER :: REAL_KIND_8BYTE = SELECTED_REAL_KIND(15, 307)

CONTAINS

INTEGER FUNCTION DEMO_FUNC_1(N)
INTEGER, INTENT(IN) :: N
DEMO_FUNC_1 = N**2-5
END FUNCTION

REAL(8) FUNCTION DEMO_FUNC_2(VAR)
REAL(8), INTENT(IN) :: VAR
REAL(REAL_KIND_8BYTE) FUNCTION DEMO_FUNC_2(VAR)
REAL(REAL_KIND_8BYTE), INTENT(IN) :: VAR
DEMO_FUNC_2 = (VAR-4)**2
END FUNCTION

Expand Down
Loading

0 comments on commit 8486192

Please sign in to comment.