Boost CMake cannot find python library - visual-studio-2012

After sifting through the many other questions about CMake being unable to find boost libraries I still can't figure my issue out:
My Portion of the CMakeLists related to this:
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost COMPONENTS python REQUIRED)
include_directories("${PROJECT_BINARY_DIR}")
include_directories("${PROJECT_SOURCE_DIR}/src/mazeGen")
include_directories("${PROJECT_SOURCE_DIR}/src/mazeSolve")
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(${EXECUTABLE_NAME} ${Boost_LIBRARIES})
add_executable(${EXECUTABLE_NAME} ${SOURCES} ${HEADERS})
when I specify BOOST_ROOT and try to build the project the error output is:
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:1111 (message):
Unable to find the requested Boost libraries.
Boost version: 1.55.0
Boost include path: C:/local/boost_1_55_0
Could not find the following Boost libraries:
boost_python
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:36 (find_package)
Where exactly should I point CMake in order to find the libraries? And how can I do this?
all of the built libraries are located in ${BOOST_ROOT}/stage/lib and are built for VS2012, I tried setting BOOST_LIBRARYDIR to ${BOOST_ROOT}/stage/lib but this did nothing

Related

Set Wno-dev in particular CMakeLists

I have a project when I use cmake. I also use cmake to create a deb and an rpm package.
When building RPM we have many warnings like this:
CMake Warning (dev) at /usr/share/cmake-3.13/Modules/Internal/CPack/CPackRPM.cmake:135 (message):
CPackRPM:Warning: Path /etc/apache2/sites-available/mux.conf is not on one
of the relocatable paths! Package will be partially relocatable.
Call Stack (most recent call first):
/usr/share/cmake-3.13/Modules/Internal/CPack/CPackRPM.cmake:1001 (cpack_rpm_prepare_relocation_paths)
/usr/share/cmake-3.13/Modules/Internal/CPack/CPackRPM.cmake:1870 (cpack_rpm_generate_package)
This warning is for project developers. Use -Wno-dev to suppress it.
We have many sub CmakeLists files and even when we use "-Wno-dev" at the top of the project we still have this warning.
How can I force the Wno-dev in the CMakeLists that cause this warning?
Cmake-gui: Options|Warning Messages: Suppress Warnings - check "Developer Warnings"
From man cmake: cmake -Wno-dev ...

Using Protobuf installed at a custom location in Linux with CMake?

I am packaging all my dependencies with Conan IO for a C++ project using CMake. I downloaded the sources of Protobuf and built them. I then added them on Conan.
On a build server, I am trying to build my CMake project, but it cannot seem to find my Protobuf library properly. Here's the log I am getting:
/home/user/Documents/project/test/build/venv/.conan/data/Protobuf/3.6.1/org/dev/package/80043e232e8ab07f4b25e67652a9490d9ad33d91/bin/protoc: error while loading shared libraries: libprotoc.so.17: cannot open shared object file: No such file or directory
CMake Warning at /home/username/Documents/project/test/build/venv/lib/python3.6/site-packages/cmake/data/share/cmake-3.10/Modules/FindProtobuf.cmake:455 (message):
Protobuf compiler version doesn't match library version 3.6.1
Call Stack (most recent call first):
/home/username/Documents/project/test/script/cmake/Env.cmake:139 (include)
CMakeLists.txt:6 (include)
-- Found Protobuf: /home/username/Documents/project/test/build/venv/.conan/data/Protobuf/3.6.1/org/dev/package/80043e232e8ab07f4b25e67652a9490d9ad33d91/lib/libprotobuf.so;-lpthread (found version "3.6.1")
/home/username/Documents/project/test/build/venv/.conan/data/Protobuf/3.6.1/org/dev/package/80043e232e8ab07f4b25e67652a9490d9ad33d91/bin/protoc: error while loading shared libraries: libprotoc.so.17: cannot open shared object file: No such file or directory
CMake Warning at /home/username/Documents/project/test/build/venv/lib/python3.6/site-packages/cmake/data/share/cmake-3.10/Modules/FindProtobuf.cmake:455 (message):
Protobuf compiler version doesn't match library version 3.6.1
Call Stack (most recent call first):
/home/username/Documents/project/test/src/shared/bysp/CMakeLists.txt:9 (find_package)
-- Found Protobuf: /home/username/Documents/project/test/build/venv/.conan/data/Protobuf/3.6.1/org/dev/package/80043e232e8ab07f4b25e67652a9490d9ad33d91/lib/libprotobuf.so;-lpthread;-lpthread (found version "3.6.1")
I'm having a hard time understanding what the problem is. It says it cannot find libprotoc.so.17, but that file exists under /lib in my conan package. It then says that it did find my library. I don't understand why it's giving me a warning and then says that it found the library. Also, protobuf is not installed on the build server. All dependencies are pre-built binaries downloaded via Conan. I am using FindProtobuf to find protobuf. Should I use something else?

cmake doesn't find Qt5

Last night I tried to download the disassembler called "Evan's debugger (edb)", that has similar GUI to Ollydbg (Linux only).
I tried to build them via terminal using:
sudo cmake ../edb_folder
With ../edb_folder being the directory containing edb's source code.
It gives me the following error about Qt5:
-- Boost version: 1.58.0
-- Checking for module 'libgvc>=2.38.0'
--
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:26 (find_package):
Could not find a package configuration file provided by "Qt5Svg" with any
of the following names:
Qt5SvgConfig.cmake
qt5svg-config.cmake
Add the installation prefix of "Qt5Svg" to CMAKE_PREFIX_PATH or set
"Qt5Svg_DIR" to a directory containing one of the above files. If "Qt5Svg"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
src/CMakeLists.txt:26 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/kanna/Desktop/build/CMakeFiles/CMakeOutput.log".
But I already have Qt5 installed on my system (see this picture). Why can't cmake find Qt5?
(FYI: I'm using ubuntu 64bits)
go to synaptic and install libqt5svg5 + libqt5svg5-dev + libqt5svg5-private-dev

Can't install Vision Workbench

I am trying to install the Vision Workbench on my computer, following the instructions from this homepage: http://lunokhod.org/?p=13. I have installed all dependencies but I have libboost1.54-all-dev instead since I am using Mint 17 (Ubuntu 14.4).
After that I have created the config.options file I do ./autogen and ./configure.
However, I get the following in the logfile:
configure:20861: /usr/include/boost is missing these required libraries: BOOST_PROGRAM_OPTIONS BOOST_FILESYSTEM BOOST_THREAD
Checking for a boost in /usr/include/boost-*
Checking for a boost in /usr/local/cuda/include
Checking for a boost in /usr/local/cuda/include/boost-*
configure:20875: checking for package BOOST
HAVE_PKG_BOOST=no
However, in /usr/include/boost/ I have booth program_options, filesystem and thread.
The .so files are under /usr/lib/x86_64-linux-gnu/ for opencv, boost and flann, but somehow it can only find flann.
Does anyone have an idea about where the error might be?
EDIT: In the log-file I saw that the program looked for cxcore when it searched for opencv, but in the new version it is called opencv_core so I did a symbolic link from cxcore to opencv_core and then ./configure finds opencv. However, boost is still a problem and is necessary to build the program.
EDIT2:
I have now downloaded an earlier version of boost (1.42), and almost all boost programs are found except BOOST_THREAD. When I install the boost library I get the following messages:
error: #error "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"
/ Erik
try running
./configure --with-boost="path/to/boost"
if you have more than one version of boost installed, you may need to also set environment variables
HAVE_PKG_BOOST=yes
PKG_BOOST_CPPFLAGS=/path/to/boost
PKG_BOOST_LDFLAGS=/path/to/boost

Openssl header not found -- error

I need to compile a libwebsocket library for my ARM target which requires openssl for its functioning.
I am getting following error when i build latest libwebsocket at the time of, cmake ...
But openssl is installed here
whereis openssl
openssl: /usr/bin/openssl /usr/bin/X11/openssl /usr/share/man/man1/openssl.1ssl.gz
=================================== Error ================
-- Looking for 4 include files stdlib.h, ..., float.h - found
-- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.7")
ZLib include dirs: /usr/include
ZLib libraries: /usr/lib/arm-linux-gnueabihf/libz.so
Compiling with SSL support
CMake Error at /usr/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-2.8/Modules/FindOpenSSL.cmake:313 (find_package_handle_standard_args)
CMakeLists.txt:436 (find_package)
-- Configuring incomplete, errors occurred!
======================================= openssl is here ========================
ignite#ignite:~/sbox2/rootfs/rfs-raspbian_2/home/pi/libwebsockets/build$ whereis openssl
openssl: /usr/bin/openssl /usr/bin/X11/openssl /usr/share/man/man1/openssl.1ssl.gz
actually i have, source tarball from here. it have configure script to make & make install
http://www.openssl.org/source/
openssl-1.0.1e.tar.gz
So with this (openssl-1.0.1e.tar.gz) will be the right package to get --> openssl-dev or openssl-devel --- so that i can resolve this error ?
So with this (openssl-1.0.1e.tar.gz) will be the right package to get --> openssl-dev or openssl-devel --- so that i can resolve this error ?
The openssl-dev packages are for development on the host machine (which is probably x86 or x64 family). You need a cross compiled library for the target (and not the host). So openssl-dev will probably not solve your problem.
Are you targeting a generic ARM processor, iOS, or Android? If the former, you will need an arm cross-toolchain with paths set appropriately. I'm not aware of a good tutorial on cross compiling the library (and I've suffered it in the past).
There are some prebuilt configurations for generic cross compiling. Open Configure and config, and look at some of the triples. (OpenSSL does not use Automake and friends).
If iOS or Android, the OpenSSL wiki has some examples of cross compiling for the platforms. See, for example, FIPS Library and Android. The setenv-android.sh script is most important because it set paths, sysroot and toolchains. Once paths and toolschains are set, the rest is easy.
If you are targeting a generic ARM, then you could use the Android setenv-android.sh as a starting point for your generic build. Once you complete the build, then point OPENSSL_ROOT_DIR into the install directory for ARM.

Resources