Skip to content

HIP compilation

HIP compilation #56

name: Build and Test - Compiler Zoo
on: [pull_request, workflow_dispatch]
env:
GH_ACTIONS_TOOLCHAIN: .github/workflows/toolchains/gh-actions.cmake
jobs:
release_build:
runs-on: ubuntu-latest
container:
image: dbwy/compiler-zoo
strategy:
matrix:
compiler: [ {suite: gnu, version: 12}, {suite: llvm, version: 14} ]
steps:
- uses: actions/checkout@v3
- name: Setup Compiler
shell: bash
run: $GITHUB_WORKSPACE/.github/workflows/scripts/compiler_setup.sh
${{matrix.compiler.suite}} ${{matrix.compiler.version}}
- name: Setup Build Type
shell: bash
run: echo "set(CMAKE_BUILD_TYPE Release CACHE BOOL \"\" FORCE)" >>
${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
- name: Configure CMake
shell: bash
run: cmake -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
-DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
- name: Build
shell: bash
run: cmake --build ${{runner.workspace}}/build -j2
- name: Test
shell: bash
run: cmake --build ${{runner.workspace}}/build --target test
debug_build:
runs-on: ubuntu-latest
container:
image: dbwy/compiler-zoo
steps:
- uses: actions/checkout@v3
- name: Setup Compiler
shell: bash
run: $GITHUB_WORKSPACE/.github/workflows/scripts/compiler_setup.sh
gnu 12
- name: Setup Build Type
shell: bash
run: echo "set(CMAKE_BUILD_TYPE Debug CACHE BOOL \"\" FORCE)" >>
${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
- name: Configure CMake
shell: bash
run: cmake -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
-DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
- name: Build
shell: bash
run: cmake --build ${{runner.workspace}}/build -j2
- name: Test
shell: bash
run: cmake --build ${{runner.workspace}}/build --target test
libxc_versions:
name: Test Libxc Compatibility
needs: release_build
runs-on: ubuntu-latest
container:
image: dbwy/compiler-zoo
strategy:
matrix:
libxc_version: [ 6.2.0 ]
steps:
- uses: actions/checkout@v3
- name: Setup Compiler
shell: bash
run: $GITHUB_WORKSPACE/.github/workflows/scripts/compiler_setup.sh
gnu 12
- name: Setup Build Type
shell: bash
run: echo "set(CMAKE_BUILD_TYPE Debug CACHE BOOL \"\" FORCE)" >>
${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
- name: Setup Libxc
shell: bash
run: |
git clone https://gitlab.com/libxc/libxc.git ${{runner.workspace}}/libxc
git -C ${{runner.workspace}}/libxc checkout ${{matrix.libxc_version}}
- name: Configure CMake
shell: bash
run: cmake -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
-DFETCHCONTENT_SOURCE_DIR_LIBXC=${{runner.workspace}}/libxc
-DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
- name: Build
shell: bash
run: cmake --build ${{runner.workspace}}/build -j2
# - name: Test
# shell: bash
# run: cmake --build ${{runner.workspace}}/build --target test
subproject_build:
name: Build as Subproject
needs: release_build
runs-on: ubuntu-latest
container:
image: dbwy/compiler-zoo
steps:
- uses: actions/checkout@v3
- name: Setup Compiler
shell: bash
run: $GITHUB_WORKSPACE/.github/workflows/scripts/compiler_setup.sh gnu 12
- name: CMake Subproject Configure
shell: bash
run: cmake -S $GITHUB_WORKSPACE/test/cmake/subproject
-B ${{runner.workspace}}/cmake_subproject_build
-DGIT_REVISION=$GITHUB_HEAD_REF
-DFETCHCONTENT_SOURCE_DIR_EXCHCXX=$GITHUB_WORKSPACE
-DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
- name: CMake Subproject Build
shell: bash
run: cmake --build ${{runner.workspace}}/cmake_subproject_build -j2
cmake_discovery:
name: CMake Discovery
needs: release_build
runs-on: ubuntu-latest
container:
image: dbwy/compiler-zoo
steps:
- uses: actions/checkout@v3
- name: Setup Compiler
shell: bash
run: $GITHUB_WORKSPACE/.github/workflows/scripts/compiler_setup.sh gnu 12
- name: Configure CMake
shell: bash
run: cmake -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
-DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
- name: Build
shell: bash
run: cmake --build ${{runner.workspace}}/build -j2
- name: Install
shell: bash
run: cmake --build ${{runner.workspace}}/build --target install
- name: CMake Discovery Configure
shell: bash
run: cmake -S $GITHUB_WORKSPACE/test/cmake/discovery -B ${{runner.workspace}}/cmake_discovery_build
-DCMAKE_PREFIX_PATH="${{runner.workspace}}/install;${ENV_PREFIX_PATH}"
-DCMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${GH_ACTIONS_TOOLCHAIN}
- name: CMake Discovery Build
shell: bash
run: cmake --build ${{runner.workspace}}/cmake_discovery_build -j2