gnames / gnparser

GNparser normalises scientific names and extracts their semantic elements.
MIT License
38 stars 4 forks source link

Add universal Darwin shared library target #217

Closed rainhead closed 2 years ago

rainhead commented 2 years ago

It looks like building and releasing the clib is a manual process. I don't know go well enough to contribute a general solution there (I don't know go at all), but I can at least contribute this build target to build a universal shared library on Darwin. Any recent Darwin system should be able to build both amd64 and arm64.

dimus commented 2 years ago

Thanks @rainhead, interesting, I did not know I could crosscompile anything involving C reliably. In my case, I have little knowledge of C and its ecosystem.

Please note that we have a github action that automatically creates all libraries with a commit: https://github.com/gnames/gnparser/blob/eecf9a89c2d267f54084a3b6986788e416d25b5c/.github/workflows/test.yml#L41

It creates 1 Linux 1 Windows and 2 Mac *.so files.

Does this workflow takes care of your use-case, or your approach adds additional benefit?

rainhead commented 2 years ago

Hi and thanks for responding. The .so in macos-latest-clib.zip available for the v1.5.6 release is for x86_64 only. You can verify this using file libgnparser.so. This PR proposes adding the arm64 architecture to that file, rather than creating a new distribution file for arm. Users who upgrade from Intel to ARM will not have to reinstall gnparser.

rainhead commented 2 years ago

Note that the universal library is about twice the size of the architecture-specific libraries.

dimus commented 2 years ago

Good point @rainhead, thanks for the patch, merging...