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

OpenBabel3Config.cmake: "The following imported targets are referenced but are missing: maeparse coordgen" #2568

Open
chedatomasz opened this issue Feb 7, 2023 · 2 comments

Comments

@chedatomasz
Copy link

chedatomasz commented Feb 7, 2023

Environment Information

Operating system and version: Ubuntu 20.04

I am trying to build openbabel from source.
I installed swig, eigen and zlib.
I am running CMake 3.20.5
I cloned the repo, configured with:
cmake .. -DRUN_SWIG=ON -DPYTHON_BINDINGS=ON
built, and installed. It passed most tests.
The problem arises when importing the package with cmake (if you're reading this because you're building gnina, use make -DWITH_MAEPARSER=OFF -DWITH_COORDGEN=OFF -DPYTHON_BINDINGS=ON -DRUN_SWIG=ON .. to bypass this issue):
find_package(OpenBabel3 REQUIRED)

This results in the following message:
`
CMake Error at CMakeLists.txt:68 (find_package):
Found package configuration file:

/usr/local/lib/cmake/openbabel3/OpenBabel3Config.cmake

but it set OpenBabel3_FOUND to FALSE so package "OpenBabel3" is considered
to be NOT FOUND. Reason given by package:

The following imported targets are referenced, but are missing: maeparser
coordgen
`

in /usr/local/lib, I can see libmaeparser.so and libcoordgen.so.

Possibly relevant lines from cmake output:
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: program_options iostreams -- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0") -- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: filesystem iostreams unit_test_framework -- maeparser include dir set as 'maeparser_INCLUDE_DIRS-NOTFOUND' -- maeparser libraries set as 'maeparser_LIBRARIES-NOTFOUND' -- Building existing MaeParser 'v1.2.3' source at /media/chedat/exchg/ligands/gnina/from_source/openbabel/external/maeparser-v1.2.3. -- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: iostreams -- Using zlib library for iostreams dependency. -- Maestro formats will be supported. Using MaeParser 'v1.2.3' at /media/chedat/exchg/ligands/gnina/from_source/openbabel/external/maeparser-v1.2.3 -- coordgen include dir set as coordgen_INCLUDE_DIRS-NOTFOUND -- coordgen libraries set as 'coordgen_LIBRARIES-NOTFOUND' -- Building existing Coordgen 'master' source at /media/chedat/exchg/ligands/gnina/from_source/openbabel/external/coordgen-master. -- Coordinate generation with Coordgen will be supported Using Coordgen 'master' at /media/chedat/exchg/ligands/gnina/from_soure/openbabel/external/coordgen-master

I can see similar behaviour reported in #2305 and a supposed fix in #2315, however, building from the master branch does not alleviate the issue.

I also tried compiling 3.1.1 and 3.0.0 - same problem.

Unfortunately, I am not familiar with CMake enough to debug this further.

@welcome
Copy link

welcome bot commented Feb 7, 2023

Thanks for opening your first issue here! Be sure to follow the issue template!

@chedatomasz
Copy link
Author

I dug a bit deeper. The error appears in the generated OpenBabel3_EXPORTS.cmake. In line 103, it checks whether the targets for maeparser and coordgen are set. They are not, as the coordgen-config.cmake and maeparser-config.cmake, present in /usr/local/lib/cmake, are never searched for or imported.
If I understand correctly, creation of those files happens around line 717 in the top level CMakeLists.txt

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

No branches or pull requests

1 participant