diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..152f8d5 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "image" : "ghcr.io/uliegecsm/kokkos-utils/kokkos-utils:latest", + "extensions" : [ + "ms-vscode.cmake-tools", + "mhutchie.git-graph" + ], + "onCreateCommand": "git config --global --add safe.directory $PWD" +} diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..183721a --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ +## Summary + +(Summarize the content of the PR concisely) + +## Description + +(A longer description of the PR) + +## Related to + +(A list of issues, PRs, links) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f97ab20 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,73 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + branches: + - main + +env: + REGISTRY: ghcr.io + +jobs: + + set-env: + runs-on: [ubuntu-22.04] + outputs: + CI_IMAGE : ${{ steps.common.outputs.CI_IMAGE }} + steps: + - name: Export common variables. + id : common + run : | + echo "CI_IMAGE=${{ env.REGISTRY }}/${{ github.repository }}/kokkos-utils:latest" >> $GITHUB_OUTPUT + + build-image: + needs: [set-env] + runs-on: [ubuntu-22.04] + container: + image: docker:latest + permissions: + packages: write + steps: + - name: Checkout code. + uses: actions/checkout@v4 + + - name: Log in to Docker registry. + run : | + docker login -u ${{ github.actor}} -p ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }} + + - name: Build Docker image. + run : | + apk add jq + + GOOGLETEST_VERSION=$(jq .dependencies.googletest.value version.json -j) + KOKKOS_VERSION=$(jq .dependencies.kokkos.value version.json -j) + + docker buildx build \ + --pull \ + --push \ + --file dockerfile \ + --platform linux/amd64 \ + --tag ${{ needs.set-env.outputs.CI_IMAGE }} \ + --cache-from ${{ needs.set-env.outputs.CI_IMAGE }} \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + --build-arg GOOGLETEST_VERSION=${GOOGLETEST_VERSION} \ + --build-arg KOKKOS_VERSION=${KOKKOS_VERSION} \ + --build-arg KOKKOS_PRESET=OpenMP \ + . + + build-library: + needs: [set-env, build-image] + runs-on: [ubuntu-22.04] + container: + image: ${{ needs.set-env.outputs.CI_IMAGE }} + steps: + - name: Checkout code. + uses: actions/checkout@v4 + + - name: Configure and build. + run : | + cmake -S . -B build + cmake --build build diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2d887a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Ignore CMake build directory +build*/* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..715cf30 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.5) + +project( + kokkos-utils + VERSION 0.0.1 + LANGUAGES CXX +) + +#---- C++ standard that we need (at least). +set(CMAKE_CXX_STANDARD 20 CACHE BOOL "" FORCE) +set(CMAKE_CXX_STANDARD_REQUIRED True CACHE BOOL "" FORCE) + +find_package(GTest REQUIRED) diff --git a/README.md b/README.md index eff7290..c9ccaca 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # kokkos-utils -This repository contains utilities related to `Kokkos`. + +This repository contains utilities related to [`Kokkos`](https://kokkos.org/). diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..93abada --- /dev/null +++ b/dockerfile @@ -0,0 +1,71 @@ +FROM ubuntu:24.04 as apt-requirements + +# Install APT requirements. +RUN --mount=target=/requirements,type=bind,source=requirements <