CMake complains about "No package 'systemd' found" though I have installed systemd on docker container of Ubuntu 20.04. Why cmake is not able to detect the installed pkg
root#e8208b70072e:/opt/dev/sysrepo/build# cmake ..
-- ietf-yang-library revision: 2019-01-04
-- Sysrepo repository: /etc/sysrepo
-- Startup data path: /etc/sysrepo/data
-- Notification path: /etc/sysrepo/data/notif
-- YANG module path: /etc/sysrepo/yang
-- SR plugins path: /usr/local/lib/sysrepo/plugins
-- SRPD plugins path: /usr/local/lib/sysrepo-plugind/plugins
Package systemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `systemd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'systemd' found
-- Could NOT find LibSystemd (missing: SYSTEMD_UNIT_DIR)
CMake Warning at CMakeLists.txt:349 (message):
Disabling sysrepo-plugind systemd support because libsystemd was not found.
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/dev/sysrepo/build
Installed files can be seen below
root#e8208b70072e:/opt/dev# find / -name *libsystemd*
/var/lib/dpkg/info/libsystemd0:amd64.md5sums
/var/lib/dpkg/info/libsystemd0:amd64.shlibs
/var/lib/dpkg/info/libsystemd0:amd64.symbols
/var/lib/dpkg/info/libsystemd0:amd64.list
/var/lib/dpkg/info/libsystemd0:amd64.triggers
/var/lib/dpkg/info/libsystemd-dev:amd64.md5sums
/var/lib/dpkg/info/libsystemd-dev:amd64.list
/usr/share/doc/libsystemd0
/usr/share/doc/libsystemd-dev
/usr/lib/x86_64-linux-gnu/libsystemd.so.0
/usr/lib/x86_64-linux-gnu/libsystemd.so.0.28.0
/usr/lib/x86_64-linux-gnu/libsystemd.so
/usr/lib/x86_64-linux-gnu/pkgconfig/libsystemd.pc
Related
I'm trying to compile the libnetconf2 with msys2 environment on Windows 10 OS. But I get a wired(I guess) issue about libssh.
I have installed libssh libssh2 libssh-devel libssh2-devel and the pkg-config also find the location of libssh:
$ pkg-config --list-all
autoopts AutoOpts - A semi-automated generated/library option parser
form formw - ncurses 6.2 add-on library
formw formw - ncurses 6.2 add-on library
libalpm libalpm - Arch Linux package management library
libcrypto OpenSSL-libcrypto - OpenSSL cryptography library
libmagic libmagic - Magic number recognition library
libpcre libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support
libpcre16 libpcre16 - PCRE - Perl compatible regular expressions C library with 16 bit character support
libpcre2-16 libpcre2-16 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 16 bit character support
libpcre2-32 libpcre2-32 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 32 bit character support
libpcre2-8 libpcre2-8 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 8 bit character support
libpcre2-posix libpcre2-posix - Posix compatible interface to libpcre2-8
libpcre32 libpcre32 - PCRE - Perl compatible regular expressions C library with 32 bit character support
libpcrecpp libpcrecpp - PCRECPP - C++ wrapper for PCRE
libpcreposix libpcreposix - PCREPosix - Posix compatible interface to libpcre
libpkgconf libpkgconf - a library for accessing and manipulating development framework configuration
libssh libssh - The SSH Library
libssh2 libssh2 - Library for SSH-based communication
libssl OpenSSL-libssl - Secure Sockets Layer and cryptography libraries
$ pkg-config --modversion libssh
0.9.6
And then run the command "cmake .." in
libnetconf2/build
, which gives the error:
$ cmake ..
CMake Warning at CMakeLists.txt:171 (message):
valgrind executable not found! Disabling memory leaks tests.
-- Could NOT find CMocka (missing: CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR) (Required is at least version "1.0.1")
-- Disabling tests because of missing CMocka
-- Could NOT find Uncrustify (missing: UNCRUSTIFY) (Required is at least version "0.71")
-- OpenSSL found, required for TLS
CMake Error at /usr/share/cmake-3.21.3/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find LibSSH (missing: LIBSSH_LIBRARIES) (Required is at least
version "0.7.1")
Call Stack (most recent call first):
/usr/share/cmake-3.21.3/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
CMakeModules/FindLibSSH.cmake:113 (find_package_handle_standard_args)
CMakeLists.txt:239 (find_package)
-- Configuring incomplete, errors occurred!
And then I try to compile libssh from source code, after compiling and installation, the cmake still can't find the correct libssh (Below is the log for libssh compile and install):
$ make install
Consolidate compiler generated dependencies of target ssh
[ 58%] Built target ssh
Consolidate compiler generated dependencies of target libssh_scp
[ 63%] Built target libssh_scp
Consolidate compiler generated dependencies of target sshnetcat
[ 68%] Built target sshnetcat
Consolidate compiler generated dependencies of target ssh-client
[ 73%] Built target ssh-client
Consolidate compiler generated dependencies of target scp_download
[ 78%] Built target scp_download
[ 80%] Built target libsshpp
Consolidate compiler generated dependencies of target samplesshd-cb
[ 82%] Built target samplesshd-cb
Consolidate compiler generated dependencies of target senddata
[ 87%] Built target senddata
Consolidate compiler generated dependencies of target exec
[ 92%] Built target exec
Consolidate compiler generated dependencies of target libsshpp_noexcept
[ 94%] Built target libsshpp_noexcept
Consolidate compiler generated dependencies of target keygen
[ 96%] Built target keygen
Consolidate compiler generated dependencies of target samplesftp
[100%] Built target samplesftp
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/pkgconfig/libssh.pc
-- Installing: /usr/local/lib/cmake/libssh/libssh-config-version.cmake
-- Installing: /usr/local/include/libssh/callbacks.h
-- Installing: /usr/local/include/libssh/libssh.h
-- Installing: /usr/local/include/libssh/ssh2.h
-- Installing: /usr/local/include/libssh/legacy.h
-- Installing: /usr/local/include/libssh/libsshpp.hpp
-- Installing: /usr/local/include/libssh/sftp.h
-- Installing: /usr/local/include/libssh/server.h
-- Installing: /usr/local/include/libssh/libssh_version.h
-- Installing: /usr/local/lib/libssh.dll.a
-- Installing: /usr/local/bin/msys-ssh-4.dll
-- Installing: /usr/local/lib/cmake/libssh/libssh-config.cmake
-- Installing: /usr/local/lib/cmake/libssh/libssh-config-noconfig.cmake
BTW, the LD_LIBRARY_PATH has added:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
I have resolved this issue as the link:
Libgit2 and libssh2 CMake package 'libssh2' not found
/usr/local is the prefix path that I compiled and installed the libssh from source code.
cmake -DLIBSSH_INCLUDE_DIRS=/usr/local/include/libssh -DLIBSSH_LIBRARIES=/usr/local/lib/ ..
I have created a workspace as catkin_ws. Then, catkin_make was run successful.
After I type catkin_create_pkg ros_basics_tutorials std_msgs rospy roscpp and then the all folders and files created in ros_basics_tutorials folder.
However After this command, I type cd catkin_ws
and then catkin_make
Below error is shown Cmake Error, Could NOT find cpp (missing: cpp_DIR), cmake_check_build_system' failed
Base path: /home/selcuk/catkin_ws
Source space: /home/selcuk/catkin_ws/src
Build space: /home/selcuk/catkin_ws/build
Devel space: /home/selcuk/catkin_ws/devel
Install space: /home/selcuk/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/selcuk/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/selcuk/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/selcuk/catkin_ws/devel;/opt/ros/melodic
-- This workspace overlays: /home/selcuk/catkin_ws/devel;/opt/ros/melodic
-- Using PYTHON_EXECUTABLE: /home/selcuk/python/anaconda2/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/selcuk/catkin_ws/build/test_results
CMake Error: Target gtest has dependency information when it shouldn't.
Your cache is probably stale. Please remove the entry
gtest_LIB_DEPENDS
from the cache.
CMake Error: Target gtest_main has dependency information when it shouldn't.
Your cache is probably stale. Please remove the entry
gtest_main_LIB_DEPENDS
from the cache.
CMake Error: Target gmock has dependency information when it shouldn't.
Your cache is probably stale. Please remove the entry
gmock_LIB_DEPENDS
from the cache.
CMake Error: Target gmock_main has dependency information when it shouldn't.
Your cache is probably stale. Please remove the entry
gmock_main_LIB_DEPENDS
from the cache.
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 2 packages in topological order:
-- ~~ - ros_basics_tutorials
-- ~~ - naoqi_driver
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'ros_basics_tutorials'
-- ==> add_subdirectory(ros_basics_tutorials)
-- Could NOT find cpp (missing: cpp_DIR)
-- Could not find the required component 'cpp'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "cpp" with any of
the following names:
cppConfig.cmake
cpp-config.cmake
Add the installation prefix of "cpp" to CMAKE_PREFIX_PATH or set "cpp_DIR"
to a directory containing one of the above files. If "cpp" provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
ros_basics_tutorials/CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/selcuk/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/selcuk/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
I couldn't solve? How can solve it?
The error was due to anathor project folder which i canceled under the catkin_ws. I deleted it and complied again. The error solved.
Since yesterday none of my packages containing tests build. Catkin complains it cannot find gtest when using catkin_add_gtests(), since GTEST_FOUND is FALSE. You can see this in the error msg below, with the custom output I added to my CMakeLists. Up to yesterday, GTEST_FOUND was TRUE when catkin_add_gtests() was called.
This is the error I always get. In this case I'm trying to build a mockup package on a clean catkin workspace:
Errors << silly_pkg:cmake /home/paco/catkin_ws2/logs/silly_pkg/build.cmake.002.log
Not searching for unused variables given on the command line.
Re-run cmake no build system arguments
-- Using CATKIN_DEVEL_PREFIX: /home/paco/catkin_ws2/devel/.private/silly_pkg
-- Using CMAKE_PREFIX_PATH: /home/paco/catkin_ws2/devel;/opt/ros/kinetic
-- This workspace overlays: /home/paco/catkin_ws2/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/paco/catkin_ws2/build/silly_pkg/test_results
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.11
-- GTEST_FOUND: FALSE
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:149 (message):
skipping gtest 'test_silly_pkg' in project 'silly_pkg' because gtest was
not found
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:79 (_catkin_add_executable_with_google_test)
/opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:28 (_catkin_add_google_test)
CMakeLists.txt:28 (catkin_add_gtest)
CMake Error at /home/paco/catkin_ws2/src/silly_pkg/CMakeLists.txt:33 (target_link_libraries):
Cannot specify link libraries for target "test_silly_pkg" which is not
built by this project.
-- Configuring incomplete, errors occurred!
See also "/home/paco/catkin_ws2/build/silly_pkg/CMakeFiles/CMakeOutput.log".
See also "/home/paco/catkin_ws2/build/silly_pkg/CMakeFiles/CMakeError.log".
cd /home/paco/catkin_ws2/build/silly_pkg; catkin build --get-env silly_pkg | catkin env -si /usr/bin/cmake /home/paco/catkin_ws2/src/silly_pkg --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/paco/catkin_ws2/devel/.private/silly_pkg -DCMAKE_INSTALL_PREFIX=/home/paco/catkin_ws2/install; cd -
I am using catkin 0.7.11, libgtest-dev 1.7.0 and cmake 3.5.1. I use ROS Kinetic with Ubuntu 16.04. The only thing I did yesterday was reinstalling ROS Kinetic, but the package versions are exactly the same. Did anybody have this problem? Do you have any ideas on what could be happening?
EDIT 3/09/18:
By comparing with a functional catkin+gtest workspace in a different computer, I found out that the main difference is in the results of /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake. In the functional workspace, line 292 evaluates to TRUE (gtest/gmock is not a target) while in my workspace it evaluates to FALSE. This is because in my workspace running find_package(GMock QUIET) (line 287) sets gmock and gtest as imported targets, which does not happen in the other computer. Why is this different?
Thanks TikO for your help!
Since you wrote that cmake does not find the libraries and that you have reinstalled Kinetic, I assume that you have a freshly installed machine or wiped out gtest libraries by accident.
If you install libgtest-dev, you only get the sources which you need to build and install like this:
sudo apt-get install libgtest-dev
mkdir /tmp/gtest_build && cd /tmp/gtest_build
cmake /usr/src/gtest
make
#copy or symlink libgtest.a and ligtest_main.a to /usr/lib folder
sudo cp *.a /usr/lib
After this routine, you should be able to build again without cmake complaining.
Optional
If you have limited rights on your machine and you are not allowed to install the libraries in that way, just copy them into some home folder like
mkdir ~/lib && cp *.a ~/lib
But be aware of the fact, that you have to call catkin in the following way:
LIBRARY_PATH=~/lib GTEST_ROOT=~/lib catkin_make
LIBRARY_PATH tells the linker where to find the libraries, while GTEST_ROOT gives cmake the location hints for it's checks.
Reference: https://github.com/tik0/gtest_ros_example
SOLUTION FOUND
gmock and gtest were being set to imported target because the suggested manual compilation of libgtest had created a FindGMock.cmake file inside /usr/share/cmake-3.5/Modules. This file was being called by the find(GMock QUIET)
in catkin_add_gtests(), therefore setting the imported target. Just deleting FindGMock.cmake solved the issue.
I am trying to build FLANN libraries in order to build PCL library afterwards.
I get an error while using CMake to compile the source.
I guess I am missing something very basic. Since I can't find a compiled library for my system I have to build it myself.
With the command
~/flann-1.8.4-src/build> cmake ..
I get
CMake Error at src/cpp/CMakeLists.txt:86 (add_library):
No SOURCES given to target: flann
CMake Error at src/cpp/CMakeLists.txt:32 (add_library):
No SOURCES given to target: flann_cpp
This happens with flann 1.8.4 and 1.9.1 on a SLES11 operating system.
Any hint?
Here a complete transcription of what cmake says:
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version "")
CMake Warning at CMakeLists.txt:76 (message):
hdf5 library not found, some tests will not be run
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
CMake Warning at CMakeLists.txt:115 (message):
gtest library not found, some tests will not be run
-- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP: TRUE
CMake Warning at src/matlab/CMakeLists.txt:79 (message):
Cannot find MATLAB or Octave instalation. Make sure that the 'bin'
directory from the MATLAB instalation or that mkoctfile is in PATH
hdf5 library not found, not compiling flann_example.cpp
-- Could NOT find LATEX (missing: LATEX_COMPILER)
-- Install prefix: /usr/local
-- Build type: RelWithDebInfo
-- Building C bindings: ON
-- Building python bindings: ON
-- Building matlab bindings: ON
-- Building CUDA library: OFF
-- Using OpenMP support: ON
-- Using MPI support: OFF
-- Configuring done
CMake Error at src/cpp/CMakeLists.txt:86 (add_library):
No SOURCES given to target: flann
CMake Error at src/cpp/CMakeLists.txt:32 (add_library):
No SOURCES given to target: flann_cpp
-- Build files have been written to: ~/flann-1.8.4-src/build
In your flann dir
run
touch src/cpp/empty.cpp
In src/cpp/CMakeLists.txt
replace
add_library(flann_cpp SHARED "") and add_library(flann SHARED "")
with
add_library(flann_cpp SHARED empty.cpp) and add_library(flann SHARED empty.cpp)
Hope this helps :)
link, thanks to the comment by Tsyvarev
I've already compiled and installed libzypp, but when I want to compile zypper then Cmake returns an error:
CMake Error at CMakeLists.txt:11 (INCLUDE):
INCLUDE could not find load file:
ZyppCommon
CMake Error at CMakeLists.txt:24 (GENERATE_PACKAGING):
Unknown CMake command "GENERATE_PACKAGING".
-- Configuring incomplete, errors occurred!
See also "/home/origincode/zypper/CMakeFiles/CMakeOutput.log".
Environment
My OS: Fedora 26
gcc version:7.1.1
cmake version:3.9.1
The reason is, that CMake does not find the file ZyppCommon.cmake which contains the definition of the macro GENERATE_PACKAGING. The file is part of libzypp (located in cmake/modules/ZyppCommon.cmake).
You have three options:
Install libzypp, then zypper's CMake will find the file.
You have to include the path to the file to the CMake prefix path.
If you use some Suse / openSuse dritribution, installing libzypp-devel does install the required file.
If you have it installed, maybe you have to clear the CMake cache.