Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
85 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ endif | |
|
||
subdir('cxx') | ||
subdir('mpi') | ||
subdir('standard') | ||
subdir('system') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
fc = meson.get_compiler('fortran') | ||
|
||
f08block = fc.links('error stop; end', name : 'F2008 block') | ||
|
||
if f08block | ||
block_exe = executable('block', 'block.f90') | ||
endif | ||
|
||
shortcircuit_exe = executable('shortcircuit', 'short_circuit.f90') | ||
|
||
bitpat= executable('bitpat', 'bitpat.f90') | ||
test('Bit Pattern', bitpat) | ||
|
||
justwait_exe = executable('justwait', 'pause.f90') | ||
|
||
mkdirstd = executable('mkdirstd', 'mkdir.f90') | ||
test('mkdir', mkdirstd, args: 'testdir/hello') | ||
|
||
sleepstd = executable('sleepstd', 'sleep.f90') | ||
test('Micro sleep', sleepstd, timeout : 1) | ||
|
||
statement = executable('statement', 'statement_function.f90') | ||
test('Statement', statement) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
!! This program demonstrates color text output to terminal from Fortran program. | ||
!! It uses ANSI escape codes and also works on modern Windows consoles. | ||
!! It is compatible across compiler vendors. | ||
!! | ||
!! More colors: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors | ||
|
||
use, intrinsic :: iso_fortran_env, only: stderr=>error_unit | ||
|
||
character, parameter :: e = char(27) !< escape | ||
|
||
character(5), parameter :: & | ||
red = e // '[31m', & | ||
yellow = e // '[33m', & | ||
normal = e // '[0m' | ||
|
||
print *, red // 'this is red text to stdout' // normal // ' this is regular text to stdout' | ||
write(stderr,*) red // 'this is red text to stderr' // normal // ' this is regular text to stderr' | ||
|
||
print *, yellow // 'this is yellow on stdout' | ||
print *, 'this stdout is also yellow because the prior statement did not set normal' | ||
|
||
write(stderr,*) 'stderr is also yellow.' | ||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,23 @@ | ||
osdet = library('osdet', ['os_detect.f90']) | ||
color_exe = executable('color', 'color_text.f90') | ||
|
||
fc = meson.get_compiler('fortran') | ||
code = '''call execute_command_line(' '); error stop; end''' | ||
f2008 = fc.compiles(code) | ||
osdet = library('osdet', 'os_detect.f90') | ||
|
||
code = '''character :: b; error stop b; end''' | ||
f2018 = fc.compiles(code) | ||
fc = meson.get_compiler('fortran') | ||
f08command = fc.links('call execute_command_line(" "); end', | ||
name : 'F2008 execute_command_line') | ||
|
||
if f2008 | ||
if f08command | ||
gitrev = executable('gitrev', 'gitrev.f90') | ||
test('Git revision log', gitrev) | ||
|
||
complog = executable('complog', 'compiler_log.f90') | ||
test('Compiler version log', complog) | ||
|
||
sound = executable('sound', 'play_sound.f90') | ||
test('Play Sound', sound) | ||
test('Compiler version logging', complog) | ||
|
||
gitrev = executable('gitrev', 'gitrev.f90') | ||
test('Git Revision', gitrev) | ||
playsound_exe = executable('playsound', 'play_sound.f90') | ||
endif | ||
|
||
if f2018 | ||
|
||
callpy = executable('call_python', 'call_python_script.f90', link_with : osdet) | ||
test('Call Python', callpy) | ||
|
||
f18errorstop = fc.compiles('error stop; end', name: 'F2018 error stop') | ||
if f18errorstop | ||
callpython_exe = executable('callpython', 'call_python_script.f90', | ||
link_with : osdet) | ||
endif | ||
|
||
|