Skip to content

Commit 75f429b

Browse files
authored
Merge pull request #43 from OpenWaterAnalytics/swig_dev
Expanding solver interface to include toolkit api functions
2 parents 0320700 + 94b642d commit 75f429b

25 files changed

+1854
-1793
lines changed

.gitmodules

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "swmm-toolkit/swmm-solver"]
2-
path = swmm-toolkit/swmm-solver
3-
url = https://github.com/SWMM-Project/swmm-solver.git
2+
path = swmm-toolkit/swmm-solver
3+
url = https://github.com/OpenWaterAnalytics/Stormwater-Management-Model.git
4+
branch = swig

swmm-toolkit/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ project(swmm-toolkit)
1616

1717
set(Python_FIND_VIRTUALENV FIRST)
1818
set(Python_ROOT_DIR "/usr/local/anaconda3")
19-
find_package(Python 3.7 COMPONENTS Development Interpreter)
19+
find_package(Python 3.7 COMPONENTS Development Interpreter REQUIRED)
2020

2121

2222
find_package(SWIG REQUIRED)
@@ -35,7 +35,7 @@ add_subdirectory(src/swmm/toolkit)
3535
if(APPLE)
3636
install(CODE "execute_process(
3737
COMMAND
38-
${PROJECT_SOURCE_DIR}/swmm-solver/tools/relocate.zsh ${EXTERN_LIB_PATH}
38+
${PROJECT_SOURCE_DIR}/tools/relocate.zsh ${EXTERN_LIB_PATH}
3939
WORKING_DIRECTORY
4040
${CMAKE_INSTALL_PREFIX}
4141
)"

swmm-toolkit/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,33 @@
1515
## Installation
1616

1717

18+
## Build
19+
1. Initialize submodule
20+
```cmd
21+
git submodule init
22+
git submodule update
23+
```
24+
2. Create virtual environment
25+
3. `pip install` from requirements.txt
26+
4. `python setup.py build`
27+
28+
## Troubleshoot
29+
30+
Steps to try if `python setup.py build` fails
31+
32+
### Establish working swmm-solver build
33+
1. Create an environment variable `BOOST_ROOT_1_67_0` and set the variable to boost install location
34+
2. Confirm swmm-solver directory is initialized
35+
3. Confirm swmm-solver build is working
36+
37+
```
38+
cd swmm-solver
39+
mkdir buildprod
40+
cd buildprod
41+
cmake -G "Visual Studio 14 2015 Win64" ..
42+
cmake --build . --config Release --target install
43+
```
44+
1845
## Basic Usage
1946

2047
Run a SWMM simulation.

swmm-toolkit/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def run(self):
5858

5959
# Set Platform specific cmake args here
6060
if platform_system == "Windows":
61-
cmake_args = ["-GVisual Studio 14 2015 Win64"]
61+
cmake_args = ["-GVisual Studio 15 2017 Win64"]
6262

6363
elif platform_system == "Darwin":
6464
cmake_args = ["-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.10"]

swmm-toolkit/src/swmm/toolkit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ set_target_properties(output
6868
install(
6969
FILES
7070
"__init__.py"
71-
"output_enum.py"
71+
"toolkit_enum.py"
7272
"output_metadata.py"
7373
"${CMAKE_CURRENT_BINARY_DIR}/output.py"
7474
DESTINATION

swmm-toolkit/src/swmm/toolkit/output.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ and return a (possibly) different pointer */
4747
%typemap(in) SMO_Handle *p_handle_inout (SMO_Handle retval)
4848
{
4949
/* INOUT in */
50-
SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&retval), 0, 0);
51-
$1 = &retval;
50+
SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&retval), 0, 0);
51+
$1 = &retval;
5252
}
5353
/* No need for special IN typemap for opaque pointers, it works anyway */
5454

swmm-toolkit/src/swmm/toolkit/output_enum.py

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)