Skip to content

Commit

Permalink
Ubuntu 24.04 armv8 に対応する
Browse files Browse the repository at this point in the history
  • Loading branch information
melpon committed Sep 20, 2024
1 parent 0b9e541 commit 82c0d01
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jobs:
target: ubuntu-22.04_x86_64
runs_on: ubuntu-22.04
os: ubuntu
- name: ubuntu-24.04_armv8
target: ubuntu-24.04_armv8
runs_on: ubuntu-24.04
os: ubuntu
- name: macos-13_arm64
target: macos_arm64
runs_on: macos-13
Expand All @@ -70,6 +74,13 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
include:
- platform:
name: ubuntu-24.04_armv8
target: ubuntu-24.04_armv8
runs_on: ubuntu-24.04
os: ubuntu
python_version: "3.12"
needs: [build_pyi]
runs-on: ${{ matrix.platform.runs_on }}
timeout-minutes: 60
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
- @voluntas
- [ADD] `on_signaling_message` コールバックを追加する
- @tnoho
- [ADD] Ubuntu 24.04 armv8 に対応する
- @melpon
- [UPDATE] Sora C++ SDK のバージョンを `2024.8.0` に上げる
- WEBRTC_BUILD_VERSION を `m128.6613.2.0` に上げる
- libwebrtc のモジュール分割に追従するため rtc::CreateRandomString のヘッダを追加
Expand Down
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ message(STATUS "-- Python_LIBRARIES: ${Python_LIBRARIES}")
message(STATUS "-- Python_LIBRARY_DIRS: ${Python_LIBRARY_DIRS}")
message(STATUS "-- Python_RUNTIME_LIBRARY_DIRS: ${Python_RUNTIME_LIBRARY_DIRS}")


execute_process(
COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NB_DIR)
list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}")
if (NB_CMAKE_DIR)
list(APPEND CMAKE_PREFIX_PATH "${NB_CMAKE_DIR}")
else()
execute_process(
COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NB_DIR)
list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}")
endif()

set(TARGET_OS "" CACHE STRING "ビルド対象の動作する OS。\n有効な値は windows, macos, ubuntu")
set(WEBRTC_INCLUDE_DIR "" CACHE PATH "WebRTC のインクルードディレクトリ")
Expand All @@ -61,7 +64,7 @@ find_package(nanobind CONFIG REQUIRED)
if(NOT TARGET_OS STREQUAL "windows")
find_package(Threads REQUIRED)
endif()
if(TARGET_OS STREQUAL "ubuntu")
if(TARGET_OS STREQUAL "ubuntu" AND NOT CMAKE_CROSSCOMPILING)
find_package(Libva REQUIRED)
find_package(Libdrm REQUIRED)
endif()
Expand Down
5 changes: 4 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def main():
]
if platform.target.arch == "armv8":
sysroot = os.path.join(install_dir, "rootfs")
nb_cmake_dir = cmdcap(["uv", "run", "python", "-m", "nanobind", "--cmake_dir"])
cmake_args += [
"-DCMAKE_SYSTEM_NAME=Linux",
"-DCMAKE_SYSTEM_PROCESSOR=aarch64",
Expand All @@ -276,7 +277,9 @@ def main():
"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH",
f"-DCMAKE_SYSROOT={sysroot}",
f"-DPython_ROOT_DIR={cmake_path(os.path.join(sysroot, 'usr', 'include', 'python3.12'))}",
# "-DNB_SUFFIX=.cpython-310-aarch64-linux-gnu.so",
f"-DCMAKE_SYSROOT={sysroot}",
f"-DNB_CMAKE_DIR={nb_cmake_dir}",
"-DNB_SUFFIX=.cpython-312-aarch64-linux-gnu.so",
]
elif platform.target.os == "macos":
sysroot = cmdcap(["xcrun", "--sdk", "macosx", "--show-sdk-path"])
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def run_setup(build_platform, target_platform):
plat = None
if target_platform.os == "jetson":
plat = "manylinux_2_17_aarch64.manylinux2014_aarch64"
elif target_platform.os == "ubuntu" and target_platform.arch == "armv8":
plat = "manylinux_2_17_aarch64.manylinux2014_aarch64"
elif target_platform.os == "ubuntu" and target_platform.arch == "x86_64":
if target_platform.osver == "22.04":
plat = "manylinux_2_17_x86_64.manylinux2014_x86_64"
Expand Down Expand Up @@ -52,6 +54,8 @@ def main():
target = os.getenv("SORA_SDK_TARGET")
if target is None:
target_platform = build_platform
elif target == "ubuntu-24.04_armv8":
target_platform = PlatformTarget("ubuntu", "24.04", "armv8")
elif target == "ubuntu-22.04_armv8_jetson":
target_platform = PlatformTarget("jetson", None, "armv8", "ubuntu-22.04")
else:
Expand Down

0 comments on commit 82c0d01

Please # to comment.