Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64 Regression testing #402

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/docker_tools/run_regression_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

#script for running regression tests in arm64 docker container

# setup environment
git config --global --add safe.directory /swmm
cd swmm
python3 -m venv venv
source venv/bin/activate
pip install aenum nrtest swmm-toolkit nrtest-swmm

# export build vars
export BUILD_HOME="build"
export PROJECT="swmm"
export PLATFORM="linux"

# run regression tests
./ci-tools/linux/make.sh
source ./ci-tools/linux/before-nrtest.sh
bash ./ci-tools/linux/run-nrtests.sh
44 changes: 44 additions & 0 deletions .github/workflows/build-test-arm64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Test ARM64

on: workflow_dispatch

jobs:
cross-build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Clone ci-tools repo
uses: actions/checkout@v3
with:
repository: pyswmm/ci-tools
ref: master
path: ci-tools

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: start docker
run: docker run -id --name cross --volume="./:/swmm" --cpuset-cpus="0" karosc/build_swmm_arm64v8:latest

- name: Build and unit test
run: docker exec cross /bin/bash -c "cd /swmm && ./ci-tools/linux/make.sh -t -g 'Unix Makefiles'"

- name: Build for reg test
run: >
chmod +x ./.github/docker_tools/run_reg_test.sh &&
docker exec cross /bin/bash -c "/swmm/.github/docker_tools/run_reg_test.sh"

- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: build-test-artifacts
path: upload/*.*
7 changes: 6 additions & 1 deletion src/solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,18 @@ file(COPY ${CMAKE_CURRENT_BINARY_DIR}/toolkit_export.h
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include
)

if(APPLE)
set(LIB_ROOT "@loader_path")
else()
set(LIB_ROOT "$ORIGIN")
endif()

set_target_properties(swmm5
PROPERTIES
MACOSX_RPATH TRUE
SKIP_BUILD_RPATH FALSE
BUILD_WITH_INSTALL_RPATH FALSE
INSTALL_RPATH "${PACKAGE_RPATH}"
INSTALL_RPATH "${LIB_ROOT};${PACKAGE_RPATH};"
INSTALL_RPATH_USE_LINK_PATH TRUE
)

Expand Down