From b121116bdd0137bf2c7468ae739756acd582c207 Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Tue, 6 Feb 2024 23:10:37 +0900 Subject: [PATCH] setup aarch64 g++ compiler --- .github/workflows/python-package.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 414c1677b..08b2abefb 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -49,7 +49,7 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64' }} run: | # Allow cross-compile on aarch64 - sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu + sudo apt-get install -y g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.14 @@ -79,6 +79,8 @@ jobs: python3 -m pip install cmake==3.27.9 ninja if [ "${{ matrix.os }}" = "windows-latest" ]; then echo CXX_COMPILER=cl >> "$GITHUB_ENV" + elif [ "${{ matrix.os }}" = "ubuntu-latest" -a "${{ matrix.arch }}" == "aarch64" ]; then + echo CXX_COMPILER=aarch64-linux-gnu-g++ >> "$GITHUB_ENV" else echo CXX_COMPILER=g++ >> "$GITHUB_ENV" fi @@ -176,7 +178,7 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64' }} run: | # Allow cross-compile on aarch64 - sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu + sudo apt-get install -y g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - name: CUDA Toolkit shell: bash -el {0} @@ -205,6 +207,8 @@ jobs: echo CXX_COMPILER=cl >> "$GITHUB_ENV" # without -DCMAKE_CUDA_COMPILER=nvcc, cmake config always fail for cuda-11.8 echo DCMAKE_CUDA_COMPILER=-DCMAKE_CUDA_COMPILER=nvcc >> "$GITHUB_ENV" + elif [ "${{ matrix.os }}" = "ubuntu-latest" -a "${{ matrix.arch }}" == "aarch64" ]; then + echo CXX_COMPILER=aarch64-linux-gnu-g++ >> "$GITHUB_ENV" else echo CXX_COMPILER=g++ >> "$GITHUB_ENV" fi @@ -309,7 +313,7 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64' }} run: | # Allow cross-compile on aarch64 - sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu + sudo apt-get install -y g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - name: CUDA Toolkit shell: bash -el {0} @@ -321,7 +325,11 @@ jobs: CUDA_HOME="${{ env.CONDA }}/envs/bnb-env" echo CUDA_HOME=$CUDA_HOME >> "$GITHUB_ENV" echo CUDA_PATH=$CUDA_HOME >> "$GITHUB_ENV" - echo CXX_COMPILER=g++ >> "$GITHUB_ENV" + if [ "${{ matrix.os }}" = "ubuntu-latest" -a "${{ matrix.arch }}" == "aarch64" ]; then + echo CXX_COMPILER=aarch64-linux-gnu-g++ >> "$GITHUB_ENV" + else + echo CXX_COMPILER=g++ >> "$GITHUB_ENV" + fi nvcc --version