Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/wjiang/size_kind
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyuan-jiang authored Jan 27, 2023
2 parents b6e9b5a + e8b136e commit 8180bbb
Show file tree
Hide file tree
Showing 34 changed files with 1,062 additions and 379 deletions.
51 changes: 36 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
name: CI Tests

on: [pull_request]
on:
pull_request:
types: [opened, synchronize, reopened]
# Do not run if the only files changed cannot affect the build
paths-ignore:
- "**.md"
- "**.MD"
- "Licence.txt"
- "Copyright.txt"

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-10.15, macos-11]
compiler: [gfortran-8, gfortran-9, gfortran-10]
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
compiler: [gfortran-9, gfortran-10, gfortran-11, gfortran-12]
exclude:
- os: macos-10.15
compiler: gfortran-8
- os: ubuntu-20.04
compiler: gfortran-11
- os: ubuntu-20.04
compiler: gfortran-12
- os: ubuntu-22.04
compiler: gfortran-9
- os: macos-11
compiler: gfortran-8
compiler: gfortran-12
- os: macos-12
compiler: gfortran-9
- os: macos-12
compiler: gfortran-10
- os: macos-12
compiler: gfortran-12

# fail-fast is set to 'true' here which is good for production, but when
# fail-fast if set to 'true' here is good for production, but when
# debugging, set to 'false'. fail-fast means if *any* ci test in the matrix fails
# GitHub Actions will stop any other test immediately. So good for production, bad
# when trying to figure something out. For more info see:
# https://www.edwardthomson.com/blog/github_actions_6_fail_fast_matrix_workflows.html

fail-fast: true
fail-fast: false
env:
FC: ${{ matrix.compiler }}
LANGUAGE: en_US.UTF-8
Expand All @@ -34,14 +52,10 @@ jobs:

name: ${{ matrix.os }} / ${{ matrix.compiler }}
steps:
- name: Install GCC 8 on Ubuntu 20
if: matrix.os == 'ubuntu-20.04' && matrix.compiler == 'gfortran-8'
- name: Install GCC 12 on Ubuntu 22.04
if: matrix.os == 'ubuntu-22.04' && matrix.compiler == 'gfortran-12'
run: |
sudo apt-get install gfortran-8 -y
- name: Install GCC 11 on Ubuntu 20
if: matrix.os == 'ubuntu-20.04' && matrix.compiler == 'gfortran-11'
run: |
sudo apt-get install gfortran-11 -y
sudo apt-get install gfortran-12 -y
- name: Compiler Versions
run: |
${FC} --version
Expand All @@ -67,3 +81,10 @@ jobs:
run: |
cd build
ctest -j1 --output-on-failure --repeat until-pass:4
- name: Archive log files on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: logfiles
path: |
build/**/*.log
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (COMMAND cmake_policy)
endif (COMMAND cmake_policy)

project (GFTL
VERSION 1.5.3
VERSION 1.8.2
LANGUAGES NONE)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
Expand Down
126 changes: 124 additions & 2 deletions ChangeLog.MD
Original file line number Diff line number Diff line change
@@ -1,9 +1,133 @@
# Change Log

## Unreleased

## [1.8.2] - 2023-01-23

### Fixed

- Fix issues with GNU Make builds

## [1.8.1] - 2022-06-28

### Fixed

- Prevented some macro redefinitions in `v1/map.inc` that caused warning messages and broke documentation tool on downstream projects.

## [1.8.0] - 2022-05-31

## Changed

- Interfaces (intents) to map::at() and ordered_map::at(). The self object should be `INTENT(IN)` for these interfaces.

- Updated GitHub Actions
- OSs
- Remove macos-10.15
- Add ubuntu-22.04 and macos-12
- Compilers
- Removed gfortran-8
- Added gfortran-11
- Added gfortran-12 (for ubuntu-22.04)

## Fixed

- Fixed bug in `vector::insert_range()` (needs a unit test)

- Added `TARGET` to some dummy arguments to prevent NAG from doing copy-in / copy-out. Seems to have been causing a memory corruption issue with the yaFyaml package, but might indicate a bug
in yaFyaml (or gFTL).

- Fixed non-standard-conforming mismatched integer KIND in deque implementation.

- Fixed misspelling of SUCCESS

## Removed

- Various unused local variables that were causing annoying compiler warnings.

- Reactivated unit tests (involving Foo) that were deactivated as a workaround for some NAG 7.1 compiler releases.


## [1.7.2] - 2022-05-08

### Fixed

- Patched (again) such that the assignment operator for Set invokes a deep copy. Previously I mistakenly thought that since the data structure now uses ALLOCATABLE components that Fortran intrinsic assignment would suffice. But forgot that the "parent" component is still a pointer. Failures from this assumption were subtle as often parents would point to correctly looking copies outside the intended data structure.

- Missing RECURSIVE declarations on some procedures. The issue arises for YAML data structures where a map may contain items of the same map type and similarly for vectors.

### Added

- A verify() method was added to several containers to aid in debugging some of the problems mentioned above. Users of gFTL should not use this method - its interface may change and the procedure may even disappear in later releases.

## [1.7.1] - 2022-04-24

### Fixed

- Corrected previous commit that eliminated the non intrinsic
assignment for set, map, and `ordered_map` containers. Just had not
thought through why these are needed: internal pointers are not
correctly established by intrinsic assignment. I was too focused on
the nice property that allocatable components ar correctly
_deallocated_. Use cases would sometimes work, because the compiler
was avoiding copies when using constructors.
p

## [1.7.0] - 2022-04-08

### Changed

- Eliminated type-bound overload of `assignment(=)` for set, map, and ordered_map. It was found that
it caused problems with ifort 2021.5.0 and not needed by other compilers after other recent changes.

- Also made deep-copy RECURSIVE, as this is needed in the yaFyaml use
case. RECURSIVE is of course now default in Fortran, but not all compilers
have implemented this consistently at this time.

## [1.6.1] - 2022-03-30

### Fixed

- Missing RECURSIVE on methods in vector template. This is necessary
for some use cases involving recursive data structures. In particular
sequences-of-sequences in yaFyaml. GFortran has not yet implemented
default RECURSIVE, which is what actually makes this necessary. (So not
technically a bug, but ...)

## [1.6.0] - 2022-03-16

### Added

- NVHPC compiler support

### Removed

- Removed `PGI.mk` and `NAG.mk` files which seem to be unneeded cruft

## [1.5.5] - 2022-03-07


### Changed

- On Windows M4 program is now downloaded from SourceForge during CMake configuration
if it is not found.

### Fixed

- Some procedures for `map` and `ordered_map` had not been implemented and are now added in. This was an oversight and thus being treated as a bug rather than a feature.


## [1.5.4] - 2022-01-10

### Fixed

- Minor bug in Pair template that is exposed under certain combinations
of key/value types. If key has "==" but "value" does not, then some
local variable declarations are skipped that are needed.

- Declarion of Ptr argument in Pointer template. Still not ready
for production use though.


## [1.5.3] - 2021-11-16

### Fixed
Expand Down Expand Up @@ -164,8 +288,6 @@ modulo Fortran syntax.

This is to allow useful diagnostics via DTIO.


>>>>>>> ad6bb41... Changed location of GFTLConfig.cmake
## [1.2.5] - 2020-04-06

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![Build Status](https://travis-ci.com/Goddard-Fortran-Ecosystem/gFTL.svg?branch=master)](https://travis-ci.com/Goddard-Fortran-Ecosystem/gFTL)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

This package generates containers (Vector, Set, Map, ...) with Fortran interfaces. It is essentially a brute force analog of C++ STL.

# v2.0 is coming

Starting with the current release, new containers and changed
Expand Down
2 changes: 1 addition & 1 deletion cmake/CheckFortranSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ macro (CHECK_Fortran_SOURCE_COMPILE file var)

if (${var})
if (NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${var}: SUCCESSS")
message(STATUS "Performing Test ${var}: SUCCESS")
endif ()

add_definitions(-D${var})
Expand Down
2 changes: 1 addition & 1 deletion cmake/GFTL.mk.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Include file for external projects using Unix Make instead of cmake.

GFTL_INSTALL_PREFIX := @CMAKE_INSTALL_PREFIX@
GFTL_VERSION := @GFTL_VERSION@
GFTL_VERSION := @GFTL_VERSION_MAJOR@.@GFTL_VERSION_MINOR@
GFTL_TOP_DIR = $(GFTL_INSTALL_PREFIX)/GFTL-$(GFTL_VERSION)

GFTL_INCLUDE_DIR := $(GFTL_TOP_DIR)/include/v1
Expand Down
2 changes: 2 additions & 0 deletions cmake/GFTLConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Package configuration file
@PACKAGE_INIT@

set(GFTL_TOP_DIR @GFTL_TOP_DIR@)

include ("${CMAKE_CURRENT_LIST_DIR}/GFTLTargets.cmake")

10 changes: 0 additions & 10 deletions cmake/NAG.mk

This file was deleted.

9 changes: 9 additions & 0 deletions cmake/NVHPC.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Compiler specific flags for NVIDIA Fortran compiler

set(traceback "-traceback")
set(check_all "-Mbounds -Mchkstk")

set(CMAKE_Fortran_FLAGS_DEBUG "-O0")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS "-g ${traceback} ${check_all} -Mallocatable=03")

3 changes: 1 addition & 2 deletions cmake/PGI.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Compiler specific flags for PGI Fortran compiler
# (or is this now NVIDIA?)

set(traceback "-traceback")
set(check_all "-Mbounds -Mchkfpstk -Mchkstk")
set(check_all "-Mbounds -Mchkstk")

set(CMAKE_Fortran_FLAGS_DEBUG "-O0")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
Expand Down
10 changes: 0 additions & 10 deletions cmake/PGI.mk

This file was deleted.

10 changes: 10 additions & 0 deletions include/v1/templates/map.inc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@

#include "templates/type_set_use_tokens.inc"

#ifdef __USE_ASSIGN
# undef __USE_ASSIGN
#endif
#ifdef __USE_MOVE
# undef __USE_MOVE
#endif
#ifdef __USE_FREE
# undef __USE_FREE
#endif

#ifdef __PAIR_ASSIGN
# define __USE_ASSIGN(dest,src) __PAIR_ASSIGN(dest,src)
#else
Expand Down
4 changes: 4 additions & 0 deletions include/v1/templates/unused.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
! Licensed under the Apache License, Version 2.0. |
!--------------------------------------------------------------------

#ifdef _UNUSED_DUMMY
# undef _UNUSED_DUMMY
#endif

#define _UNUSED_DUMMY(dummy) if (.false.) print*,shape(dummy)
2 changes: 2 additions & 0 deletions include/v2/algorithms/find/procedures.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
type(keywordenforcer), intent(in) :: unused

j%placeholder = -1
__UNUSED_DUMMY(do_not_use)
__UNUSED_DUMMY(unused)
end function __MANGLE(find_basic)
#endif

Expand Down
Loading

0 comments on commit 8180bbb

Please sign in to comment.