-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hello(world): initial action and CMakeLists
- Loading branch information
1 parent
6b38969
commit de39291
Showing
9 changed files
with
182 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
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 : | | ||
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-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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ignore CMake build directory | ||
build*/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# kokkos-utils | ||
This repository contains utilities related to `Kokkos`. | ||
|
||
This repository contains utilities related to [`Kokkos`](https://kokkos.org/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM ubuntu:24.04 as requirements | ||
|
||
# Install requirements. | ||
RUN --mount=target=/requirements,type=bind,source=requirements <<EOF | ||
|
||
set -ex | ||
|
||
apt update | ||
|
||
apt --yes --no-install-recommends install $(grep -vE "^\s*#" /requirements/requirements.system.txt | tr "\n" " ") | ||
|
||
apt clean && rm -rf /var/lib/apt/lists/* | ||
|
||
EOF | ||
|
||
# Compile Kokkos. | ||
FROM requirements as compile-kokkos | ||
|
||
ARG KOKKOS_VERSION=4.3.00 | ||
ARG KOKKOS_PRESET=OpenMP | ||
|
||
COPY kokkos.cmake.presets.json /kokkos.cmake.presets.json | ||
|
||
RUN <<EOF | ||
|
||
set -ex | ||
|
||
git clone --depth=1 --branch=${KOKKOS_VERSION} https://github.com/kokkos/kokkos kokkos | ||
|
||
cd kokkos | ||
|
||
cp /kokkos.cmake.presets.json CMakePresets.json | ||
|
||
cmake -S . --preset=${KOKKOS_PRESET} -DCMAKE_INSTALL_PREFIX=/opt/kokkos-${KOKKOS_VERSION}-${KOKKOS_PRESET} | ||
|
||
cmake --build --preset=${KOKKOS_PRESET} | ||
|
||
cmake --build --preset=${KOKKOS_PRESET} --target=install | ||
|
||
EOF | ||
|
||
# Get the installed Kokkos files. | ||
FROM compile-kokkos | ||
|
||
COPY --from=compile-kokkos /opt/kokkos-${KOKKOS_VERSION}-${KOKKOS_PRESET} /opt/kokkos-${KOKKOS_VERSION}-${KOKKOS_PRESET} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"version" : 3, | ||
"configurePresets" : [ | ||
{ | ||
"name" : "default", | ||
"binaryDir" : "${sourceDir}/build-with-${presetName}", | ||
"cacheVariables" : { | ||
"CMAKE_BUILD_TYPE" : "Release", | ||
"CMAKE_CXX_STANDARD" : "17", | ||
"CMAKE_CXX_EXTENSIONS" : "OFF", | ||
"BUILD_SHARED_LIBS" : "ON" | ||
} | ||
}, | ||
{ | ||
"name" : "OpenMP", | ||
"inherits" : "default", | ||
"cacheVariables" : { | ||
"Kokkos_ENABLE_OPENMP" : "ON" | ||
} | ||
} | ||
], | ||
"buildPresets" : [ | ||
{ | ||
"name" : "OpenMP", | ||
"configurePreset" : "OpenMP" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Source control | ||
ca-certificates | ||
git | ||
|
||
# Builders | ||
cmake | ||
make | ||
|
||
# Compilers | ||
g++ |