-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3408 from architecture-building-systems/revert-34…
…06-revert-3265-mac-arm-native-support Enable Mac ARM support
- Loading branch information
Showing
33 changed files
with
25,233 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: conda-lock | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install conda-lock with Micromamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-name: ci | ||
create-args: conda-lock | ||
init-shell: bash | ||
|
||
- name: Run conda-lock | ||
run: conda-lock --mamba -f environment.yml -p osx-64 -p linux-64 -p win-64 --lockfile ${{ runner.temp }}/conda-lock.yml | ||
shell: bash -el {0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ include cea/workflows/*.yml | |
include cea/dev/conda.bat | ||
|
||
graft cea/resources/radiation/bin | ||
|
||
graft cea/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
""" | ||
This only works for wntr v0.2.3 | ||
Apple Silicon lib builds from: | ||
WNTR (https://github.com/USEPA/WNTR/tree/0.2.3) | ||
set `use_swig` and `build` to True in setup.py | ||
make sure swig is installed | ||
python setup.py build_ext --inplace | ||
copy _evaluator and _network from build | ||
EPANET (https://github.com/OpenWaterAnalytics/EPANET/tree/v2.0.12) | ||
replace all `malloc.h` with `stdlib.h` | ||
gcc -dynamiclib *.c -o libepanet.dylib | ||
copy libepanet.dylib to Darwin folder | ||
""" | ||
|
||
import platform | ||
import sys | ||
import os | ||
|
||
if sys.platform == "darwin" and platform.processor() == "arm": | ||
# Add required shared objects to path before importing wntr | ||
sys.path.append(os.path.dirname(__file__)) | ||
|
||
# Make sure correct version of wntr is installed | ||
import wntr | ||
if wntr.__version__ != '0.2.3': | ||
raise ImportError(f"Require wntr version 0.2.3, found {wntr.__version__}") | ||
|
||
print("Applying fix for Apple Silicon") | ||
# Change where wntr looks for libepanet | ||
import wntr.epanet.toolkit | ||
wntr.epanet.toolkit.epanet_toolkit = "cea.lib" |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.