Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[github] GitHub workflow to run small Cilk applications on Ubuntu and… #37

Merged
merged 3 commits into from
Nov 4, 2024
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
70 changes: 70 additions & 0 deletions .github/workflows/small-cilkapps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Small Cilk application tests

permissions:
contents: read

on:
workflow_dispatch:
push:
pull_request:

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
small-apps:
runs-on: ${{ matrix.os }}
container:
image: ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-22.04:latest') || null}}
volumes:
- /mnt/:/mnt/
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-13, macOS-latest]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Setup OpenCilk compiler
id: build-opencilk
uses: OpenCilk/actions/build-opencilk-project@main
with:
projects: clang
os_list: '${{ matrix.os }}'
- name: Build cheetah
id: build-cheetah
shell: bash
run: |
builddir="$(pwd)"/build
opencilkdir='${{ steps.build-opencilk.outputs.opencilk-builddir }}'
mkdir -p $builddir
cmake -G Ninja \
-B "$builddir" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=$opencilkdir/bin/clang \
-DCMAKE_CXX_COMPILER=$opencilkdir/bin/clang++ \
-DLLVM_CMAKE_DIR=$opencilkdir
ninja -C "$builddir"
- name: Checkout small application tests
uses: actions/checkout@v4
with:
repository: OpenCilk/smallapps
path: smallapps
- name: make check
shell: bash
run: |
cheetahdir="$(pwd)"/build
opencilkdir='${{ steps.build-opencilk.outputs.opencilk-builddir }}'
make_prefix=""
if [ "${{ runner.os }}" == "macOS" ]; then
# Use xcrun to build benchmarks on macOS.
make_prefix="xcrun"
fi
$make_prefix make -C smallapps check \
CC=$opencilkdir/bin/clang \
CXX=$opencilkdir/bin/clang++ \
EXTRA_CFLAGS="--opencilk-resource-dir=$cheetahdir" \
EXTRA_LDFLAGS="--opencilk-resource-dir=$cheetahdir"
7 changes: 6 additions & 1 deletion cmake/Modules/AddCheetah.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ function(add_cheetah_bitcode name)
set(output_name_${libname} ${libname}${CHEETAH_OS_SUFFIX})
set(sources_${libname} ${LIB_SOURCES})
list(APPEND libnames ${libname})
set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS} "-arch" ${arch} ${LIB_CFLAGS})
set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS} ${LIB_CFLAGS})
set(${libname}_arch ${arch})
get_cheetah_output_dir(${CHEETAH_DEFAULT_TARGET_ARCH} output_dir_${libname})
get_cheetah_install_dir(${CHEETAH_DEFAULT_TARGET_ARCH} install_dir_${libname})
endforeach()
Expand Down Expand Up @@ -509,6 +510,10 @@ function(add_cheetah_bitcode name)
target_compile_options(${libname}_compile PUBLIC "$<$<CONFIG:RELEASE>:${CHEETAH_RELEASE_OPTIONS}>")
set_property(TARGET ${libname}_compile APPEND PROPERTY
COMPILE_DEFINITIONS ${LIB_DEFS})
if (APPLE)
set_target_properties(${libname}_compile PROPERTIES
OSX_ARCHITECTURES "${${libname}_arch}")
endif()
set(output_file_${libname} lib${output_name_${libname}}.bc)
add_custom_command(
OUTPUT ${output_dir_${libname}}/${output_file_${libname}}
Expand Down
Loading