I have been trying to do a build with cmake3 that involves using protobuf library version >=3.11. I think I correctly installed the compiler at least, since protoc --version returns libprotoc 3.12.3 . However, the library does not seem to be properly linked cor cmake, just the compiler. If I try to do a cmake command, it warns that
Protobuf compiler version 3.12.3 doesn't match library version 2.5.0
which seems off since I installed protobuf 3.12 using the instructions here https://github.com/protocolbuffers/protobuf/tree/master/src. This leads to errors when I try to do the make install when it doesn't recolonize headers introduced in later versions.
Protobuf 2.5.0 is the one that comes with sudo yum install protobuf and I need a more recent version for the cmake installation. Can someone tell me what I am doing wrong so that cmake links the correct library version when compiling? I am on Centos 7 if that matters.
Related
I'm currently developing a Kalman Filtering library using Eigen and I've successfully gotten it working on my development Mac. Now I'm trying to set it up with Travis CI and CMake is having trouble with finding the package. First I sudo apt install libeigen3-dev and then attempt to run cmake with the following configuration:
cmake_minimum_required(VERSION 3.0)
project(KFilter VERSION 0.1.0)
find_package (Eigen3 REQUIRED NO_MODULE)
add_library(KFilter KFilter.cpp)
target_link_libraries(KFilter Eigen3::Eigen)
This builds just fine on my Mac, but in Travis CI it errors out with the following:
CMake Error at CMakeLists.txt:5 (add_library):
Target "KFilter" links to target "Eigen3::Eigen" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Why is would I be getting this error at line 5 when the find_package seems to be successful? I'm following this guide from the Eigen website.
Travis CI is running Ubuntu 16.04 with CMake 3.12 and the Eigen3 debian package, while my Mac is running CMake 3.13 with Eigen installed through homebrew. I'm really confused as to why CMake is behaving differently.
You don't mention which version of Eigen3 is being used in each case.
It looks like between Eigen3 3.2 and 3.3 it changed from using FindEigen3.cmake to Eigen3Config.cmake. This changed how to include Eigen3 into a project and in 3.3 it uses Eigen3::Eigen3.
But as it turns out on Ubuntu 16.04 the package is libeigen3-dev (3.3~beta1-2) and 3.3 beta versions didn't export Eigen3::Eigen3 instead it contains:
add_definitions ( ${EIGEN3_DEFINITIONS} )
include_directories ( ${EIGEN3_INCLUDE_DIRS} )
So just remove target_link_libraries(KFilter Eigen3::Eigen) and it should be fine.
What worked for me using Ubuntu 16.04 was to remove the target_link_libraries(KFilter Eigen3::Eigen) and change in my source file the following line #include <eigen3/Eigen/Dense>
I am new to solaris 11 machine. I have a vitual box and I can only interact via command promt. I am trying to install cmake 3.11 version. I tried downloading cmake source code and building it. But failed at one point where in code uses c++11 and the our gcc compiler is not able to compile it.
It will be very greatfull if anyone can give me steps for installing and using cmake in solaris11.
Thanks in advance.
Solaris 11 offers a cmake package in its package repos, so pkg install cmake as root should do it.
I got a message that I needed to upgrade to the newest version of Bazel to build Tensorflow. I followed the instructions for installing bazel using apt-get and it says I have 0.7.0 installed.
However when I issue the command "bazel version", I am still seeing the older 0.4.5 version installed. When I issue "whereis bazel" I get the following results:
bazel: /usr/bin/bazel /etc/bazel.bazelrc /usr/local/bin/bazel /usr/local/lib/bazel
The version at /usr/bin/bazel is the newest version 0.7.0. However the version at /usr/local/bin/bazel is the older version 0.4.5.
I am somewhat new to Linux, but assume there has got to be a way to change the pointer for the path for when I call bazel directly. Is this assumption correct? Any ideas? Thanks!
You should just remove your installation under /usr/local/bin/bazel which was probably installed with an older shell installer: sudo rm /usr/local/bin/bazel
I'm running Elementary OS, which is based on Ubuntu 14.04LTS. Ninja is at version 1.3.4. When running Meson, I get the error:
ninja: fatal: ninja version (1.3.4) incompatible with build file ninja_required_version version (1.5.1).
According to http://www.mariocampos.io/blog/meson,-first-impressions/ I can fix this by getting a newer version of Ninja. That's fine, I can do that. However, I prefer to keep to the software in the package repos, so my question is:
Can I tell Meson to generate a Ninja build file that doesn't require such a high version, or does Meson use Ninja features only available in 1.5.1?
Indeed, as you can see in meson git repository, ninja minimum version was raised from 1.3.4 to 1.5.1 on December 3 2014 for the following reason:
To celebrate the new version of Ninja in Debian, start using the console pool.
One solution would be to use an older meson-build version (basically MAXIMUM version 0.21.0).
Can I tell Meson to generate a Ninja build file that doesn't require such a high version
No. It's hard coded in the meson source code.
does Meson use Ninja features only available in 1.5.1?
Yes. It's the Console Pool.
I am using Point cloud library 1.5.1. When I run CMake 3.4.0-rc2 to build my project, it has error:
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
How do I fix this error?
This error is raised because the pkg-config utility is not available on your system.
Using PkgConfig with CMake is not a truly cross-platform solution, as Windows does not come with the pkg-config utility installed. (The PCL developers should instead use find_package() in their CMake. Perhaps, this is worth opening up a bug report on their Github.) On Linux, this is an easy fix; you can install pkg-config like this:
sudo apt-get install pkg-config
However, on Windows, the process is more involved. There are several solutions for installing pkg-config on Windows documented here. I'm not sure which most directly applies to your situation, so I suggest reading through some of those. After successfully installing the pkg-config utility on your Windows machine, clear your CMake cache, and re-run CMake. This should remove the error, and allow your build to proceed.
Install vcpkg: https://vcpkg.io/en/getting-started.html
Install pkgconf:
.\vcpkg install pkgconf
If use CMake, delete the Cache files/folders: CMakeCache.txt and CMakeFiles. After that, run the command
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\dev\vcpkg\scripts\buildsystems\vcpkg.cmake
On Fedora 34, it was because of multiple pkg-config
/home/sapillai/go/bin/pkg-config
/home/sapillai/go/bin/pkg-config
/usr/bin/pkg-config
/home/sapillai/go/bin/pkg-config
I deleted the others and kept /usr/bin/pkg-config. Error was gone.