Skip to content

Commit

Permalink
Merge pull request #403 from pyswmm/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
karosc committed Sep 11, 2023
2 parents 27dc699 + 33e6e43 commit fbda2e1
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
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_regression_tests.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

0 comments on commit fbda2e1

Please sign in to comment.