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
should libsemigroups be a convenience (static) library? #483
Comments
@RussWoodroofe thanks for the suggestion, I'll give it try and see what happens. There was no good reason to link libsemigroups.la that I recall. |
Thanks so much for being receptive! I did lightly test the change on macOS 10.12. It at least linked correctly, and GAP would load the package. |
Looking into this a little further, I'm concerned that the change would be in Making the change you suggest seems to prevent I'm not certain how/if to proceed, if you have any further comments, I'll be happy to consider them. |
It looks like libtool generally doesn't like to mix static and dynamic libraries, which makes this harder than it should be. One solution would be to include patched Automake files for libsemigroups with the GAP package (only). This looks to me like the most portable solution, but the patching would not be so robust (and increased robustness was a main reason for the proposed change). Another solution would be to run the libsemigroups configure as |
The C++ part of the semigroups package is built in 2 parts: a library (semigroups.so) that is loaded by GAP, and a library (libsemigroups.la) that is loaded by semigroups.so.
Currently, semigroups.so links to libsemigroups.la as a shared library. If I understand right, in a typical installation, it will only be used by GAP. Calling it as a shared library thus only adds (a small amount of) overhead. It also makes the semigroup package sensitive to location, at least on macOS. For example, renaming GAPDIR from gap-4.9.1 to gap-test will break the semigroups package. (Such renaming will also currently break libgmp.)
I suggest that it might make sense to include libsemigroups.la into semigroups.so as a static library, rather than shared. The change involved would only involve one line: in src/libsemigroups/Makefile.am, change
lib_LTLIBRARIES = libsemigroups.la
to
noinst_LTLIBRARIES = libsemigroups.la
This marks libsemigroups to libtool as a "convenience library", and libtool will then link it as static.
My own interest in this is in packaging GAP (including semigroups) for a drag-and-drop install in my Mac interface Gap.app: http://cocoagap.sourceforge.io/
I do have a workaround (running
install_name_tool
twice to fix library paths). But it seems to me that the change I've suggested is likely to make the semigroups package otherwise more robust.But maybe there are very good reasons to link libsemigroups.la as a shared library?
The text was updated successfully, but these errors were encountered: