Open av4625 opened 2 months ago
This issue does seem to be specifically with just the boost recipe. I reduced my projects dependency on boost to be header only and instead included poco for anything I needed from boost that wasn't header only and I am able to successfully build again. So the problem seems to be building boost libraries only.
I am able to build boost/1.86.0
(header only), nlohmann_json/3.11.3
, sqlitecpp/3.3.1
, poco/1.13.3
and gtest/1.14.0
using the method above including these libraries dependencies. Just not the full boost library.
@av4625 Hello, I believe it could be a misconfiguration. Please, read the example of cross-building in Conan 2.x docs: https://docs.conan.io/2/examples/cross_build/tricore.html
I see you are still using Conan 1.x, but that example should work as well. The key is using the configuration tools.build:compiler_executables
and point the path to your compilers.
Also, consider moving to Conan 2.x when possible. It seems 19 months since its release and Conan 1.x is the way of deprecation.
I will try and give that a go asap.
I currently have cmake-conan incorporated into a fairly big project, which is why I’m stuck on conan 1.x.
I added this to the conan profile:
[conf]
tools.build:compiler_executables={'c': '/usr/local/opt/llvm/bin/clang', 'cpp': '/usr/local/opt/llvm/bin/clang++'}
This didn't help, you can see from the included output that it isn't using the compile flags as it errors saying clang++: warning: unknown platform, assuming -mfloat-abi=soft
and you can see I set it to hard. This is probably why it can't find std headers either as its probably not using -stdlib=libstdc++
.
Description
I am unable to cross compile boost using LLVM clang version 18. I installed LLVM clang using:
When I try to build boost using a separate build and host profile it fails. The header files it can't find are in the sysroot in an expected place.
I am able to build
gtest
andnlohmann_json
using the same command and profiles. Building the dependencies for boost also seems to work fine.I think it might be a linker issue, like it might be using the wrong one or something, or not using the sysroot properly but not sure.
This is the command to build one file using clang as a cross compiler incase this helps.
Package and Environment Details
Conan profile
Build Profile
[settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=apple-clang compiler.libcxx=libc++ compiler.version=14 os=Macos os_build=Macos [options] [build_requires] [env]
Host Profile
[settings] arch=armv7hf arch_build=armv7hf build_type=Release compiler=clang compiler.cppstd=17 compiler.libcxx=libstdc++11 compiler.version=18 os=Linux os_build=Linux [options] [build_requires] [env] AR=/usr/local/opt/llvm/bin/llvm-ar AS=/usr/local/opt/llvm/bin/llvm-as CC=/usr/local/opt/llvm/bin/clang CFLAGS=--target=armv7a-linux-gnueabihf --sysroot=orangepi_sysroot -mfloat-abi=hard -mthumb -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv3 -Wno-psabi -stdlib=libstdc++ -v -fuse-ld=lld CHOST=arm-linux-gnueabihf CONAN_CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY CONAN_CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY CONAN_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY CONAN_CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER CXX=/usr/local/opt/llvm/bin/clang++ CXXFLAGS=--target=armv7a-linux-gnueabihf --sysroot=orangepi_sysroot -mfloat-abi=hard -mthumb -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv3 -Wno-psabi -stdlib=libstdc++ -v -fuse-ld=lld LDFLAGS=-fuse-ld=lld RANLIB=/usr/local/opt/llvm/bin/llvm-ranlib STRIP=/usr/local/opt/llvm/bin/llvm-strip SYSROOT=orangepi_sysroot [buildenv] CHOST=arm-linux-gnueabihf CONAN_CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER CONAN_CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY CONAN_CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY CONAN_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY AR=/usr/local/opt/llvm/bin/llvm-ar AS=/usr/local/opt/llvm/bin/llvm-as RANLIB=/usr/local/opt/llvm/bin/llvm-ranlib LDFLAGS=-fuse-ld=lld STRIP=/usr/local/opt/llvm/bin/llvm-strip CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++ SYSROOT=orangepi_sysroot CFLAGS=--target=armv7a-linux-gnueabihf --sysroot=orangepi_sysroot -mfloat-abi=hard -mthumb -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv3 -Wno-psabi -stdlib=libstdc++ -v -fuse-ld=lld CXXFLAGS=--target=armv7a-linux-gnueabihf --sysroot=orangepi_sysroot -mfloat-abi=hard -mthumb -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv3 -Wno-psabi -stdlib=libstdc++ -v -fuse-ld=lld
I have tried adding this to the host profile as well:
LD=/usr/local/opt/llvm/bin/ld.lld
.I have also tried adding and removing
-fuse-ld=lld
from theC
,CXX
andLD
flags.Steps to reproduce
conan install -r conancenter boost/1.85.0@ -pr:b=default -pr:h=host_profile --update --build missing
Logs
Click to expand log
``` % conan install -r conancenter boost/1.85.0@ -pr:b=default -pr:h=host_profile --update --build missing WARN: ************************************************** WARN: *** Conan 1 is legacy and on a deprecation path ** WARN: *********** Please upgrade to Conan 2 ************ WARN: ************************************************** Configuration (profile_host): [settings] arch=armv7hf arch_build=armv7hf build_type=Release compiler=clang compiler.cppstd=17 compiler.libcxx=libstdc++11 compiler.version=18 os=Linux os_build=Linux [options] [build_requires] [env] AR=/usr/local/opt/llvm/bin/llvm-ar AS=/usr/local/opt/llvm/bin/llvm-as CC=/usr/local/opt/llvm/bin/clang CFLAGS=--target=armv7a-linux-gnueabihf --sysroot=/Users/