Skip to content
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

find_package does not work on Ubuntu 22.10 #278

Open
kaiserls opened this issue Nov 5, 2022 · 2 comments
Open

find_package does not work on Ubuntu 22.10 #278

kaiserls opened this issue Nov 5, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@kaiserls
Copy link

kaiserls commented Nov 5, 2022

I tried to compile one of the example programs from examples using cmake. However CMake cant find libsbml using the find_package command. Could someone who has a better knowledge about cmake help to resolve this issue?

Expected behaviour

The cmake command find_package(sbml REQUIRED) successfully finds libsbml.

Observed behaviour

CMake can not find the file sbml-config.cmake and therefore can not find the library and header files of sbml. Moving the config files into a subfolder, like most libraries do it, allows cmake to find them but messes up the path variables.

Steps to reproduce

  1. Install Ubuntu 22.10
  2. sudo apt install libsbml5-dev
  3. Download CMakeLists.txt and one of the examples, rename to example.cpp
  4. mkdir build && cd build && cmake .. && make -j

Package version

Package: libsbml5-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 32111
Maintainer: Ubuntu Developers [email protected]
Architecture: amd64
Source: libsbml
Version: 5.19.0+dfsg-1ubuntu2
Provides: libsbml-dev
Depends: libsbml5 (= 5.19.0+dfsg-1ubuntu2)

cmake version: 3.24.2

Similar issues:

Probably related to Issue #245

Fixing the issue

I tried to track down the problem and came to the following conclusion:
The sbml-config-*.cmake files are written directly to "/urs/lib/x86_64-linux-gnu/cmake" and not into a subfolder sbml. After moving the files into this newly created subfolder a new issue occurs: The variable _IMPORT_PREFIX is set to /usr/lib and used as prefix for /lib/x86_64-linux-gnu/libsbml.so.5.19.0. Manually fixing the paths leads to the successful compilation of the example program.

CMakeLists.txt

@fbergmann fbergmann added the help wanted Extra attention is needed label Nov 7, 2022
@fbergmann
Copy link
Member

we are actually not maintainers of the ubuntu package. I'm not sure what we could do to help resolving the issue.

@kaiserls
Copy link
Author

kaiserls commented Nov 7, 2022

The error also occurs if I build the library from the source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants