Skip to content

Commit

Permalink
support armv8 arch
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni committed May 28, 2024
1 parent be27fcf commit 72de98b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/knuth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:

MATRIX: '{"config":[{"name":"Linux (GCC 13) NodeJS 18","nodejs_version":"18","os":"ubuntu-22.04","os_kind":"linux","march_id":"x64-ZLm9Pjh","test":"1", "compiler_version":"13", "docker_suffix":"-ubuntu20.04"},
{"name":"Linux (GCC 13) NodeJS 20","nodejs_version":"20","os":"ubuntu-22.04","os_kind":"linux","march_id":"x64-ZLm9Pjh","test":"1", "compiler_version":"13", "docker_suffix":"-ubuntu20.04"},
{"name":"macOS 14 NodeJS 18","nodejs_version":"18","os":"macos-14","os_kind":"macos","march_id":"x64-ZLm9Pjh","test":"0"},
{"name":"macOS 14 NodeJS 20","nodejs_version":"20","os":"macos-14","os_kind":"macos","march_id":"x64-ZLm9Pjh","test":"0"},
{"name":"macOS 14 NodeJS 18","nodejs_version":"18","os":"macos-14","os_kind":"macos","march_id":"x64-ZLm9Pjh","arch":"armv8,"test":"0"},
{"name":"macOS 14 NodeJS 20","nodejs_version":"20","os":"macos-14","os_kind":"macos","march_id":"x64-ZLm9Pjh","arch":"armv8,"test":"0"},
]}'
run: |
echo "${MATRIX}"
Expand Down Expand Up @@ -88,6 +88,7 @@ jobs:
run: |
echo "NODEJS_VERSION=${{ matrix.config.nodejs_version }}" >> $GITHUB_ENV
echo "KTH_GHA_MARCH_ID=${{ matrix.config.march_id }}" >> $GITHUB_ENV
echo "KTH_GHA_ARCH=${{ matrix.config.arch }}" >> $GITHUB_ENV
echo "KTH_GHA_RUN_TESTS=${{ matrix.config.test }}" >> $GITHUB_ENV
- name: Settting EnvVars (Windows)
Expand All @@ -96,6 +97,7 @@ jobs:
run: |
echo "NODEJS_VERSION=${{ matrix.config.nodejs_version }}" >> $Env:GITHUB_ENV
echo "KTH_GHA_MARCH_ID=${{ matrix.config.march_id }}" >> $Env:GITHUB_ENV
echo "KTH_GHA_ARCH=${{ matrix.config.arch }}" >> $Env:GITHUB_ENV
echo "KTH_GHA_RUN_TESTS=${{ matrix.config.test }}" >> $Env:GITHUB_ENV
# - name: Build (Linux)
Expand Down Expand Up @@ -202,6 +204,12 @@ jobs:
conan install . --build=missing -s compiler.cppstd=20
# -o c-api/*:march_id=ZLm9Pjh
echo "*** KTH_GHA_ARCH: ${KTH_GHA_ARCH}"
export KTH_ARCH=KTH_GHA_ARCH
echo "*** KTH_ARCH: ${KTH_ARCH}"
# npm install --loglevel verbose
npm install --loglevel verbose
Expand Down
24 changes: 21 additions & 3 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from sys import platform
import importlib
import subprocess
import platform



# def install(package):
# pip.main(['install', package])
Expand Down Expand Up @@ -97,11 +100,13 @@ def check_exists(path):


def accomodate_capi():
arch = get_arch()
print(f'******* arch: {arch}')
check_exists(f'./full_deploy/host/c-api')
check_exists(f'./full_deploy/host/c-api/{capi_version}')
check_exists(f'./full_deploy/host/c-api/{capi_version}/Release')
check_exists(f'./full_deploy/host/c-api/{capi_version}/Release/x86_64')
check_exists(f'./full_deploy/host/c-api/{capi_version}/Release/x86_64/include')
check_exists(f'./full_deploy/host/c-api/{capi_version}/Release/{arch}')
check_exists(f'./full_deploy/host/c-api/{capi_version}/Release/{arch}/include')


extensions = ['.a', '.so', '.lib', '.dylib', '.dll']
Expand All @@ -118,7 +123,7 @@ def accomodate_capi():
file_path = os.path.join(root, file)
shutil.move(file_path, new_directory)

shutil.move(f'./full_deploy/host/c-api/{capi_version}/Release/x86_64/include', './deps/include')
shutil.move(f'./full_deploy/host/c-api/{capi_version}/Release/{arch}/include', './deps/include')


def run_conan(reference, march_id, debug_build):
Expand Down Expand Up @@ -157,6 +162,19 @@ def get_march(arch):
march_id = os.getenv("KTH_MARCHID", "ZLm9Pjh")
return march_id

def get_arch():
arch = os.getenv("KTH_ARCH", None)
if not arch is None:
return arch


machine = platform.machine()
if machine == "x86_64":
return "x86_64"
if machine == "arm64":
return "armv8"
return None

def get_debug_build():
dbuild = os.getenv("KTH_DEBUG_BUILD", "0")
return dbuild == "1"
Expand Down

0 comments on commit 72de98b

Please sign in to comment.