diff --git a/.github/actions/linux-deps/action.yml b/.github/actions/linux-deps/action.yml index 3ddfdc95..a2562ef7 100644 --- a/.github/actions/linux-deps/action.yml +++ b/.github/actions/linux-deps/action.yml @@ -9,11 +9,7 @@ runs: run: | sudo apt-get update sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt-get install gcc-13 g++-13 -y - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100 - sudo update-alternatives --config gcc - sudo update-alternatives --config g++ + sudo apt-get install gcc g++ gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y - name: Install Ninja (Linux) shell: sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fa8bb96..83392d51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,13 +22,20 @@ jobs: # target: template_debug # platform: linux # arch: x86_64 - - identifier: linux-release - name: 🐧 Linux (Release) + - identifier: linux-x86_64-release + name: 🐧 Linux x86_64 (Release) build_type: Release runner: ubuntu-20.04 target: template_release platform: linux arch: x86_64 + - identifier: linux-riscv64-release + name: 🐧 Linux riscv64 (Release) + build_type: Release + runner: ubuntu-20.04 + target: template_release + platform: linux + arch: riscv64 # - identifier: windows-debug # name: 🪟 Windows (Debug) # build_type: Debug @@ -55,6 +62,7 @@ jobs: runner: macos-latest target: template_release platform: macos + precision: double - identifier: android-arm64 name: 🤖 Android Arm64 build_type: Release @@ -104,9 +112,13 @@ jobs: - name: Build Orchestrator (Linux/MacOS) if: startsWith(matrix.identifier, 'linux-') || startsWith(matrix.identifier, 'macos-') - shell: sh + shell: bash run: | - cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} -G Ninja + if [[ "${{ matrix.arch }}" == "riscv64" ]]; then + cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} -G Ninja -DCMAKE_TOOLCHAIN_FILE=riscv64-toolchain.cmake + else + cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} -G Ninja + fi cmake --build ${{ github.workspace }}/.out-${{ matrix.identifier }} --target orchestrator -j 18 - name: Build Orchestrator (Windows) diff --git a/riscv64-toolchain.cmake b/riscv64-toolchain.cmake new file mode 100644 index 00000000..83935f53 --- /dev/null +++ b/riscv64-toolchain.cmake @@ -0,0 +1,18 @@ +# riscv64-toolchain.cmake + +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR riscv64) + +# specify the cross compiler +set(CMAKE_C_COMPILER riscv64-linux-gnu-gcc) +set(CMAKE_CXX_COMPILER riscv64-linux-gnu-g++) + +# where is the target environment +set(CMAKE_FIND_ROOT_PATH /usr/lib/gcc/riscv64-unknown-elf/9.3.0) + +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)