Skip to content

Commit 5f5c929

Browse files
committed
2 parents 6ccb60a + af80e93 commit 5f5c929

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

toolkit/buildnotes.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Build Notes
2+
3+
Hints for building EPANET Toolkit SWIG wrapper on Windows. This package
4+
is currently under active development. The build process is likely to change.
5+
6+
7+
### Dependencies
8+
- Python 3.6.5 64 bit
9+
- Visual Studio 14 2015
10+
- CMake
11+
- SWIG
12+
13+
14+
### Build Process
15+
The idea here is to build the EPANET library seperately and link it with the SWIG wrapper. This approach uses implicit linking, therefore, an import library
16+
must be created. CMake does this automatically using the Generate Export Header function. Once built the EPANET library and headers are manually copied to the
17+
epanet-toolkit directory. To run, the resulting epanet-toolkit.pyd needs the epanet.dll.
18+
19+
20+
Step 1 - Build EPANET Library
21+
22+
Checkout the dev branch of the OWA EPANET project. Build the EPANET Library using CMake generator "Visual Studio 14 2015 Win64". Be sure "generate
23+
export header" section of the EPANET Project CMakeLists.txt is not commented out.
24+
25+
26+
Step 2 - Copy EPANET Library
27+
28+
In the epanet\toolkit directory copy epanet.h, epanet_export.h, epanet.dll, and epanet.lib all together in the same folder. The
29+
setup.py file is configured to find them there.
30+
31+
32+
Step 3 - Build EPANET Toolkit
33+
34+
Execute the command `python setup.py build`
35+
36+
37+
Step 4 - Running EPANET Toolkit
38+
39+
Install the pyd and the dll in the same directory and add the directory to
40+
the python path.
41+
42+
43+
#### Common Problems
44+
When I used the Developer Command Prompt for Visual Studio 2015 the build
45+
fails with linking errors. Use a regular Command Prompt to build.

0 commit comments

Comments
 (0)