Skip to content

Commit cd5202e

Browse files
committed
Merge remote-tracking branch 'upstream/master' into level_logger
2 parents 8f77748 + d0d927d commit cd5202e

File tree

3 files changed

+116
-2
lines changed

3 files changed

+116
-2
lines changed

.github/workflows/CI.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,59 @@ jobs:
8585
make -f Makefile.manual FYPPFLAGS="-DMAXRANK=4"
8686
make -f Makefile.manual test
8787
make -f Makefile.manual clean
88+
89+
intel-build:
90+
runs-on: ${{ matrix.os }}
91+
strategy:
92+
fail-fast: false
93+
matrix:
94+
os: [ubuntu-20.04]
95+
fc: [ifort]
96+
env:
97+
FC: ${{ matrix.fc }}
98+
99+
steps:
100+
- name: Checkout code
101+
uses: actions/checkout@v1
102+
103+
- name: Set up Python 3.x
104+
uses: actions/setup-python@v1
105+
with:
106+
python-version: 3.x
107+
108+
- name: Install CMake Linux
109+
if: contains(matrix.os, 'ubuntu')
110+
run: ci/install_cmake.sh
111+
112+
- name: Add Intel repository
113+
if: contains(matrix.os, 'ubuntu')
114+
run: |
115+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
116+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
117+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
118+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
119+
sudo apt-get update
120+
121+
- name: Install Intel oneAPI compiler
122+
if: contains(matrix.os, 'ubuntu')
123+
run: |
124+
sudo apt-get install intel-oneapi-ifort
125+
source /opt/intel/oneapi/setvars.sh
126+
printenv >> $GITHUB_ENV
127+
128+
- name: Install fypp
129+
run: pip install --upgrade fypp
130+
131+
- name: Configure with CMake
132+
run: cmake -Wdev -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAXIMUM_RANK=4 -S . -B build
133+
134+
- name: Build and compile
135+
run: cmake --build build
136+
137+
- name: catch build fail
138+
run: cmake --build build --verbose --parallel 1
139+
if: failure()
140+
141+
- name: test
142+
run: ctest --parallel --output-on-failure
143+
working-directory: build

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
2222
endif()
2323
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
2424
add_compile_options(-warn declarations,general,usage,interfaces,unused)
25-
add_compile_options(-standard-semantics)
25+
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_EQUAL 20.2.1.20200827)
26+
add_compile_options(-standard-semantics)
27+
endif()
2628
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
2729
add_compile_options(-stand f15)
2830
else()
@@ -35,7 +37,7 @@ endif()
3537
# --- compiler feature checks
3638
include(CheckFortranSourceCompiles)
3739
include(CheckFortranSourceRuns)
38-
check_fortran_source_compiles("error stop i; end" f18errorstop SRC_EXT f90)
40+
check_fortran_source_runs("i=0; error stop i; end" f18errorstop SRC_EXT f90)
3941
check_fortran_source_compiles("real, allocatable :: array(:, :, :, :, :, :, :, :, :, :); end" f03rank SRC_EXT f90)
4042
check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128)
4143

src/tests/logger/test_stdlib_logger.f90

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,62 @@ subroutine test_logging_configuration()
127127

128128
end if
129129

130+
!testing all calls independently
131+
call global % configuration( add_blank_line=add_blank_line )
132+
133+
if ( .not. add_blank_line ) then
134+
write(*,*) 'ADD_BLANK_LINE starts off as .FALSE. as expected.'
135+
136+
else
137+
error stop 'ADD_BLANK_LINE starts off as .TRUE. contrary to ' // &
138+
'expectations.'
139+
140+
end if
141+
142+
call global % configuration( indent=indent )
143+
144+
if ( indent ) then
145+
write(*,*) 'INDENT starts off as .TRUE. as expected.'
146+
147+
else
148+
error stop 'INDENT starts off as .FALSE. contrary to expectations.'
149+
150+
end if
151+
152+
call global % configuration( max_width=max_width )
153+
154+
if ( max_width == 0 ) then
155+
write(*,*) 'MAX_WIDTH starts off as 0 as expected.'
156+
157+
else
158+
error stop 'MAX_WIDTH starts off as not equal to 0 contrary ' // &
159+
'to expectations.'
160+
161+
end if
162+
163+
call global % configuration( time_stamp=time_stamp )
164+
165+
if ( time_stamp ) then
166+
write(*,*) 'TIME_STAMP starts off as .TRUE. as expected.'
167+
168+
else
169+
error stop 'TIME_STAMP starts off as .FALSE. contrary to ' // &
170+
'expectations.'
171+
172+
end if
173+
174+
call global % configuration( log_units=log_units )
175+
176+
if ( size(log_units) == 0 ) then
177+
write(*,*) 'SIZE(LOG_UNITS) starts off as 0 as expected.'
178+
179+
else
180+
error stop 'SIZE(LOG_UNITS) starts off as non-zero contrary ' // &
181+
'to expectations.'
182+
183+
end if
184+
185+
130186
call global % log_information( 'This message should be output ' // &
131187
'to OUTPUT_UNIT, unlimited in width, not preceded by ' // &
132188
'a blank line, then by a time stamp, then by MODULE % ' // &

0 commit comments

Comments
 (0)