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

Could not find a package configuration file provided by "libcaer-dev" with any of the following names: #120

Closed
lunaWU628 opened this issue Nov 30, 2021 · 7 comments
Assignees

Comments

@lunaWU628
Copy link

lunaWU628 commented Nov 30, 2021

When I run the code :catkin build davis_ros_driver, I got the problem

Errors << davis_ros_driver:cmake /home/wjh/catkin_ws/logs/davis_ros_driver/build.cmake.014.log
CMake Error at /home/wjh/catkin_ws/src/rpg_dvs_ros/davis_ros_driver/CMakeLists.txt:5 (find_package):
By not providing "Findlibcaer.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "libcaer", but
CMake did not find one.

**

Could not find a package configuration file provided by "libcaer" with any
of the following names:

libcaerConfig.cmake
libcaer-config.cmake

**

Add the installation prefix of "libcaer" to CMAKE_PREFIX_PATH or set
"libcaer_DIR" to a directory containing one of the above files. If
"libcaer" provides a separate development package or SDK, be sure it has
been installed.

I use melodic, davis,

What's more, I have installed "libcaer-dev" successfully by the code "sudo apt-get install libcaer-dev", so I don't understand why this error occurred.

Hope you guys can help me.

best wishes,
xiaowu

@lunaWU628
Copy link
Author

lunaWU628 commented Dec 1, 2021

I have solved this problem!

According to the error message:

Add the installation prefix of "libcaer" to CMAKE_PREFIX_PATH or set
  "libcaer_DIR" to a directory containing one of the above files.  If
  "libcaer" provides a separate development package or SDK, be sure it has
  been installed.

I added this command to the CMakeLists.txt file:

set(libcaer_DIR "/usr/lib/x86_64-linux-gnu/cmake/libcaer/")
find_package(libcaer REQUIRED)

(The first line is the address of my llibcaerConfig.cmake file)

@llongi
Copy link
Collaborator

llongi commented Dec 1, 2021

Glad you solved it. Though that should not be required if the proper CMake paths are set up, /usr/lib/x86_64-linux-gnu/cmake/ is the default path for searching.
Could you try the following please:

  • remove set(libcaer_DIR ...) line
  • clear CMake cache (remove CMakeCache.txt file)
  • check that it fails again
  • go to /usr/lib/x86_64-linux-gnu/cmake/libcaer/ and rename 'libcaerConfig.cmake' to 'libcaer-config.cmake' and rename 'libcaerConfigVersion.cmake' to 'libcaer-config-version.cmake'
  • try again, does it work now?

@llongi llongi self-assigned this Dec 1, 2021
@lunaWU628
Copy link
Author

Thank you for your reply,
I did as you told me, but still the same error as I did before:

Could not find a package configuration file provided by "libcaer" with any
  of the following names:

    libcaerConfig.cmake
    libcaer-config.cmake

@llongi
Copy link
Collaborator

llongi commented Dec 2, 2021

Okay, turns out that you have to pass -DCMAKE_INSTALL_PREFIX=/usr for it to search in the right place, might be something changed in CMake.
Try the following catkin command, adapted from README:
$ catkin config --init --mkdirs --extend /opt/ros/kinetic --merge-devel --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr

@lunaWU628
Copy link
Author

lunaWU628 commented Dec 2, 2021

I tried the code :
wjh@wjh:~/catkin_ws$ catkin config --init --mkdirs --extend /opt/ros/melodic --merge-devel --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr

But it still had the same error
I still added the path to the CMakeLists.txt file to run successfully, but after I solved the problem, a new problem appeared:

CMake Error at /opt/ros/melodic/share/roscpp/cmake/roscppConfig.cmake:173 (message):
  Project 'davis_ros_driver' tried to find library 'pthread'.  The library is
  neither a target nor built/installed properly.  Did you compile project
  'roscpp'? Did you find_package() it before the subdirectory containing its
  code is included?

@llongi
Copy link
Collaborator

llongi commented Dec 13, 2021

I see you're using ROS Kinetic, which is based on Ubuntu 16.04. We don't really support that anymore on our (iniVation's) side, so can't guarantee that libcaer works perfectly fine with it, it isn't tested. I guess some weird interaction with its very old CMake version is happening here that prevents automatic discovery of the CMake config file.
In any case, using set(libcaer_DIR "/usr/lib/x86_64-linux-gnu/cmake/libcaer/") can be a valid solution there.

@lunaWU628
Copy link
Author

Thank you for your reply.
I use the Ubuntu18.04 Melodic.
Because I had no idea to solve the problems, I reinstalled the Ubuntu 18.04 again. And I successfully recompiled it.

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

2 participants