Skip to content

Commit

Permalink
Merge pull request #4 from Jim-215-Fisher/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
Jim-215-Fisher committed Dec 31, 2020
2 parents deb318a + 91c1ad4 commit 96c921b
Show file tree
Hide file tree
Showing 27 changed files with 10,169 additions and 593 deletions.
66 changes: 62 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
gcc_v: [7, 8, 9] # Version of GFortran we want to use.
gcc_v: [7, 8, 9, 10] # Version of GFortran we want to use.
env:
FC: gfortran-${{ matrix.gcc_v }}
GCC_V: ${{ matrix.gcc_v }}
Expand Down Expand Up @@ -54,7 +54,9 @@ jobs:
- name: Install GFortran macOS
if: contains( matrix.os, 'macos')
run: brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
run: |
brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
brew link gcc@${GCC_V}
- name: Configure with CMake
run: cmake -Wdev -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAXIMUM_RANK=4 -S . -B build
Expand All @@ -71,15 +73,71 @@ jobs:
working-directory: build

- name: Test in-tree builds
if: contains( matrix.gcc_v, '9') # Only test one compiler on each platform
if: contains( matrix.gcc_v, '10') # Only test one compiler on each platform
run: |
cmake -DCMAKE_MAXIMUM_RANK=4 .
cmake --build .
cmake --build . --target test
- name: Test manual makefiles
if: contains(matrix.os, 'ubuntu') && contains(matrix.gcc_v, '9')
if: contains(matrix.os, 'ubuntu') && contains(matrix.gcc_v, '10')
run: |
make -f Makefile.manual FYPPFLAGS="-DMAXRANK=4"
make -f Makefile.manual test
make -f Makefile.manual clean
intel-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
fc: [ifort]
env:
FC: ${{ matrix.fc }}

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x

- name: Install CMake Linux
if: contains(matrix.os, 'ubuntu')
run: ci/install_cmake.sh

- name: Add Intel repository
if: contains(matrix.os, 'ubuntu')
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI compiler
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get install intel-oneapi-compiler-fortran
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Install fypp
run: pip install --upgrade fypp

- name: Configure with CMake
run: cmake -Wdev -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAXIMUM_RANK=4 -S . -B build

- name: Build and compile
run: cmake --build build

- name: catch build fail
run: cmake --build build --verbose --parallel 1
if: failure()

- name: test
run: ctest --parallel --output-on-failure
working-directory: build
79 changes: 79 additions & 0 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,82 @@ jobs:
with:
name: WindowsCMakeTestlog
path: build/Testing/Temporary/LastTest.log

msys2-build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include: [
{ msystem: MSYS, arch: x86_64 },
{ msystem: MINGW64, arch: x86_64 },
{ msystem: MINGW32, arch: i686 }
]
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2

- name: Setup MinGW native environment
uses: msys2/setup-msys2@v2
if: contains(matrix.msystem, 'MINGW')
with:
msystem: ${{ matrix.msystem }}
update: false
install: >-
git
mingw-w64-${{ matrix.arch }}-gcc
mingw-w64-${{ matrix.arch }}-gcc-fortran
mingw-w64-${{ matrix.arch }}-python
mingw-w64-${{ matrix.arch }}-python-pip
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-ninja
- name: Setup msys POSIX environment
uses: msys2/setup-msys2@v2
if: contains(matrix.msystem, 'MSYS')
with:
msystem: MSYS
update: false
install: >-
git
gcc
gcc-fortran
python
python-pip
cmake
ninja
- name: Install fypp
run: pip install fypp

- run: >-
cmake -G Ninja
-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"
-DCMAKE_MAXIMUM_RANK=4
env:
FC: gfortran
CC: gcc
CXX: g++
- name: CMake build
run: cmake --build build --parallel

- name: catch build fail
run: cmake --build build --verbose --parallel 1
if: failure()

- name: CTest
run: ctest --output-on-failure --parallel -V -LE quadruple_precision
working-directory: build

- uses: actions/upload-artifact@v1
if: failure()
with:
name: WindowsCMakeTestlog
path: build/Testing/Temporary/LastTest.log
11 changes: 8 additions & 3 deletions .github/workflows/doc-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,29 @@ env:
jobs:
Build-API-Docs:
runs-on: macos-latest
env:
GCC_V: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Full history to get tag and commit info
- name: Install GFortran macOS
run: brew install gcc || brew upgrade gcc || true
run: |
brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
brew link gcc@${GCC_V}
gfortran-${GCC_V} --version
- name: Install Dependencies
run: |
pip3 install --prefer-binary --no-clean --disable-pip-version-check --progress-bar off lxml fypp
brew install -f --force-bottle --keep-tmp ford
type -a ford
ford --version
gfortran --version
gfortran-${GCC_V} --version
- name: Skip graph and search unless deploying
if: github.ref != 'refs/heads/master' && ! startsWith( github.ref, 'refs/tags/' )
run: |
sed -i .bak 's/^[[:blank:]]*graph: *[Tt]rue/graph: false/' "${FORD_FILE}"
echo "::set-env name=MAYBE_SKIP_SEARCH::--no-search"
echo "MAYBE_SKIP_SEARCH=--no-search" >> $GITHUB_ENV
- name: Build Docs
run: |
git fetch --all --tags
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
endif()
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
add_compile_options(-warn declarations,general,usage,interfaces,unused)
add_compile_options(-standard-semantics)
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_EQUAL 20.2.1.20200827)
add_compile_options(-standard-semantics)
endif()
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
add_compile_options(-stand f15)
else()
Expand All @@ -35,7 +37,7 @@ endif()
# --- compiler feature checks
include(CheckFortranSourceCompiles)
include(CheckFortranSourceRuns)
check_fortran_source_compiles("error stop i; end" f18errorstop SRC_EXT f90)
check_fortran_source_runs("i=0; error stop i; end" f18errorstop SRC_EXT f90)
check_fortran_source_compiles("real, allocatable :: array(:, :, :, :, :, :, :, :, :, :); end" f03rank SRC_EXT f90)
check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128)

Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ Alternatively, you can build using provided Makefiles:
make -f Makefile.manual
```

## Limiting the maximum rank of generated procedures

Stdlib's preprocessor (fypp) by default generates specific procedures for arrays of all ranks, up to rank 15.
This can result in long compilation times and, on some computers, exceeding available memory.
If you know that you won't need all 15 ranks, you can specify the maximum rank for which the specific procedures will be generated.
For example, with CMake:

```sh
cmake -B build -DCMAKE_MAXIMUM_RANK=4
cmake --build build
cmake --build build --target test
```
or as follows with `make`:

```sh
make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4
```
Note that currently the minimum value for maximum rank is 4.

## Documentation

Documentation is a work in progress (see issue #4) but is currently available at https://stdlib.fortran-lang.org.
Expand Down
2 changes: 2 additions & 0 deletions doc/specs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ This is and index/directory of the specifications (specs) for each new module/fe

## Experimental Features & Modules

- [bitsets](./stdlib_bitsets.html) - Bitset data types and procedures
- [error](./stdlib_error.html) - Catching and handling errors
- [IO](./stdlib_io.html) - Input/output helper & convenience
- [linalg](./stdlib_linalg.html) - Linear Algebra
- [logger](./stdlib_logger.html) - Runtime logging system
- [optval](./stdlib_optval.html) - Fallback value for optional arguments
- [quadrature](./stdlib_quadrature.html) - Numerical integration
- [stats](./stdlib_stats.html) - Descriptive Statistics
Expand Down
Loading

0 comments on commit 96c921b

Please sign in to comment.