dtamayo / reboundx

A library for adding additional forces to the REBOUND N-body integration package
GNU General Public License v3.0
80 stars 60 forks source link

Issue with library suffix under Windows-based platform #50

Closed sir-chaos closed 3 years ago

sir-chaos commented 3 years ago

Under cygwin platform, the following code breaks (https://github.com/dtamayo/reboundx/blob/master/setup.py#L69):

libraries=['rebound'+suffix[:-3]], #take off .so from the suffix

as the suffix has '.dll' on the end, not '.so' as expected.

To promote cross-platform development, I suggest to replace it with the following:

libraries=['rebound'+suffix[:suffix.rfind('.')]], #take off file extension from the suffix
dtamayo commented 3 years ago

Thanks! I don't have an easy way to test on windows, so that's helpful. The automated testing on Travis-CI is down right now, but I'll test it on OSX and Linux and push this assuming there are no problems!

hannorein commented 3 years ago

I'm actually not sure anyone has even successfully used REBOUND itself on Windows. Did you manage to compile REBOUND? Just as Dan, I also don't have access to a Windows machine to run tests on...

sir-chaos commented 3 years ago

Thanks for the reply!

The REBOUND itself seems to successfully compile and run on Windows (via cygwin as well), although i had some issues with one of my examples (other one ran fine). Probably I should run your official tests to tell you if it really works or not.

There's actually another issue with reboundx and rebound integration, since you're both here: the https://github.com/hannorein/rebound/blob/master/rebound/rebound.h rebound.h header file softlink doesn't work in any way on Windows since it's Unix softlink. I easily fixed it by copy-pasting the original header file, but probably you can think of some more elegant way (I didnt dive into the build or C code very deeply to give any suggestions yet).

dtamayo commented 3 years ago

Added this, thanks @sir-chaos