Boost Build runtime-link incompatible properties - c++

I am trying to re-build the boost libraries on a debian 10 64 bit system I have built boost 1.72 before, but am trying to revert back to 1.62 and am getting this error when attempting to compile.
error: Name clash for '<p/usr/local/lib>libboost_system.a'
error:
error: Tried to build the target twice, with property sets having
error: these incompatible properties:
error:
error: - <runtime-link>static
error: - <runtime-link>shared
error:
error: Please make sure to have consistent requirements for these
error: properties everywhere in your project, especially for install
error: targets.
I am attempting to compile with the following options:
./bootstrap.sh --show-libraries --with-libraries=system,log,program_options,filesystem,chrono,regex,thread,date_time,atomic
./b2 install --clean-all -a warnings=all toolset=gcc link=static threading=multi runtime-link=static --build-dir=Build stage -d+2 --hash cxxflags=-fvisibility=hidden variant=release cxxflags=-fPIC cxxflags=-std=c++14 -sNO_BZIP2=1 || true
I have run a search for libboost_system.a it does not exist on the system, I am not setting the runtime-link property elsewhere.
Any help would be greatly appreciated.

Related

Cross compiling boost for Arm (armhf) fails with unknown in module "warnings-feature"

Following the Boost "Cross-compilation" instructions here,
Having already run bootstrap.sh, and created a local, native b2.
And using a user-config.jam of:
using gcc : arm :arm-linux-gnueabihf-g++ ;
Kicking off the build:
./b2 toolset=gcc-arm target-os=linux
Boost's b2 spits out a bunch of error messages, and halts:
username#ubuntu:~/Code/boost_1_81_0$ ./b2 toolset=gcc-arm target-os=linux
/home/username/Code/boost_1_81_0/tools/build/src/util/numbers.jam:23: in numbers.check from module numbers
error: arm in arm
error: is not a number
/home/username/Code/boost_1_81_0/tools/build/src/build/version.jam:110: in version.version-compatible from module version
/home/username/Code/boost_1_81_0/tools/build/src/tools/common.jam:1132: in common.find-compiler from module common
/home/username/Code/boost_1_81_0/tools/build/src/tools/gcc.jam:165: in gcc.init from module gcc
/home/username/Code/boost_1_81_0/tools/build/src/build/toolset.jam:44: in toolset.using from module toolset
/home/username/Code/boost_1_81_0/tools/build/src/build-system.jam:543: in process-explicit-toolset-requests from module build-system
/home/username/Code/boost_1_81_0/tools/build/src/build-system.jam:610: in load from module build-system
/home/username/Code/boost_1_81_0/tools/build/src/kernel/modules.jam:294: in import from module modules
/home/username/Code/boost_1_81_0/tools/build/src/kernel/bootstrap.jam:135: in module scope from module
Obviously it doesn't expect the values the instructions suggest.
Is there any way forward ?
I am not sure about what exactly went wrong, but a complete, working procedure for cross-compiling boost for arm-linux-gnueabihf on Ubuntu 22.04 would be:
# Retrieve/install cross-compiler.
wget https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz
tar Jxf arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz
export CROSS_COMPILE=$(pwd)/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
# Retrieve/install boost source code.
wget https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
tar jxf boost_1_81_0.tar.bz2
# Build boost
cd boost_1_81_0
echo "using gcc : arm : ${CROSS_COMPILE}g++ ;" > user_config.jam
./bootstrap.sh --prefix=$(pwd)/boost-1.81.0-arm-none-linux-gnueabihf
./b2 install toolset=gcc-arm link=static cxxflags=-fPIC --with-filesystem --with-test --with-log --with-program_options -j32 --user-config=user_config.jam
After the compilation ends, the compilation artifacts should reside in directory boost_1_81_0/boost-1.81.0-arm-none-linux-gnueabihf.

CMake unable to find a build program corresponding to "Ninja"

I have MacOS Catalina, Cmake, Ninja and QtCreator installed with the following versions and paths:
[#bin]$ sw_vers -productVersion
10.15.6
[#bin]$ which cmake
/usr/local/bin/cmake
[#bin]$ cmake --version
cmake version 3.18.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
[#bin]$ which ninja
/usr/local/bin/ninja
I'm trying to build a project with QT creator using Cmake. However, the following message appears in QT Creator
Running /usr/local/Cellar/cmake/3.18.2/bin/cmake '-GCodeBlocks - Ninja' -C /private/var/folders/jq/yyp9q2fs1z5780k9l1_2ph4r0000gn/T/QtCreator-HXderc/qtc-cmake-TuClFWan/qtcsettings.cmake /Users/mymac/Documents/programming/Cpp/Qt/try6 in /private/var/folders/jq/yyp9q2fs1z5780k9l1_2ph4r0000gn/T/QtCreator-HXderc/qtc-cmake-TuClFWan.
loading initial cache file /private/var/folders/jq/yyp9q2fs1z5780k9l1_2ph4r0000gn/T/QtCreator-HXderc/qtc-cmake-TuClFWan/qtcsettings.cmake
-- Configuring incomplete, errors occurred!
See also "/private/var/folders/jq/yyp9q2fs1z5780k9l1_2ph4r0000gn/T/QtCreator-HXderc/qtc-cmake-TuClFWan/CMakeFiles/CMakeOutput.log".
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake process exited with exit code 1.
Elapsed time: 00:00.
As indicated on several websites (such as this SO question I tried the following command but it didn't work:
[#bin]$ ln -s /usr/bin/ninja /usr/bin/ninja-build
ln: /usr/bin/ninja-build: Operation not permitted
As indicated in the comments I tried also the following:
[#bin]$ sudo ln -s /usr/bin/ninja /usr/bin/ninja-build
Password:
ln: /usr/bin/ninja-build: Operation not permitted
I also tried:
[#bin]$ sudo ln -s /usr/bin/ninja /usr/local/bin/ninja-build
It didn't cause any error message but the problem in QT creator persisted

Failed to build FileMQ, "cannot link with -lczmq", czmq is installed already

I am getting this error:
configure: error: cannot link with -lczmq, install libczmq.
on doing ./configure && make check.
I have installed libzmq, czmq and libsodium right before compilation, so it's the latest from repo.
How can I fix it?

Building 32bit version of libtorrent on osx using boost with python bindings

I'm running the following build command from the /bindings/python directory of libtorrent
./bjam boost=system link=static address-model=32 toolset=darwin architecture=x86 release
But I'm getting the following errors
/opt/local/include/boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory
/opt/local/include/boost/python/detail/wrap_python.hpp:75:24: error: patchlevel.h: No such file or directory
/opt/local/include/boost/python/detail/wrap_python.hpp:78:2: error: #error Python 2.2 or higher is required for this version of Boost.Python.
/opt/local/include/boost/python/detail/wrap_python.hpp:142:21: error: Python.h: No such file or directory
Finally resulting in
...failed darwin.compile.c++ bin/darwin-4.2.1/release/address-model-32/architecture-x86/link-static/src/module.o..
Can anyone point to where I'm getting messed up?
The stupid question: Do you have python intalled? And if you do have it installed, but not in a standard place, you must tell bjam where to find it.
Oh, and was boost built with python support?

Cross compiling boost for m68k using bjam

Using the docs, I run:
$ echo "using gcc : m68k : /opt/freescale/usr/local/gcc-4.2.125-eglibc-2.5.125/m68k-linux/bin/m68k-linux-gnu-g++ ;" > tools/build/v2/user-config.jam
$ ./bootstrap.sh
$ ./bjam -d2 --toolset=gcc-m68k '-sBUILD=release static multi/single' link=static --prefix=/home/damann/coldfire/boost --layout=system --with-filesystem --with-system --with-thread --with-serialization --with-date_time install
Which gives the following errors:
error: toolset gcc initialization:
error: version 'm68k' requested but 'g++-m68k' not found and version '4.4.3' of default 'g++' does not match
error: initialized from
/home/damann/boost_1_48_0/tools/build/v2/build/toolset.jam:38: in toolset.using from module toolset
/home/damann/boost_1_48_0/tools/build/v2/build-system.jam:481: in process-explicit-toolset-requests from module build-system
/home/damann/boost_1_48_0/tools/build/v2/build-system.jam:562: in load from module build-system
/home/damann/boost_1_48_0/tools/build/v2/kernel/modules.jam:283: in import from module modules
/home/damann/boost_1_48_0/tools/build/v2/kernel/bootstrap.jam:142: in boost-build from module
/home/damann/boost_1_48_0/boost-build.jam:17: in module scope from module
It seems that the user-config is being ignored, although it is read (see it during --debug-configuration)
Discovered that (at least on Linux) bjam also looks for a user-config.jam in the user's homedir - and I had one (that I had forgotten from an earlier build) - so that one was overriding my efforts.