Skip to content

Conversation

@Waschina
Copy link
Contributor

The PR adds a recipe for libsbml.

libsbml is a library for handling text files in Systems Biology Markup Language (SBML). The library is a dependency of an R package (cobrar) that we have developed and are preparing to submit to CRAN.

The package is available for Linux build systems from the dnf and apt package managers. With this PR, I hope to make the libsbml dependency available on CRAN's MacOS build system as well.

@Waschina
Copy link
Contributor Author

Just a brief explanation for the additional configure flags (-DENABLE_FBC=ON -DENABLE_GROUPS=ON):

These enable two optional extensions for the libsbml library, namely "fbc" and "groups". Both are relevant for the research community that uses linear programming to predict metabolic processes in living cells (i.e., flux balance analysis). apt and dnf linux builds also include these two extensions.

Thank you for considering the recipe.

@s-u
Copy link
Member

s-u commented Dec 21, 2023

@Waschina thanks, unfortunately this doesn't work, because the libsbml CMake is broken and doesn't honor -BUILD_SHARED_LIBS=OFF so I'll have to have look to see how it can be fixed. (There are more problems - it checks for expat but then uses xml2 instead).

FWIW your package doesn't work, either, because you are hard-coding flags which are incorrect - please consider using pkg-config to determine necessary flags for your dependent libraries if you want to publish it on CRAN.

- Using default XML parser library: libxml2
- add dependency "zlib-stub" so libsbml includes its capabilities.
@Waschina
Copy link
Contributor Author

Waschina commented Jan 2, 2024

@Waschina thanks, unfortunately this doesn't work, because the libsbml CMake is broken and doesn't honor -BUILD_SHARED_LIBS=OFF so I'll have to have look to see how it can be fixed. (There are more problems - it checks for expat but then uses xml2 instead).

@s-u thank you! I modified the recipe in the way that it used the default XML toolkit libxml2 and not expat. Is there anything I can help with to fix the problem that libsbml's CMake build system does not honour -BUILD_SHARED_LIBS=OFF?

FWIW your package doesn't work, either, because you are hard-coding flags which are incorrect - please consider using pkg-config to determine necessary flags for your dependent libraries if you want to publish it on CRAN.

Thanks for the feedback! I updated the cobrar package so that a configure script creates the src/Makevars file with the correct flags.

Waschina added a commit to Waschina/libsbml that referenced this pull request Feb 13, 2024
there was a small typo in "-DWITH_LIBXML"
@Waschina
Copy link
Contributor Author

Hi @s-u
I noticed that instead of the common BUILD_SHARED_LIB option, libSBML expects a different option: LIBSBML_SKIP_SHARED_LIBRARY. I made a pull request at the libsbml GitHub project, so it also respects the BUILD_SHARED_LIB. In the meanwhile, would it perhaps make sense to add -DLIBSBML_SKIP_SHARED_LIBRARY=ON to the configure flags of the recipe and thereby disable shared library build?

@s-u s-u merged commit 7e12dc8 into R-macos:master Aug 6, 2024
@s-u
Copy link
Member

s-u commented Aug 6, 2024

Thanks! I verified that this works and doesn't pull any additional deps. Technically, it checks for pkg-config, but it actually never uses it, so I didn't add to the deps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants