Skip to content

Commit abb4a3c

Browse files
authored
Merge branch 'master' into master
2 parents ec6d900 + 84c75fb commit abb4a3c

25 files changed

+358
-114
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ root = true
1010

1111
[*.{f90,F90}]
1212
indent_style = space
13-
indent_size = 2
13+
indent_size = 4
1414
trim_trailing_whitespace = true
1515
max_line_length = 132
1616
insert_final_newline = true

.github/workflows/main.yml renamed to .github/workflows/CI.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,10 @@ jobs:
6666
cmake .
6767
cmake --build .
6868
cmake --build . --target test
69+
70+
- name: Test manual makefiles
71+
if: contains(matrix.os, 'ubuntu') && contains(matrix.gcc_v, '9')
72+
run: |
73+
make -f Makefile.manual
74+
make -f Makefile.manual test
75+
make -f Makefile.manual clean

.github/workflows/PR-review.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: PR-Review
2+
on: [pull_request]
3+
jobs:
4+
misspell:
5+
name: review-dog / misspell
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Check out code.
9+
uses: actions/checkout@v1
10+
- name: misspell
11+
uses: reviewdog/action-misspell@v1
12+
with:
13+
github_token: ${{ secrets.github_token }}
14+
locale: "US"
15+
reporter: github-pr-review
16+
level: warning

.github/workflows/ci_windows.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI_windows
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
CI: "ON"
7+
8+
jobs:
9+
Build:
10+
runs-on: windows-latest
11+
strategy:
12+
fail-fast: false
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
17+
- run: cmake -G "MinGW Makefiles" -DCMAKE_SH="CMAKE_SH-NOTFOUND" -Wdev -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace"
18+
19+
env:
20+
FC: gfortran
21+
CC: gcc
22+
CXX: g++
23+
24+
- name: CMake build
25+
run: cmake --build build --parallel
26+
27+
- run: cmake --build build --verbose --parallel 1
28+
if: failure()
29+
30+
- name: CTest
31+
run: ctest --output-on-failure --parallel -V -LE quadruple_precision
32+
working-directory: build
33+
34+
- uses: actions/upload-artifact@v1
35+
if: failure()
36+
with:
37+
name: WindowsCMakeTestlog
38+
path: build/Testing/Temporary/LastTest.log

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ enable_testing()
55
# this avoids stdlib and projects using stdlib from having to introspect stdlib's directory structure
66
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR})
77

8+
# compiler feature checks
9+
include(CheckFortranSourceCompiles)
10+
check_fortran_source_compiles("error stop i; end" f18errorstop SRC_EXT f90)
11+
812
add_subdirectory(src)

Makefile.manual

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# Fortran stdlib Makefile
22

33
FC = gfortran
4-
FCFLAGS=-O0
4+
FFLAGS = -Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all
55

6-
.PHONY: all clean
6+
export FC
7+
export FFLAGS
78

8-
all: stdlib tests
9+
.PHONY: all clean test
910

10-
stdlib:
11-
$(MAKE) -f Makefile.manual FC=${FC} FCFLAGS=${FCFLAGS} --directory=src
11+
all:
12+
$(MAKE) -f Makefile.manual --directory=src
13+
$(MAKE) -f Makefile.manual --directory=src/tests
1214

13-
tests: stdlib
14-
$(MAKE) -f Makefile.manual FC=${FC} FCFLAGS=${FCFLAGS} --directory=src/tests
15+
test:
16+
$(MAKE) -f Makefile.manual --directory=src/tests test
17+
@echo
18+
@echo "All tests passed."
1519

1620
clean:
1721
$(MAKE) -f Makefile.manual clean --directory=src

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Fortran Standard Library
22

3+
## Scope
4+
5+
The goal of the Fortran Standard Library is to achieve the following general scope:
6+
7+
* Utilities (containers, strings, files, OS/environment integration, unit
8+
testing & assertions, logging, ...)
9+
* Algorithms (searching and sorting, merging, ...)
10+
* Mathematics (linear algebra, sparse matrices, special functions, fast Fourier
11+
transform, random numbers, statistics, ordinary differential equations,
12+
numerical integration, optimization, ...)
13+
14+
315
## Getting started
416

517
### Get the code

STYLE_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This style guide is a living document and proposed changes may be adopted after
2929
By setting and following a convention for indentation and whitespace, code reviews and git-diffs can
3030
focus on the semantics of the proposed changes rather than style and formatting.
3131

32-
* The body of every Fortran construct should be indented by __two (2) spaces__
32+
* The body of every Fortran construct should be indented by __two (4) spaces__
3333
* Line length *should be limited to 80 characters* and __must not exceed 132__
3434
* Please do not use <kbd>Tab</kbd> characters for indentation
3535
* Please remove trailing white space before committing code

src/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ set(SRC
77

88
add_library(fortran_stdlib ${SRC})
99

10+
if(f18errorstop)
11+
target_sources(fortran_stdlib PRIVATE f18estop.f90)
12+
else()
13+
target_sources(fortran_stdlib PRIVATE f08estop.f90)
14+
endif()
15+
1016
add_subdirectory(tests)
1117

1218
install(TARGETS fortran_stdlib

src/Makefile.manual

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
OBJS = stdlib_experimental_ascii.o \
2-
stdlib_experimental_error.o \
3-
stdlib_experimental_io.o \
4-
stdlib_experimental_default.o \
1+
SRC = stdlib_experimental_ascii.f90 \
2+
stdlib_experimental_error.f90 \
3+
stdlib_experimental_io.f90 \
4+
stdlib_experimental_default.f90 \
5+
f18estop.f90
6+
7+
LIB = libstdlib.a
58

6-
.PHONY: all clean
7-
.SUFFIXES: .f90 .o
89

9-
all: $(OBJS)
1010

11-
.f90.o:
12-
$(FC) $(FCFLAGS) -c $<
11+
OBJS = $(SRC:.f90=.o)
12+
MODS = $(OBJS:.o=.mod)
13+
SMODS = $(OBJS:.o=*.smod)
14+
15+
.PHONY: all clean
1316

14-
%.o: %.mod
17+
all: $(LIB)
1518

16-
stdlib_experimental_ascii.o: stdlib_experimental_ascii.f90
17-
stdlib_experimental_error.o: stdlib_experimental_error.f90
18-
stdlib_experimental_io.o: stdlib_experimental_io.f90
19-
stdlib_experimental_default.o: stdlib_experimental_default.f90
19+
$(LIB): $(OBJS)
20+
ar rcs $@ $(OBJS)
2021

2122
clean:
22-
$(RM) *.o *.mod
23+
$(RM) $(LIB) $(OBJS) $(MODS) $(SMODS)
24+
25+
%.o: %.f90
26+
$(FC) $(FFLAGS) -c $<
27+
28+
29+
# Fortran module dependencies
30+
f18estop.o: stdlib_experimental_error.o

0 commit comments

Comments
 (0)