Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 20 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SWAT+ CI for GitHub, O. David, 2024, LGPL 2.1
# SWIFT CI for GitHub, O. David, 2024, LGPL 2.1

name: Build/Release SWAT+
name: Build/Release SWIFT

on:
push:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
ref: '${{ github.event.inputs.rev }}'
fetch-tags: true
fetch-depth: 0
- name: Get SWAT+ version
- name: Get SWIFT version
id: get_version
run: |
V=`git describe --tags`
Expand All @@ -50,7 +50,7 @@ jobs:
name: release_tag
path: v.txt

##### Build swat with GNU
##### Build SWIFT with GNU
build-gnu:
runs-on: ${{ matrix.os }}
needs:
Expand All @@ -75,19 +75,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Build SWAT+
- name: Build SWIFT
id: build_exe
run: |
echo ${{ env.FC }}
cmake --version

RELEASE_VERSION=${GITHUB_REF#refs/*/}
os="$RUNNER_OS"
e="build/swatplus-*"
e="build/swift-*"
gen="Unix"

if [ "$RUNNER_OS" == "Windows" ]; then
e="build/swatplus-*.exe"
e="build/swift-*.exe"
gen="MinGW"
fi

Expand All @@ -100,7 +100,7 @@ jobs:
# build
cmake --build build --parallel 4

exebase=`basename -s .exe build/swatplus-*`
exebase=`basename -s .exe build/swift-*`
exez="${exebase}.zip"
exe=`ls $e`

Expand All @@ -112,11 +112,11 @@ jobs:
echo "exez=$exez" >> $GITHUB_OUTPUT
echo "os=$os" >> $GITHUB_OUTPUT

ls -hl build/swatplus-*
file build/swatplus-*
ls -hl build/swift-*
file build/swift-*

if [ "$RUNNER_OS" != "Windows" ]; then
(cd build && zip ../$exez swatplus-*)
(cd build && zip ../$exez swift-*)
fi

shell: bash
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
with:
name: release_tag

- name: Build SWAT+
- name: Build SWIFT
id: build_exe
run: |
echo ${{ env.FC }}
Expand All @@ -193,20 +193,20 @@ jobs:
-D CMAKE_Fortran_COMPILER=${{ env.FC }} \
-D TAG=$RELEASE_VERSION \
-D CMAKE_BUILD_TYPE=Release
e="build/swatplus-*"
e="build/swift-*"
elif [ "$RUNNER_OS" == "Windows" ]; then
cmake -B build -G "MinGW Makefiles" \
-D CMAKE_Fortran_COMPILER="C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\bin\${{ env.FC }}.exe" \
-D TAG=$RELEASE_VERSION \
-D CMAKE_BUILD_TYPE=Release
e="build/swatplus-*.exe"
e="build/swift-*.exe"
elif [ "$RUNNER_OS" == "macOS" ]; then
cmake -B build \
-D CMAKE_Fortran_COMPILER=${{ env.FC }} \
-D TAG=$RELEASE_VERSION \
-D CMAKE_APPLE_SILICON_PROCESSOR="x86_64" \
-D CMAKE_BUILD_TYPE=Release
e="build/swatplus-*"
e="build/swift-*"
else
echo "$RUNNER_OS not supported."
exit 1
Expand All @@ -215,7 +215,7 @@ jobs:
# compile
cmake --build build --parallel 4

exebase=`basename -s .exe build/swatplus-*`
exebase=`basename -s .exe build/swift-*`
exez="${exebase}.zip"
exe=`ls $e`

Expand All @@ -227,11 +227,11 @@ jobs:
echo "exez=$exez" >> $GITHUB_OUTPUT
echo "os=$os" >> $GITHUB_OUTPUT

ls -hl build/swatplus-*
file build/swatplus-*
ls -hl build/swift-*
file build/swift-*

if [ "$RUNNER_OS" != "Windows" ]; then
(cd build && zip ../$exez swatplus-*)
(cd build && zip ../$exez swift-*)
fi

shell: bash
Expand Down Expand Up @@ -307,8 +307,5 @@ jobs:
draft: false
# name: ${{ github.event.release.tag_name }}
name: ${{ steps.read_ver.outputs.rv }}
files: swatplus-*
files: swift-*
generate_release_notes: true



6 changes: 3 additions & 3 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SWAT+ CI for GitHub, O. David, 2024, LGPL 2.1
# SWIFT CI for GitHub, O. David, 2024, LGPL 2.1

name: Document SWAT+
name: Document SWIFT

on:
push:
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
sudo apt install -y graphviz
sudo pip install ford

- name: Build SWAT+ Documentation
- name: Build SWIFT Documentation
run: |
T=`git describe --tags --abbrev=0`
cmake -B build -D TAG=${T}
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SWAT+ CI for GitHub, O. David, 2024, LGPL 2.1
# SWIFT CI for GitHub, O. David, 2024, LGPL 2.1

name: Build/Test SWAT+
name: Build/Test SWIFT

on:
push:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Build SWAT+
- name: Build SWIFT
id: build_exe
run: |
echo ${{ env.FC }}
Expand Down Expand Up @@ -75,8 +75,8 @@ jobs:
cmake --build build

# check
ls -hl build/swatplus-*
file build/swatplus-*
ls -hl build/swift-*
file build/swift-*
shell: bash

- name: Run Tests
Expand All @@ -91,4 +91,3 @@ jobs:
echo "Test Log:"
cat build/Testing/Temporary/LastTest.log
shell: bash

18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SWAT+ cmake, req min v3.20 (ifx, etc. support)
# SWIFT cmake, req min v3.20 (ifx, etc. support)
###############################################################
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" OR
"${CMAKE_SOURCE_DIR}/src" STREQUAL "${CMAKE_BINARY_DIR}")
Expand All @@ -7,7 +7,7 @@ endif()

cmake_minimum_required(VERSION 3.20)

project(swatplus VERSION 0.2 LANGUAGES Fortran)
project(swift VERSION 0.2 LANGUAGES Fortran)

include(CTest)

Expand Down Expand Up @@ -90,9 +90,9 @@ else()
set(TY "")
endif()

# SWAT Version number
set(SWAT_VERSION ${TAG})
set(SWATPLUS_EXE "swatplus-${SWAT_VERSION}-${FFC}-${AR}${TY}")
# SWIFT Version number
set(SWIFT_VERSION ${TAG})
set(SWIFT_EXE "swift-${SWIFT_VERSION}-${FFC}-${AR}${TY}")

# Set this to 'TRUE' to see the fortran command on compile
set(CMAKE_VERBOSE_MAKEFILE FALSE)
Expand Down Expand Up @@ -129,19 +129,19 @@ endif()


file(GLOB sources src/*.f90)
add_executable(${SWATPLUS_EXE} ${sources})
add_executable(${SWIFT_EXE} ${sources})

#############################################################################
# Install
install(TARGETS ${SWATPLUS_EXE} DESTINATION RUNTIME DESTINATION ${PROJECT_SOURCE_DIR})
install(TARGETS ${SWIFT_EXE} DESTINATION RUNTIME DESTINATION ${PROJECT_SOURCE_DIR})


#############################################################################
# Testing
find_package(Python3 REQUIRED)

set(spcheck "${PROJECT_SOURCE_DIR}/test/spcheck.py")
set(exe_path "${PROJECT_BINARY_DIR}/${SWATPLUS_EXE}")
set(exe_path "${PROJECT_BINARY_DIR}/${SWIFT_EXE}")
set(test_dir "${PROJECT_BINARY_DIR}/data")
set(ref_dir "${PROJECT_SOURCE_DIR}/data")

Expand All @@ -166,7 +166,7 @@ message( "-- DEBUG ${CMAKE_Fortran_FLAGS_DEBUG}")
message( "-- PROJECT_DIR ${PROJECT_SOURCE_DIR}")
message( "-- BINARY_DIR ${PROJECT_BINARY_DIR}")
message( "-- Install Prefix ${CMAKE_INSTALL_PREFIX}")
message( "-- Executable ${SWATPLUS_EXE}, rev/tag: ${SWAT_VERSION}")
message( "-- Executable ${SWIFT_EXE}, rev/tag: ${SWIFT_VERSION}")
message( "-- FORD project ${PROJECT_SOURCE_DIR}/ford.md")
message( "-- Test Data Dir ${ref_dir}")
message( "-- Abs Error ${aerr}")
Expand Down
10 changes: 5 additions & 5 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "ifort_debug",
"displayName": "ifort debug version",
"description": "Preset to builds ifort debug executable for swatplus",
"description": "Preset to builds ifort debug executable for swift",
"binaryDir": "build/debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
Expand All @@ -15,7 +15,7 @@
{
"name": "ifx_debug",
"displayName": "ifx debug version",
"description": "Preset to builds a ifx debug executable for swatplus",
"description": "Preset to builds a ifx debug executable for swift",
"binaryDir": "build/debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
Expand All @@ -26,7 +26,7 @@
{
"name": "gfortran_debug_windows",
"displayName": "gfortran debug version",
"description": "Builds a gfortran debug executable for swatplus for windows",
"description": "Builds a gfortran debug executable for swift for windows",
"binaryDir": "build/debug",
"generator": "Ninja",
"condition": {
Expand All @@ -51,7 +51,7 @@
{
"name": "gfortran_debug_linux",
"displayName": "gfortran debug version",
"description": "Builds a gfortran debug executable for swatplus for linux",
"description": "Builds a gfortran debug executable for swift for linux",
"binaryDir": "build/debug",
"condition": {
"type": "equals",
Expand All @@ -67,7 +67,7 @@
{
"name": "gfortran_debug_macbook",
"displayName": "gfortran debug version",
"description": "Builds a gfortran debug executable for swatplus for macbook",
"description": "Builds a gfortran debug executable for swift for macbook",
"binaryDir": "build/debug",
"condition": {
"type": "equals",
Expand Down
30 changes: 15 additions & 15 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\build\\${name}",
"installRoot": "${projectDir}\\build\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
}
]
}
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\build\\${name}",
"installRoot": "${projectDir}\\build\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
}
]
}
Loading