From 96289a63d9156a757f9ce004a629dc604ba951fc Mon Sep 17 00:00:00 2001 From: charlie-foxtrot <13514783+charlie-foxtrot@users.noreply.github.com> Date: Sun, 4 Feb 2024 20:02:01 -0800 Subject: [PATCH] Fix broadcom GPU build error (#459) * change the CI build on rpi3b build to use broadcom GPU * disable -Wcast-qual for hello_fft --- .github/platform_build | 34 +++++++++++++++++++ ...ainers.yml => build_docker_containers.yml} | 0 .github/workflows/{build.yml => ci_build.yml} | 4 +-- .github/workflows/platform_build.yml | 32 +++++++++++++++++ src/hello_fft/CMakeLists.txt | 3 ++ 5 files changed, 71 insertions(+), 2 deletions(-) create mode 100755 .github/platform_build rename .github/workflows/{build_containers.yml => build_docker_containers.yml} (100%) rename .github/workflows/{build.yml => ci_build.yml} (94%) create mode 100644 .github/workflows/platform_build.yml diff --git a/.github/platform_build b/.github/platform_build new file mode 100755 index 0000000..31b30b7 --- /dev/null +++ b/.github/platform_build @@ -0,0 +1,34 @@ +#!/bin/bash -e + +platform="${1}" + +if [ -z "${platform}" ]; then + echo "Error: platform not set" + exit -1 +fi + +echo "running build for ${platform} on $(source /etc/os-release ; echo ${VERSION})" + +case "${platform}" in + rpi3b) + CMAKE_ARGS="-DPLATFORM=rpiv2 -DCMAKE_BUILD_TYPE=Release -DNFM=TRUE -DBUILD_UNITTESTS=TRUE" + ;; + + *) + echo "Error: Platform '${platform}' not supported" + exit -1 +esac + +# make a build dir +rm -rf build || true ; mkdir build +cd build + +# configure and build +cmake ${CMAKE_ARGS} ../ +make -j + +# run unit tests +src/unittests + +# run rtl_airband to get version string and exit +src/rtl_airband -v diff --git a/.github/workflows/build_containers.yml b/.github/workflows/build_docker_containers.yml similarity index 100% rename from .github/workflows/build_containers.yml rename to .github/workflows/build_docker_containers.yml diff --git a/.github/workflows/build.yml b/.github/workflows/ci_build.yml similarity index 94% rename from .github/workflows/build.yml rename to .github/workflows/ci_build.yml index 2017735..503c241 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/ci_build.yml @@ -2,7 +2,7 @@ name: Run CI on: push: - branches: [main, unstable] + branches: [main] tags: ['v*'] pull_request: workflow_dispatch: @@ -13,7 +13,7 @@ jobs: ci_build: strategy: matrix: - os: [ ubuntu-22.04, macos-12, rpi3b, macos-13, ubuntu-20.04 ] + os: [ ubuntu-22.04, macos-12, macos-13, ubuntu-20.04 ] runs-on: ${{ matrix.os }} timeout-minutes: 35 # runtime across all OSs, runs can get queued steps: diff --git a/.github/workflows/platform_build.yml b/.github/workflows/platform_build.yml new file mode 100644 index 0000000..5376216 --- /dev/null +++ b/.github/workflows/platform_build.yml @@ -0,0 +1,32 @@ +name: Run CI + +on: + push: + branches: [main] + tags: ['v*'] + pull_request: + workflow_dispatch: + schedule: + - cron: '39 13 * * *' # run daily + +jobs: + platform_build: + strategy: + matrix: + os: [ rpi3b ] + runs-on: ${{ matrix.os }} + timeout-minutes: 35 # runtime across all OSs, runs can get queued + steps: + - name: Runner Info + run: printenv | sort + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: '0' # need full history to get version from git tag + + - name: Install packaged dependencies + run: .github/install_dependencies + + - name: Configure Build and Test + run: .github/platform_build ${{ matrix.os }} diff --git a/src/hello_fft/CMakeLists.txt b/src/hello_fft/CMakeLists.txt index 0838edd..9a623b9 100644 --- a/src/hello_fft/CMakeLists.txt +++ b/src/hello_fft/CMakeLists.txt @@ -16,3 +16,6 @@ target_include_directories(hello_fft PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/.." # needed for config.h ${BCM_VC_INCLUDE_DIRS} ) + +# disable -Wcast-qual for this folder +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cast-qual")