Skip to content

Commit

Permalink
(Re)added ARM support on Windows and Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny authored Jan 15, 2025
2 parents c6b22eb + 3675b37 commit 3299173
Show file tree
Hide file tree
Showing 31 changed files with 673 additions and 267 deletions.
60 changes: 48 additions & 12 deletions .github/workflows/buildThirdPartyLibrary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,29 @@ jobs:
fail-fast: false
matrix:
include:
- name: 'Windows release'
- name: 'Windows release (Intel)'
os: windows-latest
arch: amd64
build_type: Release
- name: 'Windows debug'
- name: 'Windows debug (Intel)'
os: windows-latest
arch: amd64
build_type: Debug
- name: 'Linux'
os: ubuntu-20.04
# Note: we must use ubuntu-20.04 rather than ubuntu-latest (i.e. ubuntu-22.04 at this stage). Indeed,
# Ubuntu 22.04's copy of glibc doesn't include libpthread anymore (see
# https://developers.redhat.com/articles/2021/12/17/why-glibc-234-removed-libpthread). Yet, to build
# our Python wheels on Linux, we have no choice but to use manylinux_2_28, which relies on a version
# of glibc with libpthread, hence getting various messages about __libc_single_threaded being
# undefined when trying to build our Python wheels using third-party libraries built on ubuntu-22.04.
- name: 'Windows release (ARM)'
os: windows-latest
arch: amd64_arm64
build_type: Release
- name: 'Windows debug (ARM)'
os: windows-latest
arch: amd64_arm64
build_type: Debug
- name: 'Linux (Intel)'
os: ubuntu-latest
build_type: Release
- name: 'Linux (ARM)'
os: ubuntu-latest
arch: arm
context: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++
build_type: Release
- name: 'macOS (Intel)'
os: macos-13
Expand All @@ -48,20 +57,47 @@ jobs:
steps:
- name: Check out libOpenCOR
uses: actions/checkout@v4
- name: Install ARM compiler
if: ${{ matrix.arch == 'arm' }}
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
uses: cscouto/buildcache-action@v1
with:
cache_key: libraries-${{ matrix.os }}-${{ matrix.shared_libs }}
- name: Configure MSVC (to build an Intel-based version of llvm-tblgen and clang-tblgen; only when building LLVM+Clang on Windows ARM)
if: ${{ (inputs.third_party_library_name == 'LLVMClang') && (runner.os == 'Windows') && (matrix.arch == 'amd64_arm64') }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Build llvm-tblgen and clang-tblgen (only when building LLVM+Clang on ARM)
if: ${{ (inputs.third_party_library_name == 'LLVMClang') && (((runner.os == 'Windows') && (matrix.arch == 'amd64_arm64')) || ((runner.os == 'Linux') && (matrix.arch == 'arm'))) }}
shell: bash
run: |
source src/3rdparty/LLVMClang/scripts/buildllvmclangtblgen ${{ runner.os == 'Windows' }}
echo "DLLVMCLANG_LLVM_TABLEGEN=$DLLVMCLANG_LLVM_TABLEGEN" >> $GITHUB_ENV
echo "DLLVMCLANG_CLANG_TABLEGEN=$DLLVMCLANG_CLANG_TABLEGEN" >> $GITHUB_ENV
- name: Configure MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Configure libOpenCOR
with:
arch: ${{ matrix.arch }}
- name: Configure libOpenCOR (only when building LLVM+Clang)
if: ${{ inputs.third_party_library_name == 'LLVMClang' }}
shell: bash
run: |
mkdir build
cd build
${{ matrix.context }} cmake -G Ninja -DBUILD_TYPE=${{ matrix.build_type }} -DONLY_BUILD_THIRD_PARTY_LIBRARIES=ON -DPREBUILT_LLVMCLANG=OFF ${{ env.DLLVMCLANG_LLVM_TABLEGEN }} ${{ env.DLLVMCLANG_CLANG_TABLEGEN }} ..
- name: Configure libOpenCOR (only when NOT building LLVM+Clang)
if: ${{ inputs.third_party_library_name != 'LLVMClang' }}
run: |
mkdir build
cd build
${{ matrix.cmake_prereqs }} cmake -G Ninja -DBUILD_TYPE=${{ matrix.build_type }} -DONLY_BUILD_THIRD_PARTY_LIBRARIES=ON -DPREBUILT_${{ inputs.third_party_library_name }}=OFF ..
${{ matrix.context }} cmake -G Ninja -DBUILD_TYPE=${{ matrix.build_type }} -DONLY_BUILD_THIRD_PARTY_LIBRARIES=ON -DPREBUILT_${{ inputs.third_party_library_name }}=OFF ..
- name: Upload library artifact
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
Expand Down
43 changes: 35 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,38 @@ jobs:
fail-fast: false
matrix:
include:
- name: 'Windows static library'
- name: 'Windows static library (Intel)'
os: windows-latest
arch: amd64
shared_libs: OFF
- name: 'Windows shared library'
- name: 'Windows shared library (Intel)'
os: windows-latest
arch: amd64
shared_libs: ON
- name: 'Linux static library'
- name: 'Windows static library (ARM)'
os: windows-latest
arch: amd64_arm64
shared_libs: OFF
- name: 'Windows shared library (ARM)'
os: windows-latest
arch: amd64_arm64
shared_libs: ON
- name: 'Linux static library (Intel)'
os: ubuntu-latest
shared_libs: OFF
- name: 'Linux shared library (Intel)'
os: ubuntu-latest
shared_libs: ON
- name: 'Linux static library (ARM)'
os: ubuntu-latest
arch: arm
shared_libs: OFF
- name: 'Linux shared library'
context: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++
- name: 'Linux shared library (ARM)'
os: ubuntu-latest
arch: arm
shared_libs: ON
context: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++
- name: 'macOS static library (Intel)'
os: macos-13
shared_libs: OFF
Expand All @@ -47,6 +67,11 @@ jobs:
steps:
- name: Check out libOpenCOR
uses: actions/checkout@v4
- name: Install ARM compiler
if: ${{ matrix.arch == 'arm' }}
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install buildcache
Expand All @@ -56,11 +81,13 @@ jobs:
- name: Configure MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Configure libOpenCOR
run: |
mkdir build
cd build
cmake -G Ninja -DBUILD_TYPE=Release -DCODE_ANALYSIS=OFF -DCODE_COVERAGE=OFF -DDOCUMENTATION=OFF -DJAVASCRIPT_BINDINGS=OFF -DMEMORY_CHECKS=OFF -DPYTHON_BINDINGS=OFF -DPYTHON_UNIT_TESTING=OFF -DSHARED_LIBS=${{ matrix.shared_libs }} -DUNIT_TESTING=OFF ..
${{ matrix.context }} cmake -G Ninja -DBUILD_TYPE=Release -DCODE_ANALYSIS=OFF -DCODE_COVERAGE=OFF -DDOCUMENTATION=OFF -DJAVASCRIPT_BINDINGS=OFF -DMEMORY_CHECKS=OFF -DPYTHON_BINDINGS=OFF -DPYTHON_UNIT_TESTING=OFF -DSHARED_LIBS=${{ matrix.shared_libs }} -DUNIT_TESTING=OFF ..
- name: Build libOpenCOR
run: |
cd build
Expand Down Expand Up @@ -102,12 +129,12 @@ jobs:
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Build Python wheels
uses: pypa/cibuildwheel@v2.21.3
uses: pypa/cibuildwheel@9c75ea15c2f31a77e6043b80b1b7081372319d85
env:
CIBW_ARCHS: auto64
CIBW_BUILD: 'cp*'
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.0
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=13.0
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_34
CIBW_SKIP: 'cp36* cp37* cp38* *musllinux*'
- name: Upload Python wheel artifacts
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
Expand Down
96 changes: 85 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
fail-fast: false
matrix:
include:
- name: 'Windows static library'
- name: 'Windows static library (Intel)'
os: windows-latest
arch: amd64
build_type: Release
code_analysis: OFF
code_coverage: OFF
Expand All @@ -28,8 +29,9 @@ jobs:
unit_testing: ON
target: unit_testing
install_uninstall_and_package: ON
- name: 'Windows shared library'
- name: 'Windows shared library (Intel)'
os: windows-latest
arch: amd64
build_type: Release
code_analysis: OFF
code_coverage: OFF
Expand All @@ -43,7 +45,39 @@ jobs:
unit_testing: ON
target: unit_testing
install_uninstall_and_package: ON
- name: 'Linux static library'
- name: 'Windows static library (ARM) (no tests)'
os: windows-latest
arch: amd64_arm64
build_type: Release
code_analysis: OFF
code_coverage: OFF
documentation: OFF
javascript_bindings: OFF
javascript_unit_testing: OFF
memory_checks: OFF
python_bindings: OFF
python_unit_testing: OFF
shared_libs: OFF
unit_testing: OFF
target: unit_testing
install_uninstall_and_package: ON
- name: 'Windows shared library (ARM) (no tests)'
os: windows-latest
arch: amd64_arm64
build_type: Release
code_analysis: OFF
code_coverage: OFF
documentation: OFF
javascript_bindings: OFF
javascript_unit_testing: OFF
memory_checks: OFF
python_bindings: OFF
python_unit_testing: OFF
shared_libs: ON
unit_testing: OFF
target: unit_testing
install_uninstall_and_package: ON
- name: 'Linux static library (Intel)'
os: ubuntu-latest
build_type: Release
code_analysis: OFF
Expand All @@ -58,7 +92,7 @@ jobs:
unit_testing: ON
target: unit_testing
install_uninstall_and_package: ON
- name: 'Linux shared library'
- name: 'Linux shared library (Intel)'
os: ubuntu-latest
build_type: Release
code_analysis: OFF
Expand All @@ -73,6 +107,40 @@ jobs:
unit_testing: ON
target: unit_testing
install_uninstall_and_package: ON
- name: 'Linux static library (ARM) (no tests)'
os: ubuntu-latest
arch: arm
build_type: Release
code_analysis: OFF
code_coverage: OFF
documentation: OFF
javascript_bindings: OFF
javascript_unit_testing: OFF
memory_checks: OFF
python_bindings: OFF
python_unit_testing: OFF
shared_libs: OFF
unit_testing: OFF
target: unit_testing
install_uninstall_and_package: ON
context: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++
- name: 'Linux shared library (ARM) (no tests)'
os: ubuntu-latest
arch: arm
build_type: Release
code_analysis: OFF
code_coverage: OFF
documentation: OFF
javascript_bindings: OFF
javascript_unit_testing: OFF
memory_checks: OFF
python_bindings: OFF
python_unit_testing: OFF
shared_libs: ON
unit_testing: OFF
target: unit_testing
install_uninstall_and_package: ON
context: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++
- name: 'macOS static library (Intel)'
os: macos-13
build_type: Release
Expand Down Expand Up @@ -149,6 +217,7 @@ jobs:
target: javascript_unit_testing
- name: 'Windows Python bindings'
os: windows-latest
arch: amd64
build_type: Release
code_analysis: OFF
code_coverage: OFF
Expand Down Expand Up @@ -316,11 +385,14 @@ jobs:
BUILDCACHE_COMPRESS_FORMAT: ZSTD
BUILDCACHE_DEBUG: -1
BUILDCACHE_LOG_FILE: ""
DOXYGEN_VERSION: 1.9.3
LLVMCLANG_VERSION: 18.1.8
steps:
- name: Check out libOpenCOR
uses: actions/checkout@v4
- name: Install ARM compiler
if: ${{ matrix.arch == 'arm' }}
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Install Python
uses: actions/setup-python@v5
with:
Expand All @@ -334,6 +406,8 @@ jobs:
- name: Configure MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Install LLVM
if: ${{ matrix.code_coverage == 'ON' }}
run: |
Expand All @@ -342,20 +416,20 @@ jobs:
- name: Install Clang
if: ${{ matrix.code_analysis == 'ON' }}
run: |
wget https://github.com/opencor/gha/releases/download/gha/clang.${LLVMCLANG_VERSION}.linux.tar.gz -O - | tar -xz
wget https://github.com/opencor/gha/releases/download/gha/clang.tar.gz -O - | tar -xz
sudo mv clang /usr/local/bin
sudo cp /usr/local/bin/clang /usr/local/bin/clang++
wget https://github.com/opencor/gha/releases/download/gha/clang-include.${LLVMCLANG_VERSION}.linux.tar.gz -O - | tar -xz
wget https://github.com/opencor/gha/releases/download/gha/clang-include.tar.gz -O - | tar -xz
sudo mv include/* /usr/local/include
- name: Install ClangFormat
if: ${{ matrix.target == 'check_code_formatting' }}
run: |
wget https://github.com/opencor/gha/releases/download/gha/clang-format.${LLVMCLANG_VERSION}.linux.tar.gz -O - | tar -xz
wget https://github.com/opencor/gha/releases/download/gha/clang-format.tar.gz -O - | tar -xz
sudo mv clang-format /usr/local/bin
- name: Install Clang-Tidy
if: ${{ matrix.name == 'Code analysis' }}
run: |
wget https://github.com/opencor/gha/releases/download/gha/clang-tidy.${LLVMCLANG_VERSION}.linux.tar.gz -O - | tar -xz
wget https://github.com/opencor/gha/releases/download/gha/clang-tidy.tar.gz -O - | tar -xz
sudo mv clang-tidy /usr/local/bin
- name: Install Emscripten
if: ${{ matrix.javascript_unit_testing == 'ON' }}
Expand All @@ -380,7 +454,7 @@ jobs:
- name: Install Doxygen
if: ${{ matrix.documentation == 'ON' }}
run: |
wget https://github.com/opencor/gha/releases/download/gha/doxygen.${DOXYGEN_VERSION}.linux.tar.gz -O - | tar -xz
wget https://github.com/opencor/gha/releases/download/gha/doxygen.tar.gz -O - | tar -xz
sudo mv doxygen /usr/local/bin
- name: Configure libOpenCOR
run: |
Expand Down
Loading

0 comments on commit 3299173

Please sign in to comment.