Open abroun opened 1 month ago
As an update on this I tried modifying the build routine in the libjpeg conanfile https://github.com/conan-io/conan-center-index/blob/master/recipes/libjpeg/all/conanfile.py#L85 to go down the is_msvc branch but didn't have much luck there. The build failed complaining about an error in the generated Visual Studio project though, I'm assuming because it was missing whatever config is required to get it to use clang-cl.
For now I'm working around the issue by switching over to use libjpeg-turbo. It seems that all libraries I use that depend on libjpeg offer the option to use libjpeg-turbo and libjpeg-turbo seems to be much more comfortable with clang-cl as it supports building under CMake.
Could you try https://github.com/conan-io/conan-center-index/pull/24951 please?
Could you try #24951 please?
Hi @SpaceIm, thanks for this. You change looks like a neater version of what I tried. :)
I've pulled your change and run it locally and unfortunately it gives the same error that I got from my change. Logs given below, for some reason it looks like it's not picking up the runtime version correctly. I did try to do a quick diff between the Visual Studio files generated for Clang and the VS files generated for the working MSVC build but I couldn't see a difference. I'm guessing that some change needs to be made to the VS project to get it to use clang-cl but this is where I gave up and ran to libjpeg-turbo instead.
Hi @abroun - thanks for reporting this.
While we look into this, you could try the following to be unblocked - you can try and ask Conan to build libjpeg with msvc instead, by adding the following to your profile file (either at the bottom of the [settings]
section, or in a new [settings]
section. This takes into account the fact that both sets of binaries are designed to be compatible
libjpeg/*:compiler=msvc
libjpeg/*:compiler.version=193
libjpeg/*:compiler.cppstd=20
libjpeg/*:compiler.runtime=static
Alternatively, you can switch to the libjpeg-turbo
implementation, by adding - I'm not 100% it would work but it's worth a shot if the above doesn't.
[replace_requires]
libjpeg/*: libjpeg-turbo/[*]
@abroun Is https://github.com/conan-io/conan-center-index/pull/24951 working better with conan 2.7.0 (it comes with a fix for MSBuild
with ClangCL: https://github.com/conan-io/conan/pull/16844)
@SpaceIm I've just checked with conan 2.7.0 and success!
There are some warnings in the build log about an unused command line argument but the doesn't look serious and the build and install runs to completion. Many thanks for your time on this. :)
Description
I'm trying to build a number of Conan packages on Windows 11 using the Visual Studio provided version of clang-cl.
Currently when I try to build/install libjpeg/9e I get an error about the configure script not being recognised as an internal or external command.
It kind of makes sense to me that it might be tricky to run an autotools configure script on Windows, but the recipe looks like it's had clang-cl support for a number of years now so I'm assuming that there's some dependency missing from my environment?
If anyone can offer some pointers on where I might be going wrong that would be much appreciated.
Package and Environment Details
Conan profile
$ conan profile show Host profile: [settings] arch=x86_64 build_type=Release compiler=clang compiler.cppstd=20 compiler.runtime=static compiler.runtime_type=Release compiler.runtime_version=v143 compiler.version=16 os=Windows [conf] tools.cmake.cmaketoolchain:generator=Visual Studio 17
Build profile: [settings] arch=x86_64 build_type=Release compiler=clang compiler.cppstd=20 compiler.runtime=static compiler.runtime_type=Release compiler.runtime_version=v143 compiler.version=16 os=Windows [conf] tools.cmake.cmaketoolchain:generator=Visual Studio 17
Steps to reproduce
conan install --requires=libjpeg/9e --build=missing
Logs
Click to expand log
``` $ conan install --requires=libjpeg/9e --build=missing ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=clang compiler.cppstd=20 compiler.runtime=static compiler.runtime_type=Release compiler.runtime_version=v143 compiler.version=14 os=Windows [conf] tools.cmake.cmaketoolchain:generator=Visual Studio 17 Profile build: [settings] arch=x86_64 build_type=Release compiler=clang compiler.cppstd=20 compiler.runtime=static compiler.runtime_type=Release compiler.runtime_version=v143 compiler.version=14 os=Windows [conf] tools.cmake.cmaketoolchain:generator=Visual Studio 17 ======== Computing dependency graph ======== Graph root cli Requirements libjpeg/9e#3cd27a78643419450ee6d3739514d25c - Cache ======== Computing necessary packages ======== Requirements libjpeg/9e#3cd27a78643419450ee6d3739514d25c:5801404749bad56b48c9ff047552212a819ec2cb - Build ======== Installing packages ======== -------- Installing package libjpeg/9e (1 of 1) -------- libjpeg/9e: Building from source libjpeg/9e: Package libjpeg/9e:5801404749bad56b48c9ff047552212a819ec2cb libjpeg/9e: Copying sources to build folder libjpeg/9e: Building your package in C:\Users\Alan\.conan2\p\b\libjp44a64de55eff5\b libjpeg/9e: Calling generate() libjpeg/9e: Generators folder: C:\Users\Alan\.conan2\p\b\libjp44a64de55eff5\b\build-release\conan libjpeg/9e: Generating aggregated env files libjpeg/9e: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat'] libjpeg/9e: Calling build() libjpeg/9e: Apply patch (portability): Add support to generate DLL on Windows libjpeg/9e: RUN: "C:\Users\Alan\.conan2\p\b\libjp44a64de55eff5\b\src/configure" --disable-shared --enable-static --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.3 [vcvarsall.bat] Environment initialized for: 'x64' '"C:\Users\Alan\.conan2\p\b\libjp44a64de55eff5\b\src/configure"' is not recognized as an internal or external command, operable program or batch file. libjpeg/9e: ERROR: Package '5801404749bad56b48c9ff047552212a819ec2cb' build failed libjpeg/9e: WARN: Build folder C:\Users\Alan\.conan2\p\b\libjp44a64de55eff5\b\build-release ERROR: libjpeg/9e: Error in build() method, line 146 autotools.configure() ConanException: Error 1 while executing ```