forked from fortran-lang/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dev-optval
- Loading branch information
Showing
31 changed files
with
525 additions
and
84 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 |
---|---|---|
@@ -1,12 +1,25 @@ | ||
cmake_minimum_required(VERSION 3.5.0) | ||
cmake_minimum_required(VERSION 3.14.0) | ||
project(stdlib Fortran) | ||
enable_testing() | ||
|
||
# this avoids stdlib and projects using stdlib from having to introspect stdlib's directory structure | ||
# FIXME: this eventually needs to be handled more precisely, as this spills all .mod/.smod into one directory | ||
# and thereby can clash if module/submodule names are the same in different parts of library | ||
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
|
||
# compiler feature checks | ||
# --- compiler options | ||
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU) | ||
add_compile_options(-fimplicit-none) | ||
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) | ||
add_compile_options(-warn declarations) | ||
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL PGI) | ||
add_compile_options(-Mdclchk) | ||
endif() | ||
|
||
# --- compiler feature checks | ||
include(CheckFortranSourceCompiles) | ||
include(CheckFortranSourceRuns) | ||
check_fortran_source_compiles("error stop i; end" f18errorstop SRC_EXT f90) | ||
check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128) | ||
|
||
add_subdirectory(src) |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
submodule (stdlib_experimental_error) estop | ||
|
||
implicit none | ||
|
||
contains | ||
|
||
module procedure error_stop | ||
|
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,5 +1,7 @@ | ||
submodule (stdlib_experimental_error) estop | ||
|
||
implicit none | ||
|
||
contains | ||
|
||
module procedure error_stop | ||
|
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module stdlib_experimental_kinds | ||
use iso_fortran_env, only: sp=>real32, dp=>real64, qp=>real128 | ||
use iso_fortran_env, only: int8, int16, int32, int64 | ||
! If we decide later to use iso_fortran_env instead of iso_fortran_env: | ||
!use iso_c_binding, only: sp=>c_float, dp=>c_double, qp=>c_float128 | ||
!use iso_c_binding, only: int8=>c_int8_t, int16=>c_int16_t, int32=>c_int32_t, int64=>c_int64_t | ||
implicit none | ||
private | ||
public sp, dp, qp, int8, int16, int32, int64 | ||
end module |
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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
macro(ADDTEST name) | ||
add_executable(test_${name} test_${name}.f90) | ||
target_link_libraries(test_${name} fortran_stdlib) | ||
add_test(NAME ${name} | ||
COMMAND $<TARGET_FILE:test_${name}> ${CMAKE_CURRENT_BINARY_DIR} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
endmacro(ADDTEST) | ||
|
||
add_subdirectory(ascii) | ||
add_subdirectory(loadtxt) | ||
add_subdirectory(io) | ||
add_subdirectory(optval) | ||
|
||
add_executable(test_skip test_skip.f90) | ||
target_link_libraries(test_skip fortran_stdlib) | ||
add_test(NAME AlwaysSkip COMMAND $<TARGET_FILE:test_skip>) | ||
set_tests_properties(AlwaysSkip PROPERTIES SKIP_RETURN_CODE 77) | ||
|
||
add_executable(test_fail test_fail.f90) | ||
target_link_libraries(test_fail fortran_stdlib) | ||
add_test(NAME AlwaysFail COMMAND $<TARGET_FILE:test_fail>) | ||
set_tests_properties(AlwaysFail PROPERTIES WILL_FAIL true) | ||
ADDTEST(always_skip) | ||
set_tests_properties(always_skip PROPERTIES SKIP_RETURN_CODE 77) | ||
ADDTEST(always_fail) | ||
set_tests_properties(always_fail PROPERTIES WILL_FAIL true) |
Oops, something went wrong.