-
Notifications
You must be signed in to change notification settings - Fork 77
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
#define SOL /* Compile as a shared object library */ #74
Comments
Also reference issue #63 |
@jmpmcmanus, I think we can get away with compiling a |
@bemcdonnell I agree... that is what we are doing now anyway |
@goanpeca, I think it would be a good idea to remove that line from swmm5.c |
what do you use when you compile linux/swmm5.so or macos/swmm5.so? I would like to help, but am unsure about what I need to do to compile it as a shared library on my machine.
|
@jmpmcmanus we are using conda and the conda infrastructure + cmake to do all our compilation. Are you familiar with conda? |
@jmpmcmanus, there are a couple makesfiles available in the '_build' directory. I suggest editing one of them to add the flag to define DLL. This way we do not need to keep changing this in the code. If I remember right it is |
@goanpeca, just to be clear, my comment is relevant if @jmpmcmanus wants to build locally. If we want to move all builds to the web, conda is the best option as of today. |
The repo is also setup with CMAKE but I haven't testing this on Linux, personally. |
I once briefly used it when I was exploring using Anaconda. I can install it and start coming up to speed on it.
|
@bemcdonnell I understand, but even then the suggested compilation should be using CMAKE, not those makefiles. I left them for reference, but I would consider them obsolete. @jmpmcmanus actually if you install conda (via, anaconda or miniconda) then you can install conda-build and ran the build process on your local machine easily
|
@goanpeca, can you provide that information in the wiki? I think it is very useful beyond this issue. Maybe a new page called |
Sure can, please open an Issue and assign it to me? |
@goanpeca, I don't see inside the conda.recipe that it defines |
-DLLL ??? we make dylib on mac and so on linux with the current setup |
It's not the extension I'm commenting on. I'm talking about defining one of these inside the makefile instead of uncommenting/commenting them inside the code. In VS I have a flag to define DLL or CLE depending on my target. This can also be accomplished inside a linux makefile
//#define CLE /* Compile as a command line executable */
//#define SOL /* Compile as a shared object library */
//#define DLL /* Compile as a Windows DLL */ |
//#define CLE /* Compile as a command line executable */
//#define SOL /* Compile as a shared object library */
//#define DLL /* Compile as a Windows DLL */ Should change to "Dynamic Linking Library" instead of "Windows DLL" This should help with confusion |
Maybe I'm not tracking the conversation well, but i think the preferred solution to specifying the compilation output would be by passing a flag to CMAKE - such as the standard |
I installed anaconda3 which has conda. The Anaconda repository has OWA libswmm 5.2.0.dev0:
Libswmm :: Anaconda Cloud
|
| |
Libswmm :: Anaconda Cloud
| |
|
which I installed using conda. It was installed anaconda3/lib directory. I could not find pyswmm in the repository, but I downloaded it from github and installed it using setup.py. I then ln -s anaconda3/lib/libswmm5.so to anaconda3/lib/python3.6/site-packages/pyswmm-0.5.0.dev0-py3.6.egg/pyswmm/lib/linux/swmm5.so. However, when I tried to use pyswmm I got a core dump, so that is not the way to do it. Are you eventually going to make pyswmm available in the Anaconda repository?
I also tried the $ conda-build conda.recipe method with similar results. To you anaconda/lib/libswmm5.so directly I would have to change:
pyswmm/lib/__init__.py: LIB_SWMM = os.path.join(HERE, _platform(), 'swmm5.so').replace('\\', '/')
On Thursday, August 17, 2017 12:31 PM, James McManus <[email protected]> wrote:
I once briefly used it when I was exploring using Anaconda. I can install it and start coming up to speed on it.
On Thursday, August 17, 2017 12:06 PM, Gonzalo Peña-Castellanos <[email protected]> wrote:
@jmpmcmanus we are using conda and the conda infrastructure + cmake to do all our compilation.Are you familiar with conda?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@jmpmcmanus the pyswmm is not able currently to work correctly, cause this is a work in progress. The libswmm packages are compiled on the CI system and are meant to be used for dev only purposes. I was suggesting you build the library locally on your system with conda-build, and then extract the .so library and put it in the lib folder of pyswmm and seeing if that was working for you. |
@jmpmcmanus, if you got SWMM to compile, There is a subfolder in the pyswmm package
Place the .so in there and see if that works. |
@samhatchett, thanks for sharing the link. That seems to be the most standard way to implement this build. I have another issue raised to pull out the main entry point from swmm5.c much like you all did for EPANET. |
I tried building with conda-build. It produced a file libswmm-5.2.0.dev0-h72345f7_42.tar.bz2, which had bin/run-swmm, include/swmm5.h and lib/libswmm5.so. I put them in the appropriate directories, and then ran run-swmm which worked. I also tried ln -s libswmm5.so to pyswmm/lib/linux/swmm5.so, but got a core dump when I tried using pyswmm.
|
Great to hear that, the idea with conda, is that you can simply install that local compiled version (for develop SWMM) and then install pyswmm with conda and it should just work. We are a few weeks behind that workflow but we are almost there. Thanks for testing |
@jmpmcmanus, for pyswmm specific issues, let's continue those over at pyswmm on the issue you raised earlier: |
Issue Copied from USEPA/Stormwater-Management-Model
The text was updated successfully, but these errors were encountered: