embray / gappy

Python interface to GAP
GNU General Public License v3.0
13 stars 5 forks source link

Build and test on MacOS and Cygwin #9

Closed embray closed 3 years ago

embray commented 3 years ago

These platforms at a minimum should be supported for Sage; possibly others.

As most of this code was extracted originally from Sage, and as it does not add much new in the way of platform-specific code, this shouldn't require much work.

The biggest change that needs some scrutiny is the use of the non-POSIX dlinfo() for finding the path to the libgap SO. I don't know if this is available on platforms other than Linux, and if not it will need to be disabled for those platforms.

embray commented 3 years ago

For MacOS this suggests a way to do it with dlsym() and dladdr(). I don't think the first_external_symbol_for_image mucking about is strictly necessary, since we can just use a known external symbol, like "GAP_Initialize".

embray commented 3 years ago

Cygwin doesn't have dlinfo() either, but it looks like the dlsym() + dladdr() combo should work there too. Maybe I can just do that on Linux as well and not use dlinfo().

embray commented 3 years ago

Added CI for MacOS in d094933d. Adding it for Cygwin will take quite some extra work, especially since GAP isn't available for conda on Windows (creating Cygwin packages for conda is on my todo list but a far way's off). However, I've confirmed manually that it's working on Cygwin. Other than the DLL loading stuff, very little of this code is very platform-dependent, so I'm fine keeping occasional Cygwin testing manual for now.