Skip to content

version updated

version updated #28

# Build SWAT using ifort on Linux
# Refers to https://gist.github.com/scivision/d94bb10a01fa3b8ed0c9a93ee16318ba
name: Build by IntelFortran on Linux
on:
push:
paths:
- 'cmake/**'
- 'src/**'
- 'CMakeLists.txt'
pull_request:
paths:
- 'cmake/**'
- 'src/**'
- 'CMakeLists.txt'
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
linux-ubuntu-ifort:
runs-on: ubuntu-latest
env:
FC: ifort
steps:
- name: Intel Apt repository
timeout-minutes: 1
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
timeout-minutes: 5
run: sudo apt-get install intel-oneapi-compiler-fortran
- name: Checkout SWAT
uses: actions/checkout@v3
- name: Setup Intel oneAPI environment
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- -j 4