Open Drllap opened 1 year ago
Hi @Drllap
Thanks for your report. It might be possible that some configuration is missing, the profiles for Windows clang might require more information, depending on what clang are you using. I'd recommend reading https://blog.conan.io/2022/10/13/Different-flavors-Clang-compiler-Windows.html, and checking the profiles and information there.
Once the setup is clear, I'd also recommend running it with a simple recipe, like conan new hello/0.1 -m=cmake_lib
, then building it with the specific clang profile, checking the output and the binaries to see if everything is ok, then finally trying with the boost
package. Please let us know, thanks!
Hello @memsharded,
I followed this particular link yesterday (https://blog.conan.io/2022/10/13/Different-flavors-Clang-compiler-Windows.html) but I can't compile boost either. I am using conan 2.0.11. I put all the info in here https://github.com/conan-io/conan-center-index/issues/19941, but I don't know if the error comes from the recipe or from the conan client itself.
There's a few issues with boost & clang-cl, I think. I've hacked this which works for me: https://github.com/lukester1975/conan-center-index/commit/900f3f4afff9725f823d29032b23f64af5fdd9be
May not be PR-worthy but hopefully the experts can take it from there...
My (jinja) clang-cl profile debug:
[settings]
arch=x86_64
build_type=Debug
compiler=clang
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.runtime_version=v143
# MS have a tendency to bump clang version mid VS release. Cope with 15 and 16 in VS2022 here.
compiler.version={{ os.popen("clang-cl --version").read().removeprefix("clang version ").split(".")[0] }}
os=Windows
[conf]
tools.cmake.cmaketoolchain:generator=Visual Studio 17
[buildenv]
# Boost builds via conan will fail without the .exe suffix.
CC=clang-cl.exe
CXX=clang-cl.exe
HTH
@lukester1975 does this:
[conf]
tools.cmake.cmaketoolchain:generator=Visual Studio 17
mean that I need to have VS17 installed?
I tried this with
[conf]
tools.cmake.cmaketoolchain:generator=Visual Studio 19
but then I get an error when conan tries to build bzip2
ERROR: bzip2/1.0.8: Error in generate() method, line 58
tc.generate()
ConanException: CMakeToolchain with compiler=clang and a CMake 'Visual Studio' generator requires VS16 or VS17
Ah, VS and its plethora of version numbers... 17 is 2022, 16 is 2019, 15 is 2017 :)
@memsharded I had a look at the blog post you posted and tested a few things. Basically what I want to do is to compile with the LLVM/Clang option described in the post. I have installed the LLVM from the github page as described, so I now have updated my LLVM:
clang --version
clang version 17.0.5
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
I also updated my conan:
conan --version
Conan version 1.62.0
I also have been experimenting with my clang conan profile. This is what I'm currently using:
[settings]
os=Windows
build_type=Debug
arch=x86
compiler=clang
compiler.version=17
# compiler.cppstd=17
# compiler.runtime=dynamic
# compiler.runtime_type=Release
# compiler.runtime_version=v143
[options]
[build_requires]
[env]
[buildenv]
#PATH=+(path)C:/LLVM-conan-test/bin
#CC=clang.exe
#CXX=clang.exe
[conf]
# tools.env.virtualenv:auto_use=True
tools.cmake.cmaketoolchain:generator=Ninja
# tools.cmake.cmaketoolchain:generator=Visual Studio 16
With it I'm able create test conan packet and compile it, so this workes just fine:
conan new clang_test/1.0.0 -m=cmake_exe
conan create . -pr clang
which outputs this:
clang_test/1.0.0 (test package): Running test()
clang_test/1.0.0: Hello World Debug!
clang_test/1.0.0: _M_IX86 defined
clang_test/1.0.0: __i386__ defined
clang_test/1.0.0: _MSC_VER1929
clang_test/1.0.0: _MSVC_LANG201402
clang_test/1.0.0: __cplusplus201402
clang_test/1.0.0: __clang_major__17
So everything looks fine.
But this still fails:
conan install boost/1.76.0@ -pr=clang --build missing
I attached the output in log.txt
@memsharded For whatever reason the main error message was missing from the log.txt above, so here it is:
boost/1.76.0: ERROR: Package '5d77e285165cd0388d422d68c69a632e3ff8e9fb' build failed
boost/1.76.0: WARN: Build folder C:\.conan\79fe4b\1\build-debug
ERROR: boost/1.76.0: Error in build() method, line 887
self.run(full_command)
ConanException: Error 1 while executing b2 -q numa=on target-os=windows architecture=x86 address-model=32 binary
-format=pe abi=ms --layout=system --user-config=C:\.conan\f63257\1\src\tools\build\user-config.jam -sNO_ZLIB=0 -sNO_BZIP
2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=off --disable-iconv threading=multi vi
sibility=hidden link=static variant=debug --with-atomic --with-chrono --with-container --with-context --with-contract --
with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-jso
n --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serializat
ion --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-wave toolset=clang
-win pch=on linkflags="-stdlib=None" cxxflags="-fPIC -stdlib=None" install --prefix=C:\.conan\fb1d02\1 -j8 --abbreviate-
paths -d0 --debug-configuration --build-dir="C:\.conan\79fe4b\1\build-debug"
Doesn't seem to be a lot of info in it.
Is there a way to get the actual error emit from b2 or clang in the build() method?
Probably linked to https://github.com/conan-io/conan-center-index/pull/18764
Sorry for not being able to follow up on this. Issues with specific recipes in conan-center-index
are typically too much to handle in this repo, which is dedicated to issues in the Conan client, and for those issues, things can be better prioritized if reduced to minimal reproducible cases, not a full recipe from ConanCenter, specially one large as boost.
Environment details
Steps to reproduce
clang
version 16:I call it
ninja
conan install boost/1.76.0@ -pr ninja --build missing
Logs