Hello great minds of stackoverflow. My project builds Boost via a CMake ExternalProject_Add command. The b2 build command is as follows:
b2 -j${num_processors} -d 0 --layout=versioned threading=multi architecture=x86 address-model=64 link=shared --with-system --with-thread --with-date_time --with-chrono --with-atomic variant=${config_type} --prefix=${UNRELEVANT_PATH} --stagedir=${UNRELEVANT_PATH} install stage
num_processors, config_type, and UNRELEVANT_PATH are CMake variables for the number of cores on the build machine, build variant type, and paths for installation. This command works for Boost 1.62 using gcc 4.8.1 and Visual Studio 2015. We're now upgrading to Boost 1.72.0 and it is failing with this error on both compilers:
Performing configuration checks
- default address-model : 64-bit
- default architecture : x86
- lockfree boost::atomic_flag : yes
error: Name clash for '<p/my/path/to/boost/lib/cmake/boost_atomic-1.72.0>boost_atomic-config.cmake'
error:
error: Tried to build the target twice, with property sets having
error: these incompatible properties:
error:
error: - none
error: - none
error:
error: Please make sure to have consistent requirements for these
error: properties everywhere in your project, especially for install
error: targets.
I've done nothing but replace the source files for boost from 1.62 to 1.72.0. I couldn't find any relevant differences in the b2 documentation between those versions. Did I miss something?
I've tried removing the --with-atomic flag and it just fails on the next library with the same error. I've tried different options for --layout, threading, and architecture with no luck. Any suggestions on what I should investigate further to resolve this?
Apparently I've been doing it wrong this whole time. You shouldn't set --prefix and --stagedir to the same location. Previous iterations of boost don't seem to care about this issue. One of the later versions started caring which caused my problem.
Related
I'm trying to compile the MySQL Connector/C++ 8.0.12 using gcc-8.1.0 and cmake 3.6.2, since the apt package seems to be compiled for gcc-4.9 and crashes when used with gcc-8.1.0 compiled programs (but works with gcc-4.9 compiled programs).
From the MySQL Documentation:
Even a small change in the compiler version can cause problems. If you obtain error messages that you suspect are related to binary incompatibilities, build Connector/C++ from source, using the same compiler and linker that you use to build and link your application.
When I try to build the connector from source as described here:
git clone https://github.com/mysql/mysql-connector-cpp.git
mkdir cppconn
cd cppconn
cmake /home/pi/mysql-connector-cpp
# Everything looks fine except for:
Protobuf include path: /home/pi/mysql-connector-cpp/cdk/protobuf/protobuf-2.6.1/src
...
-- Performing Test HAVE_IS_SAME - Failed
cmake --build . --target install --config Debug
# All lot of warings come up and then:
Scanning dependencies of target protobuf
...
[ 34%] Building CXX object CMakeFiles/protobuf.dir/protobuf-2.6.1/src/google/protobuf/text_format.cc.o
In file included from /home/pi/mysql-connector-cpp/cdk/protobuf/protobuf-2.6.1/src/google/protobuf/text_format.cc:37:
/usr/bin/gcc-8.1.0/include/c++/8.1.0/math.h:65:12: error: ‘constexpr bool std::isinf(double)’ conflicts with a previous declaration
using std::isinf;
^~~~~
In file included from /usr/include/features.h:374,
from /usr/bin/gcc-8.1.0/include/c++/8.1.0/arm-linux-gnueabihf/bits/os_defines.h:39,
from /usr/bin/gcc-8.1.0/include/c++/8.1.0/arm-linux-gnueabihf/bits/c++config.h:508,
from /usr/bin/gcc-8.1.0/include/c++/8.1.0/utility:68,
from /usr/bin/gcc-8.1.0/include/c++/8.1.0/algorithm:60,
from /home/pi/mysql-connector-cpp/cdk/protobuf/protobuf-2.6.1/src/google/protobuf/text_format.cc:35:
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:201:1: note: previous declaration ‘int isinf(double)’
__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
^~~~~~~~~~~~
In file included from /home/pi/mysql-connector-cpp/cdk/protobuf/protobuf-2.6.1/src/google/protobuf/text_format.cc:37:
/usr/bin/gcc-8.1.0/include/c++/8.1.0/math.h:66:12: error: ‘constexpr bool std::isnan(double)’ conflicts with a previous declaration
using std::isnan;
^~~~~
In file included from /usr/include/features.h:374,
from /usr/bin/gcc-8.1.0/include/c++/8.1.0/arm-linux-gnueabihf/bits/os_defines.h:39,
from /usr/bin/gcc-8.1.0/include/c++/8.1.0/arm-linux-gnueabihf/bits/c++config.h:508,
from /usr/bin/gcc-8.1.0/include/c++/8.1.0/utility:68,
from /usr/bin/gcc-8.1.0/include/c++/8.1.0/algorithm:60,
from /home/pi/mysql-connector-cpp/cdk/protobuf/protobuf-2.6.1/src/google/protobuf/text_format.cc:35:
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:234:1: note: previous declaration ‘int isnan(double)’
__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
The requirements stated by the documentation:
A C++ compiler that supports C++11. In case of gcc it must be at least version 4.8. These compilers have been tested: gcc 4.8.5, 5.4.0, 6.3.0, 6.3.1, 7.2.1, 7.3.0, 8.1.1, clang 9.0.0, MS Visual Studio 2015. (present ~ 8.1.0)
CMake 2.8.12 or later. (present - 3.6.2)
Boost 1.59 or later if the version of the C++ standard library used does not implement the UTF8 converter (codecvt_utf8). Boost is also required when building the legacy connector (see below). (libstdc++.so.6.0.25 supports codecvt_utf8 to my knowledge)
OpenSSL version 1.0.x if connector is built with OpenSSL. Instead of OpenSSL the Connector/C++ can be build using WolfSSL 3.14.0 or newer. (present - 1.0.1)
MySQL 8.0 client library if building the legacy connector (see below). (not necessary)
Additional information:
using a Raspberry Pi 2b running Raspbian
libstdc++ version is 6.0.25
Protobuf version seems to be 2.6.1 (to be build)
Thanks in advance. -Minding
The solution was to install gcc properly using this command:
cp -a gcc-*version*/bin/. /usr/bin/
cp -a gcc-*version*/lib/. /usr/lib/
# ... (for all sub directories)
Which just copies all files of the source folder to the destination folder.
Thanks to #Matthieu Brucher for telling me that I installed it wrong and how to install it properly.
I'm stuck trying to install Boost (1.55) on Windows 10 (pro)
I have been following the instructions here link
And I'm not sure what is supposed to happen at/after this stage:
C:\Users\Sak09\Downloads\boost_1_55_0\boost_1_55_0\tools\build\v2>b2 --build-dir="C:\Boost\" toolset=msvc --build-type= complete stage
warning: the --build-dir option was specified
warning: but Jamroot at '.'
warning: specified no project id
warning: the --build-dir option will be ignored
warning: No toolsets are configured.
warning: Configuring default toolset "msvc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
...found 580 targets...
C:\Users\Sak09\Downloads\boost_1_55_0\boost_1_55_0\tools\build\v2>b2 toolset=msvc --build-type=complete stage
notice: could not find main target stage
notice: assuming it is a name of file to create.
don't know how to make <e>stage
...found 1 target...
...can't find 1 target...
C:\Users\Sak09\Downloads\boost_1_55_0\boost_1_55_0\tools\build\v2>b2 --build-type=complete msvc stage
warning: No toolsets are configured.
warning: Configuring default toolset "msvc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
notice: could not find main target stage
notice: assuming it is a name of file to create.
don't know how to make <e>stage
...found 1 target...
...can't find 1 target...
Any help is very much appreciated. I'm trying to setup dev stuff in Windows after a decade and I'm really struggling with this.
Tried the same instructions with Boost version 1.60 and it just worked. So yeah some compatibility issue with VS2017 and older versions of Boost. Thanks everyone for the suggestioons.
I'm receiving the following error message when attempting to build VLC:
checking for mad_bit_init in -lmad... yes
checking for MPG123... yes
checking for libavutil variant... libav
checking for GST_APP... yes
checking for GST_VIDEO... yes
checking for AVCODEC... no
configure: error: Requested 'libavcodec >= 57.16.0' but version of libavcodec is 56.1.0. Pass --disable-avcodec to ignore this error.
I am running the command (first step of Configuration from link below, I did the contrib method and built everything else as well):
./configure
So let's get the obvious out of the way: I'm missing the most recent version of libavcodec (v57). Using --disable-avcodec is not a viable solution. Doing a quick apt-file search libavcodec I'm seeing that for debian/jessie the latest version published is libavcodec56, not 57. I did also notice that libavcodec57 was available for installation with ffmpeg here https://ffmpeg.org/download.html
I actually needed to also build ffmpeg from source. So I did that, worked my way through the dependencies without too much trouble using the guide linked to below.
So here is my issue: After building and doing a make install of ffmpeg, I still get that error above, despite having the latest libavcodec freshly compiled.
So my question is: since I used that guide, I am still getting the error when building vlc. I see that the lib exists her: /root/ffmpeg_build/lib/libavcodec.a, and I figured make install would put it where it needs to be. Is there some other compile flag I can set while compiling vlc to point it to that lib directory to look for libavcodec?
ffmpeg build: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
vlc build: https://wiki.videolan.org/UnixCompile/
UPDATE: tried this, still getting the error message: PKG_CONFIG_PATH="/root/ffmpeg_build/lib:$PKG_CONFIG_PATH" LD_LIBRARY_PATH="/root/ffmpeg_build/lib:$LD_LIBRARY_PATH" ./configure
UPDATE2: tried this, still getting the error message: ./configure --libdir="/root/ffmpeg_build/lib:$LIBDIR"
UPDATE3: I tried merging my ffmpeg libs into my vlc libs and may have made things worse. My ffmpeg libs lived here: /root/ffmpeg_build/lib
My vlc build (contrib builds as well) lived here: /opt/vlc/
So I merged them with my existing vlc contrib lib:
cp /root/ffmpeg_build/lib/* /opt/vlc/contrib/x86_64-linux-gnu/lib/
cp /root/ffmpeg_build/lib/pkgconfig/* /opt/vlc/contrib/x86_64-linux-gnu/lib/pkgconfig/
Then ran configure:
./configure --with-contrib=contrib/x86_64-linux-gnu
Which finally worked, but now I get this error when I try to make:
Now I get the error:
/usr/bin/ld: /opt/vlc/contrib/x86_64-linux-gnu/lib/libavformat.a(allformats.o): relocation R_X86_64_32 against `ff_a64_muxer' can not be used when making a shared object; recompile with -fPIC
I have an issue with Codelite compilation, running on raspbian jessie - these are the (known) steps I have taken to produce it.
First I installed Codelite with apt-get install Codelite, then produced a c++ project.
When running build project I get the error:
/bin/sh -c ' -j 4 -e -f Makefile'
/bin/sh: 1: -j: not found
0 errors, 0 warnings
I note that this error has been found and corrected previously, through running a different version of Codelite from 6.1.1 (that which apt-get installs). I therefore found the updated version of armhf .deb codelite from the rasbian archive with gdebi-gtk. However the updated version (9.1.1) produces the following error (install attempt with the graphical debian):
Error: Dependency is not satisfiable: libclang 1-3.8 (>=3.2)
I do not understand why the package manager cannot update these packages - do they not exist for the pi? I ran the manager as root, so I do not think it is a permissions issue.
EDIT 1:
Thank you for that Fabre. My Enviromental Variables file now looks like this:
CodeLiteDir=/usr/share/codelite
export MAKE=make
I still get the same error however.
I am attempting to build the Boost library from Homebrew. I am using layout=system to get an untagged build (based on this stackoverflow post), but the build does not go through. The error message is as follows:
error: Name clash for '<p/usr/local/Cellar/boost/1.58.0/lib>libboost_system.dylib'
error:
error: Tried to build the target twice, with property sets having
error: these incompatible properties:
error:
error: - <threading>multi
error: - <threading>single
error:
error: Please make sure to have consistent requirements for these
error: properties everywhere in your project, especially for install
error: targets.
Here is a link to the homebrew generated gist. Thank you in advance.
I created an issue on the Homebrew repository and was quickly assisted. I needed to use the option --without-single.
brew reinstall boost --build-from-source --without-single