conan icon indicating copy to clipboard operation
conan copied to clipboard

[question] Download binary with different compiler setting

Open NetVince opened this issue 9 months ago • 31 comments

What is your question?

Hello,

In my custom profile, I use the intel-cc compiler. Is it still possible to download binary compiled with gcc ? I tried to use the compatibility() method but without success.

Thank you

Have you read the CONTRIBUTING guide?

  • [ ] I've read the CONTRIBUTING guide

NetVince avatar Jun 11 '25 09:06 NetVince

Hi @NetVince

Yes, if you want to implement a general compatibility policy between intel-cc and gcc, the recommended way would be the compatibility.py plugin, not the method.

If you want just to force the use of a binary built with gcc for a specific package, just go with the per-package settings in your profile:

[settings]
compiler=intel-cc
compiler.version=xx
...
mypkg/*:compiler=gcc
mypkg/*:compiler.version=14

If you really want to implement it in the compatibility() method for that specific package, please share what you tried, it should be something in the line:

def compatibility(self):
    if self.settings.compiler == "intel-cc":
        gcc_fallback = {"settings": [("compiler", "gcc"), ("compiler.version", "14"), ("compiler.libcxx", ...]}
        return [gcc_fallback]

Note that you need to define the gcc details, once the compiler is redefined, all the subsettings need to be defined too.

memsharded avatar Jun 11 '25 09:06 memsharded

Ok thanks, and how it would look like if I make changes in compatibility.py ?

NetVince avatar Jun 11 '25 12:06 NetVince

The mechanism and definition is almost the same, just defined externally to conanfiles, in a compatibility.py file that you put in the cache (and can be shared and distributed with conan config install/install-pkg). See https://docs.conan.io/2/reference/extensions/binary_compatibility.html for details about this plugin file.

memsharded avatar Jun 11 '25 12:06 memsharded

How can I install requirements with a different configuration than my actual profile ? Let's say I have 2 profiles, one with gcc and other one with intel-cc. How can I install requirements compiled with intel-cc when using gcc profile ?

NetVince avatar Jun 11 '25 13:06 NetVince

If you want to explicitly specify the compiler for specific packages, using the above syntax:

[settings]
compiler=intel-cc
compiler.version=xx
...
mypkg/*:compiler=gcc
mypkg/*:compiler.version=14

You can use the & placeholder to use a specific configuration for your current project, and a different one for the rest:

compiler=intel-cc
compiler.version=xx
...
&:compiler=gcc
&:compiler.version=14

memsharded avatar Jun 11 '25 14:06 memsharded

I get this message error when trying to make "conan build .". I only have log4cxx/0.13.0 in my requires() function : log4cxx/0.13.0: Invalid: intel-cc 2024.0 does not support C++17: False required. And here is my profile :

[settings]
arch=x86_64
build_type=Release
compiler=intel-cc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.mode=dpcpp
compiler.version=2024.0
os=Linux
&:compiler=gcc
&:compiler.cppstd=17
&:compiler.libcxx=libstdc++11
&:compiler.version=11

NetVince avatar Jun 12 '25 07:06 NetVince

Which Conan version? Which log4cxx, the one from ConanCenter? Can you please share the full output of your command? (hint, use triple backticks to format correctly, not single backticks)

memsharded avatar Jun 12 '25 07:06 memsharded

Conan version : 2.16.1 It's not the one from ConanCenter, it comes from a mirroring repo on our own network. Its recipe :

  log4cxx
    log4cxx/0.13.0
      revisions
        17125f787ce5c94a02f2f3910baad66f (2024-06-11 08:50:09 UTC)
          packages
            70415a0b9a06fac36a90052c3233044afc897f32
              info
                settings
                  os: Linux
                  compiler.libcxx: libstdc++11
                  arch: x86_64
                  compiler: gcc
                  build_type: Release
                  compiler.cppstd: 17
                  compiler.version: 11
                options
                  shared: True
                  char_type: utf-8
                  with_odbc_appender: False
                  with_wchar_t: False
                  with_qt: False
                  char_encoding: utf-8
                requires
                recipe_hash: 

And here is the output of conan build . :


======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=intel-cc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.mode=dpcpp
compiler.version=2024.0
os=Linux
&:compiler=gcc
&:compiler.cppstd=17
&:compiler.libcxx=libstdc++11
&:compiler.version=11
[conf]
tools.intel:installation_path=/opt/intel/oneapi
[buildenv]
CC=icx
CXX=icpx -fsycl

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=intel-cc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.mode=dpcpp
compiler.version=2024.0
os=Linux
&:compiler=gcc
&:compiler.cppstd=17
&:compiler.libcxx=libstdc++11
&:compiler.version=11
[conf]
tools.intel:installation_path=/opt/intel/oneapi
[buildenv]
CC=icx
CXX=icpx -fsycl


======== Computing dependency graph ========
Graph root
    conanfile.py (conan_practice/2.1.0): 
Requirements
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860 - Cache
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e - Cache
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57 - Cache
    hello/3.0.1#083e8898222c1d01ac96a9e80650b364 - Cache
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache
    log4cxx/0.13.0#17125f787ce5c94a02f2f3910baad66f - Cache
Build requirements
    meson/1.2.2#21b73818ba96d9eea465b310b5bbc993 - Cache
    ninja/1.12.1#fd583651bf0c6a901943495d49878803 - Cache
    pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache
Resolved version ranges
    expat/[>=2.6.2 <3]: expat/2.6.3
    hello/[>=1.0]: hello/3.0.1
    ninja/[>=1.10.2 <2]: ninja/1.12.1

======== Computing necessary packages ========
Connecting to remote 'conan-center-virtual' with user 'X'
log4cxx/0.13.0: Version 0.13.0 requires C++17. log4cxx version 1.x does not.
Requirements
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e:aed24db2bf716277ae0bbaba16ff6ea67f872fb4 - Missing
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860:2d52ed2ff6bf3a664171923e00618dd7dd4ea117 - Missing
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57:7d269654710a4505823557996a5b6609ae6e5cd6 - Missing
    hello/3.0.1#083e8898222c1d01ac96a9e80650b364:096bb0201244b217c9ead22f0e404ca1770e461e#d02ac11cb9ed14698640bf609ad98fcc - Cache
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd:31445c16f7e88440224f6954252379f5c6997c9e - Missing
    log4cxx/0.13.0#17125f787ce5c94a02f2f3910baad66f:6156376cd05a02b25fab84d72ddfd20de0faf0a3 - Invalid
Build requirements
Skipped binaries
    meson/1.2.2, ninja/1.12.1, pkgconf/2.0.3
ERROR: There are invalid packages:
log4cxx/0.13.0: Invalid: intel-cc 2024.0 does not support C++17: False required.

NetVince avatar Jun 12 '25 07:06 NetVince

I see.

It's not the one from ConanCenter, it comes from a mirroring repo on our own network.

You are running with an old, no longer maintained version of log4cxx. You can see the maintained versions starts with 1.2.0 in https://github.com/conan-io/conan-center-index/blob/master/recipes/log4cxx/config.yml, so it seems your repo got a bit out of sync.

Those older versions are still accessible in ConanCenter to not break previously existing users that depended on them, but are discouraged for new users. If you still need to use that 0.13.0 version, you might need to backport the changes in the upstream to your old recipe.

memsharded avatar Jun 12 '25 08:06 memsharded

Ok but I try to use log4cxx/1.2.0 and still have issue with settings :

conan graph explain --requires=log4cxx/1.2.0

======== Computing dependency graph ========
Graph root
    cli
Requirements
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860 - Cache
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e - Cache
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57 - Cache
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5 - Cache
Build requirements
    meson/1.2.2#21b73818ba96d9eea465b310b5bbc993 - Cache
    ninja/1.12.1#fd583651bf0c6a901943495d49878803 - Cache
    pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache
Resolved version ranges
    expat/[>=2.6.2 <3]: expat/2.6.3
    ninja/[>=1.10.2 <2]: ninja/1.12.1

======== Computing necessary packages ========
Connecting to remote 'conan-center-virtual' with user 'X'
Requirements
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e:aed24db2bf716277ae0bbaba16ff6ea67f872fb4 - Missing
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860:2d52ed2ff6bf3a664171923e00618dd7dd4ea117 - Missing
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57:7d269654710a4505823557996a5b6609ae6e5cd6 - Missing
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd:31445c16f7e88440224f6954252379f5c6997c9e - Missing
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5:0548e2331aa0131a5a92e68ae976e987bf544417#68ccf0f19840410cf794cde9fc706181 - Cache
Build requirements
Skipped binaries
    meson/1.2.2, ninja/1.12.1, pkgconf/2.0.3

======== Retrieving and computing closest binaries ========
Missing binary: apr/1.7.4
With conaninfo.txt (package_id):
[settings]
arch=x86_64
build_type=Release
compiler=intel-cc
compiler.mode=dpcpp
compiler.version=2024.0
os=Linux
[options]
fPIC=True
force_apr_uuid=True
shared=False

Finding binaries in the cache
Finding binaries in remote conan-center-virtual

======== Closest binaries ========
apr/1.7.4
  apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860%1719238843.335 (2024-06-24 14:20:43 UTC)
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860:a3878c3a91b0694fb10e1fabbab29301948b5c69
      remote: conan-center-virtual
      settings: Linux, x86_64, Release, gcc, 11
      options: shared=False, force_apr_uuid=True, fPIC=True
      diff
        settings
          expected: compiler=intel-cc, compiler.mode=dpcpp, compiler.version=2024.0
          existing: compiler=gcc, compiler.mode=None, compiler.version=11
        explanation: This binary was built with different settings.

And I use the previous profile

NetVince avatar Jun 12 '25 08:06 NetVince

Now you have a missing binary message, that is totally expected, as there is no pre-compiled binary for intel-cc, you need to build the binary for that intel-cc and upload it to your server repo.

The diff explains it:

 diff
        settings
          expected: compiler=intel-cc, compiler.mode=dpcpp, compiler.version=2024.0
          existing: compiler=gcc, compiler.mode=None, compiler.version=11
        explanation: This binary was built with different settings.

You have a binary built with gcc, but you are requesting a binary built with intel-cc, that you don't have, you need to build it first.

memsharded avatar Jun 12 '25 08:06 memsharded

Unfortunately, I can't build it. No access to internet on my network. There is no way to tell Conan that packages compiled with GCC are compatible with my profile Intell-CC ?

NetVince avatar Jun 12 '25 08:06 NetVince

Unfortunately, I can't build it. No access to internet on my network. There is no way to tell Conan that packages compiled with GCC are compatible with my profile Intell-CC ?

I don't understand what you are trying to do. As explained above, yes, there are several mechanisms to tell Conan to use packages built with intel-cc in a project that is using gcc and the other way around, it is possible to use packages built with gcc in a project that is using intel-cc, as long as you can guarantee the respective compiler versions are also binary compatible.

It is just that if you want to use a binary of log4cxx built with intel-cc, you need to build that binary, in the same way you build the one for gcc. You can tell it is compatible, but you need to build it from source in the first place, isn't it?. I don't know what we are missing here. Maybe you want it the other way around, you want to use intel-cc for your consumer project while using dependencies built with gcc? that is the opposite of what you said above and trying to do with that profile

[settings]
compiler=intel-cc
&:compiler=gcc

this means my current compiler of my current consumer project is gcc, but I want to use my dependencies built with intel-cc. So I expect dependencies like log4cxx to have been previously built with intel-cc. Is this what you want to do?

memsharded avatar Jun 12 '25 09:06 memsharded

Yeah, the idea is to use intel-cc for my consumer project while using dependencies built with gcc 👍 So, I have to change my profile and invert gcc and intel-cc ?

NetVince avatar Jun 12 '25 09:06 NetVince

Yes, exactly, it seems you want the other way round:

  • Dependencies with gcc
  • Your own consumer with intel-cc.

That is represented by the opposite:

[settings]
compiler=gcc
compiler.version=14
...
&:compiler=intel-cc
&:compiler.version=2024.X
...

The & means the "current consumer project"

memsharded avatar Jun 12 '25 09:06 memsharded

And is it possible to have dependencies from both compiler ? I want to have current consumer project as intel-cc but my dependencies can be from gcc or intel-cc.

NetVince avatar Jun 12 '25 11:06 NetVince

Yes, you can either explicitly tell in the profile:

[settings]
compiler=gcc
compiler.version=14
...
dep1/*:compiler=intel-cc
dep1/*:compiler.version=2024.X
...
&:compiler=intel-cc
&:compiler.version=2024.X
...

(Note, there are mechanisms to write this in a more compact and maintainable form, like using jinja2 syntax in the profile that allows to write for loops, even functions, etc.

Or you can define the compatibility implicitly in the compatibility.py plugin, defining fallback compatibility from intel-cc to gcc and/or viceversa.

memsharded avatar Jun 12 '25 13:06 memsharded

In my conanfile.py, in my requirements() function, I need to dependencies :

self.requires("log4cxx/1.2.0")    # official lib from conan-center compiled witg GCC

The problem is log4cxx has dependencies also compiled with GCC. What should I modifiy to tell Conan that requirements can be either from GCC or intell-CC. I don't want to tell explicitly which packages are compiled with one or the other. Because I have a main project with subrepo having each one their own conanfile.py. The idea is really to have the most generic configuration so each subrepo act the same.

Thank you

NetVince avatar Jun 16 '25 07:06 NetVince

The problem is log4cxx has dependencies also compiled with GCC. What should I modifiy to tell Conan that requirements can be either from GCC or intell-CC.

The recommended way to define a general binary compatibility between two compilers would be to use the compatibility.py plugin:

  • https://docs.conan.io/2/reference/extensions/binary_compatibility.html#binary-compatibility
  • It works like the compatibility() method in https://docs.conan.io/2/reference/conanfile/methods/compatibility.html#reference-conanfile-methods-compatibility, but for all packages

memsharded avatar Jun 16 '25 07:06 memsharded

Thank you, it works better with the compatibilty.py plugin. But, I still have issue with my package log4cxx/1.2.0. With conan graph explain --requires=log4cxx/1.2.0 I got this :

======== Computing dependency graph ========
Graph root
    conanfile.py (conan_practice/2.1.0): /conanfile.py
Requirements
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860 - Cache
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e - Cache
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57 - Cache
    hello/3.0.1#083e8898222c1d01ac96a9e80650b364 - Cache
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5 - Cache
Build requirements
    meson/1.2.2#21b73818ba96d9eea465b310b5bbc993 - Cache
    ninja/1.12.1#fd583651bf0c6a901943495d49878803 - Cache
    pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache
Resolved version ranges
    expat/[>=2.6.2 <3]: expat/2.6.3
    hello/[>=1.0]: hello/3.0.1
    ninja/[>=1.10.2 <2]: ninja/1.12.1

======== Computing necessary packages ========
Connecting to remote 'remote1' with user 'X'
Connecting to remote 'remote2' with user 'X'
apr/1.7.4: Main binary package '2d52ed2ff6bf3a664171923e00618dd7dd4ea117' missing
apr/1.7.4: Checking 1 compatible configurations
apr/1.7.4: Compatible configurations not found in cache, checking servers
apr/1.7.4: 'a3878c3a91b0694fb10e1fabbab29301948b5c69': compiler=gcc, compiler.version=11
apr/1.7.4: Found compatible package 'a3878c3a91b0694fb10e1fabbab29301948b5c69': compiler=gcc, compiler.version=11
expat/2.6.3: Main binary package '7d269654710a4505823557996a5b6609ae6e5cd6' missing
expat/2.6.3: Checking 1 compatible configurations
expat/2.6.3: Compatible configurations not found in cache, checking servers
expat/2.6.3: '2ed03cd8691ea01deb11f88b5c95aa5195ec4816': compiler=gcc, compiler.version=11
expat/2.6.3: Found compatible package '2ed03cd8691ea01deb11f88b5c95aa5195ec4816': compiler=gcc, compiler.version=11
libiconv/1.17: Main binary package '31445c16f7e88440224f6954252379f5c6997c9e' missing
libiconv/1.17: Checking 1 compatible configurations
libiconv/1.17: Compatible configurations not found in cache, checking servers
libiconv/1.17: 'b647c43bfefae3f830561ca202b6cfd935b56205': compiler=gcc, compiler.version=11
libiconv/1.17: Found compatible package 'b647c43bfefae3f830561ca202b6cfd935b56205': compiler=gcc, compiler.version=11
apr-util/1.6.1: Main binary package 'aed24db2bf716277ae0bbaba16ff6ea67f872fb4' missing
apr-util/1.6.1: Checking 1 compatible configurations
apr-util/1.6.1: Compatible configurations not found in cache, checking servers
apr-util/1.6.1: '83165f0d565ef301e0d06e46419334dde522e4f4': compiler=gcc, compiler.version=11
apr-util/1.6.1: Found compatible package '83165f0d565ef301e0d06e46419334dde522e4f4': compiler=gcc, compiler.version=11
log4cxx/1.2.0: WARN: No cppstd compatibility defined for compiler "intel-cc"
Requirements
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e:83165f0d565ef301e0d06e46419334dde522e4f4#6557dee43a730b347a5d096375ecadd1 - Download (remote2)
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860:a3878c3a91b0694fb10e1fabbab29301948b5c69#d3a9509e5ee34bb2fa674355019e9c86 - Download (remote2)
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57:2ed03cd8691ea01deb11f88b5c95aa5195ec4816#aa46c81dfa3c479a103db9c64430bbf6 - Download (remote2)
    hello/3.0.1#083e8898222c1d01ac96a9e80650b364:096bb0201244b217c9ead22f0e404ca1770e461e#d02ac11cb9ed14698640bf609ad98fcc - Download (remote1)
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd:b647c43bfefae3f830561ca202b6cfd935b56205#4fd44fefea7c20a6b0f1826c2b875a8c - Download (remote2)
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5:8a11e77f0f0da24f8ed75210c59c6faf28291dc8 - Missing
Build requirements
Skipped binaries
    meson/1.2.2, ninja/1.12.1, pkgconf/2.0.3

======== Retrieving and computing closest binaries ========
Missing binary: log4cxx/1.2.0
With conaninfo.txt (package_id):
[settings]
arch=x86_64
build_type=Release
compiler=intel-cc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.mode=dpcpp
compiler.version=2024.0
os=Linux
[options]
char_encoding=utf-8
char_type=utf-8
fPIC=True
shared=False
with_fmt_layout=False
with_multiprocess_rolling_file_appender=False
with_networking=True
with_odbc_appender=False
with_qt=False
with_smtp_appender=False
with_wchar_t=False
[requires]
apr-util/1.6.Z
apr/1.7.Z
expat/2.6.Z
libiconv/1.17.Z

Finding binaries in the cache
Finding binaries in remote remote1
ERROR: Error in remote 'remote1': Recipe not found: _/log4cxx/1.2.0/_. [Remote: remote1]
Finding binaries in remote remote2

======== Closest binaries ========
log4cxx/1.2.0
  log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5%1718095809.231 (2024-06-11 08:50:09 UTC)
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5:0548e2331aa0131a5a92e68ae976e987bf544417
      remote: remote2
      settings: Linux, x86_64, Release, gcc, libstdc++11, 17, 11
      options(diff): 
      diff
        settings
          expected: compiler=intel-cc, compiler.cppstd=gnu14, compiler.mode=dpcpp, compiler.version=2024.0
          existing: compiler=gcc, compiler.cppstd=17, compiler.mode=None, compiler.version=11
        dependencies
          expected: apr-util/1.6.Z, apr/1.7.Z, expat/2.6.Z, libiconv/1.17.Z
          existing: None, None, None, None
        explanation: This binary was built with different settings.

How can I still get my log4cxx package ?

NetVince avatar Jun 17 '25 12:06 NetVince

log4cxx/1.2.0: WARN: No cppstd compatibility defined for compiler "intel-cc"

settings expected: compiler=intel-cc, compiler.cppstd=gnu14, compiler.mode=dpcpp, compiler.version=2024.0 existing: compiler=gcc, compiler.cppstd=17, compiler.mode=None, compiler.version=11 dependencies expected: apr-util/1.6.Z, apr/1.7.Z, expat/2.6.Z, libiconv/1.17.Z existing: None, None, None, None

It seems your compatibility.py is not covering the intel-cc => gcc fallback compatibility. Please share your compatibility.py.

memsharded avatar Jun 17 '25 12:06 memsharded

Here it is :

    # By default, different compiler.cppstd are compatible
    # factors is a list of lists
    factors = cppstd_compat(conanfile)

    # MSVC 194->193 fallback compatibility
    compiler = conanfile.settings.get_safe("compiler")
    compiler_version = conanfile.settings.get_safe("compiler.version")
    if compiler == "msvc":
        msvc_fallback = {"194": "193"}.get(compiler_version)
        if msvc_fallback:
            factors.append([{"compiler.version": msvc_fallback}])

    # Append more factors for your custom compatibility rules here
    if conanfile.settings.compiler == "intel-cc" :
            gcc_fallback = {"settings":[("compiler","gcc"),("compiler.cppstd","17"),("compiler.version","11")]}
            return [gcc_fallback]
    # Combine factors to compute all possible configurations
    combinations = _factors_combinations(factors)
    # Final compatibility settings combinations to check
    return [{"settings": [(k, v) for k, v in comb.items()]} for comb in combinations] ```
It's the only function I changed

NetVince avatar Jun 17 '25 13:06 NetVince

existing: None, None, None, None

It seems your existing log4cxx has something broken regarding the dependencies information. Not sure if you created the package with some special package_id_mode that you removed later or something like that, but the fact that the existing binary doesn't depend on any of the dependencies versions is not looking correct.

memsharded avatar Jun 17 '25 13:06 memsharded

But why I'm able to download the package if I use my default profile which is compiler=gcc ? I have no problem with conan graph explain with my profile default.

NetVince avatar Jun 17 '25 14:06 NetVince

But why I'm able to download the package if I use my default profile which is compiler=gcc ? I have no problem with conan graph explain with my profile default.

But that is not the profile you are reporting above. In your profile above, I can see:

compiler=intel-cc

Please provide the details for:

  • The exact command that you are using
  • The full output of that command
  • If there are missing binaries, the conan graph explain for that command
  • The full conan list log4cxx/1.2.0:* (using -r=myremote if your binaries are in a server) output

memsharded avatar Jun 18 '25 08:06 memsharded

Yeah, but I tried with an other profile too. Anyway with my current intel-cc profile :

 > conan build .

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=intel-cc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.mode=dpcpp
compiler.version=2024.0
os=Linux
[conf]
tools.intel:installation_path=/opt/intel/oneapi
[buildenv]
CC=icx
CXX=icpx -fsycl

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=intel-cc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.mode=dpcpp
compiler.version=2024.0
os=Linux
[conf]
tools.intel:installation_path=/opt/intel/oneapi
[buildenv]
CC=icx
CXX=icpx -fsycl


======== Computing dependency graph ========
Connecting to remote 'remote1' with user 'X'
hello/3.0.1: Not found in local cache, looking in remotes...
hello/3.0.1: Checking remote: remote1
hello/3.0.1: Downloaded recipe revision 083e8898222c1d01ac96a9e80650b364
log4cxx/1.2.0: Not found in local cache, looking in remotes...
log4cxx/1.2.0: Checking remote: remote1
log4cxx/1.2.0: Checking remote: remote2
Connecting to remote 'remote2' with user 'X'
log4cxx/1.2.0: Downloaded recipe revision 95be70abf50d3c18e43b56697a2acdd5
apr/1.7.4: Not found in local cache, looking in remotes...
apr/1.7.4: Checking remote: remote1
apr/1.7.4: Checking remote: remote2
apr/1.7.4: Downloaded recipe revision 393fa2a2b547ac6297b0374b6d31f860
apr-util/1.6.1: Not found in local cache, looking in remotes...
apr-util/1.6.1: Checking remote: remote1
apr-util/1.6.1: Checking remote: remote2
apr-util/1.6.1: Downloaded recipe revision f80d0e3100c59089a52612f2b25b7d1e
libiconv/1.17: Not found in local cache, looking in remotes...
libiconv/1.17: Checking remote: remote1
libiconv/1.17: Checking remote: remote2
libiconv/1.17: Downloaded recipe revision 73fefc1b696e069df90fd1d18aa63edd
expat/2.6.3: Not found in local cache, looking in remotes...
expat/2.6.3: Checking remote: remote1
expat/2.6.3: Checking remote: remote2
expat/2.6.3: Downloaded recipe revision 39b80d3109fbe578fddfe4951f0b1d57
pkgconf/2.0.3: Not found in local cache, looking in remotes...
pkgconf/2.0.3: Checking remote: remote1
pkgconf/2.0.3: Checking remote: remote2
pkgconf/2.0.3: Downloaded recipe revision f996677e96e61e6552d85e83756c328b
meson/1.2.2: Not found in local cache, looking in remotes...
meson/1.2.2: Checking remote: remote1
meson/1.2.2: Checking remote: remote2
meson/1.2.2: Downloaded recipe revision 21b73818ba96d9eea465b310b5bbc993
ninja/1.12.1: Not found in local cache, looking in remotes...
ninja/1.12.1: Checking remote: remote1
ninja/1.12.1: Checking remote: remote2
ninja/1.12.1: Downloaded recipe revision fd583651bf0c6a901943495d49878803
Graph root
    conanfile.py (conan_practice/2.1.0): /conan_practice/conanfile.py
Requirements
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860 - Downloaded (remote2)
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e - Downloaded (remote2)
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57 - Downloaded (remote2)
    hello/3.0.1#083e8898222c1d01ac96a9e80650b364 - Downloaded (remote1)
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Downloaded (remote2)
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5 - Downloaded (remote2)
Build requirements
    meson/1.2.2#21b73818ba96d9eea465b310b5bbc993 - Downloaded (remote2)
    ninja/1.12.1#fd583651bf0c6a901943495d49878803 - Downloaded (remote2)
    pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Downloaded (remote2)
Resolved version ranges
    expat/[>=2.6.2 <3]: expat/2.6.3
    hello/[>=1.0]: hello/3.0.1
    ninja/[>=1.10.2 <2]: ninja/1.12.1

======== Computing necessary packages ========
apr/1.7.4: Main binary package '2d52ed2ff6bf3a664171923e00618dd7dd4ea117' missing
apr/1.7.4: Checking 1 compatible configurations
apr/1.7.4: Compatible configurations not found in cache, checking servers
apr/1.7.4: 'a3878c3a91b0694fb10e1fabbab29301948b5c69': compiler=gcc, compiler.version=11
apr/1.7.4: Found compatible package 'a3878c3a91b0694fb10e1fabbab29301948b5c69': compiler=gcc, compiler.version=11
expat/2.6.3: Main binary package '7d269654710a4505823557996a5b6609ae6e5cd6' missing
expat/2.6.3: Checking 1 compatible configurations
expat/2.6.3: Compatible configurations not found in cache, checking servers
expat/2.6.3: '2ed03cd8691ea01deb11f88b5c95aa5195ec4816': compiler=gcc, compiler.version=11
expat/2.6.3: Found compatible package '2ed03cd8691ea01deb11f88b5c95aa5195ec4816': compiler=gcc, compiler.version=11
libiconv/1.17: Main binary package '31445c16f7e88440224f6954252379f5c6997c9e' missing
libiconv/1.17: Checking 1 compatible configurations
libiconv/1.17: Compatible configurations not found in cache, checking servers
libiconv/1.17: 'b647c43bfefae3f830561ca202b6cfd935b56205': compiler=gcc, compiler.version=11
libiconv/1.17: Found compatible package 'b647c43bfefae3f830561ca202b6cfd935b56205': compiler=gcc, compiler.version=11
apr-util/1.6.1: Main binary package 'aed24db2bf716277ae0bbaba16ff6ea67f872fb4' missing
apr-util/1.6.1: Checking 1 compatible configurations
apr-util/1.6.1: Compatible configurations not found in cache, checking servers
apr-util/1.6.1: '83165f0d565ef301e0d06e46419334dde522e4f4': compiler=gcc, compiler.version=11
apr-util/1.6.1: Found compatible package '83165f0d565ef301e0d06e46419334dde522e4f4': compiler=gcc, compiler.version=11
log4cxx/1.2.0: WARN: No cppstd compatibility defined for compiler "intel-cc"
Requirements
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e:83165f0d565ef301e0d06e46419334dde522e4f4#6557dee43a730b347a5d096375ecadd1 - Download (remote2)
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860:a3878c3a91b0694fb10e1fabbab29301948b5c69#d3a9509e5ee34bb2fa674355019e9c86 - Download (remote2)
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57:2ed03cd8691ea01deb11f88b5c95aa5195ec4816#aa46c81dfa3c479a103db9c64430bbf6 - Download (remote2)
    hello/3.0.1#083e8898222c1d01ac96a9e80650b364:096bb0201244b217c9ead22f0e404ca1770e461e#d02ac11cb9ed14698640bf609ad98fcc - Download (remote1)
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd:b647c43bfefae3f830561ca202b6cfd935b56205#4fd44fefea7c20a6b0f1826c2b875a8c - Download (remote2)
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5:8a11e77f0f0da24f8ed75210c59c6faf28291dc8 - Missing
Build requirements
Skipped binaries
    meson/1.2.2, ninja/1.12.1, pkgconf/2.0.3
ERROR: Missing binary: log4cxx/1.2.0:8a11e77f0f0da24f8ed75210c59c6faf28291dc8

log4cxx/1.2.0: WARN: Can't find a 'log4cxx/1.2.0' package binary '8a11e77f0f0da24f8ed75210c59c6faf28291dc8' for the configuration:
[settings]
arch=x86_64
build_type=Release
compiler=intel-cc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.mode=dpcpp
compiler.version=2024.0
os=Linux
[options]
char_encoding=utf-8
char_type=utf-8
fPIC=True
shared=False
with_fmt_layout=False
with_multiprocess_rolling_file_appender=False
with_networking=True
with_odbc_appender=False
with_qt=False
with_smtp_appender=False
with_wchar_t=False
[requires]
apr-util/1.6.Z
apr/1.7.Z
expat/2.6.Z
libiconv/1.17.Z

ERROR: Missing prebuilt package for 'log4cxx/1.2.0'. You can try:
    - List all available packages using 'conan list "log4cxx/1.2.0:*" -r=remote'
    - Explain missing binaries: replace 'conan install ...' with 'conan graph explain ...'
    - Try to build locally from sources using the '--build=log4cxx/1.2.0' argument

More Info at 'https://docs.conan.io/2/knowledge/faq.html#error-missing-prebuilt-package'

Then, I use conan graph explain :

 > conan graph explain .

======== Computing dependency graph ========
Graph root
    conanfile.py (conan_practice/2.1.0): conan_practice/conanfile.py
Requirements
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860 - Cache
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e - Cache
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57 - Cache
    hello/3.0.1#083e8898222c1d01ac96a9e80650b364 - Cache
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5 - Cache
Build requirements
    meson/1.2.2#21b73818ba96d9eea465b310b5bbc993 - Cache
    ninja/1.12.1#fd583651bf0c6a901943495d49878803 - Cache
    pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache
Resolved version ranges
    expat/[>=2.6.2 <3]: expat/2.6.3
    hello/[>=1.0]: hello/3.0.1
    ninja/[>=1.10.2 <2]: ninja/1.12.1

======== Computing necessary packages ========
Connecting to remote 'remote1' with user 'X'
Connecting to remote 'remote2' with user 'X'
apr/1.7.4: Main binary package '2d52ed2ff6bf3a664171923e00618dd7dd4ea117' missing
apr/1.7.4: Checking 1 compatible configurations
apr/1.7.4: Compatible configurations not found in cache, checking servers
apr/1.7.4: 'a3878c3a91b0694fb10e1fabbab29301948b5c69': compiler=gcc, compiler.version=11
apr/1.7.4: Found compatible package 'a3878c3a91b0694fb10e1fabbab29301948b5c69': compiler=gcc, compiler.version=11
expat/2.6.3: Main binary package '7d269654710a4505823557996a5b6609ae6e5cd6' missing
expat/2.6.3: Checking 1 compatible configurations
expat/2.6.3: Compatible configurations not found in cache, checking servers
expat/2.6.3: '2ed03cd8691ea01deb11f88b5c95aa5195ec4816': compiler=gcc, compiler.version=11
expat/2.6.3: Found compatible package '2ed03cd8691ea01deb11f88b5c95aa5195ec4816': compiler=gcc, compiler.version=11
libiconv/1.17: Main binary package '31445c16f7e88440224f6954252379f5c6997c9e' missing
libiconv/1.17: Checking 1 compatible configurations
libiconv/1.17: Compatible configurations not found in cache, checking servers
libiconv/1.17: 'b647c43bfefae3f830561ca202b6cfd935b56205': compiler=gcc, compiler.version=11
libiconv/1.17: Found compatible package 'b647c43bfefae3f830561ca202b6cfd935b56205': compiler=gcc, compiler.version=11
apr-util/1.6.1: Main binary package 'aed24db2bf716277ae0bbaba16ff6ea67f872fb4' missing
apr-util/1.6.1: Checking 1 compatible configurations
apr-util/1.6.1: Compatible configurations not found in cache, checking servers
apr-util/1.6.1: '83165f0d565ef301e0d06e46419334dde522e4f4': compiler=gcc, compiler.version=11
apr-util/1.6.1: Found compatible package '83165f0d565ef301e0d06e46419334dde522e4f4': compiler=gcc, compiler.version=11
log4cxx/1.2.0: WARN: No cppstd compatibility defined for compiler "intel-cc"
Requirements
    apr-util/1.6.1#f80d0e3100c59089a52612f2b25b7d1e:83165f0d565ef301e0d06e46419334dde522e4f4#6557dee43a730b347a5d096375ecadd1 - Download (remote2)
    apr/1.7.4#393fa2a2b547ac6297b0374b6d31f860:a3878c3a91b0694fb10e1fabbab29301948b5c69#d3a9509e5ee34bb2fa674355019e9c86 - Download (remote2)
    expat/2.6.3#39b80d3109fbe578fddfe4951f0b1d57:2ed03cd8691ea01deb11f88b5c95aa5195ec4816#aa46c81dfa3c479a103db9c64430bbf6 - Download (remote2)
    hello/3.0.1#083e8898222c1d01ac96a9e80650b364:096bb0201244b217c9ead22f0e404ca1770e461e#d02ac11cb9ed14698640bf609ad98fcc - Download (remote1)
    libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd:b647c43bfefae3f830561ca202b6cfd935b56205#4fd44fefea7c20a6b0f1826c2b875a8c - Download (remote2)
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5:8a11e77f0f0da24f8ed75210c59c6faf28291dc8 - Missing
Build requirements
Skipped binaries
    meson/1.2.2, ninja/1.12.1, pkgconf/2.0.3

======== Retrieving and computing closest binaries ========
Missing binary: log4cxx/1.2.0
With conaninfo.txt (package_id):
[settings]
arch=x86_64
build_type=Release
compiler=intel-cc
compiler.cppstd=gnu14
compiler.libcxx=libstdc++11
compiler.mode=dpcpp
compiler.version=2024.0
os=Linux
[options]
char_encoding=utf-8
char_type=utf-8
fPIC=True
shared=False
with_fmt_layout=False
with_multiprocess_rolling_file_appender=False
with_networking=True
with_odbc_appender=False
with_qt=False
with_smtp_appender=False
with_wchar_t=False
[requires]
apr-util/1.6.Z
apr/1.7.Z
expat/2.6.Z
libiconv/1.17.Z

Finding binaries in the cache
Finding binaries in remote remote1
ERROR: Error in remote 'remote1': Recipe not found: _/log4cxx/1.2.0/_. [Remote: remote1]
Finding binaries in remote remote2

======== Closest binaries ========
log4cxx/1.2.0
  log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5%1718095809.231 (2024-06-11 08:50:09 UTC)
    log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5:0548e2331aa0131a5a92e68ae976e987bf544417
      remote: remote2
      settings: Linux, x86_64, Release, gcc, libstdc++11, 17, 11
      options(diff): 
      diff
        settings
          expected: compiler=intel-cc, compiler.cppstd=gnu14, compiler.mode=dpcpp, compiler.version=2024.0
          existing: compiler=gcc, compiler.cppstd=17, compiler.mode=None, compiler.version=11
        dependencies
          expected: apr-util/1.6.Z, apr/1.7.Z, expat/2.6.Z, libiconv/1.17.Z
          existing: None, None, None, None
        explanation: This binary was built with different settings.

And finally conan list :

Connecting to remote 'remote2' with user 'X'
remote2
  log4cxx
    log4cxx/1.2.0
      revisions
        95be70abf50d3c18e43b56697a2acdd5 (2024-06-11 08:50:09 UTC)
          packages
            67b172f77d42a821579a4d5438281874f87eab59
              info
                settings
                  os: Linux
                  compiler.libcxx: libstdc++11
                  arch: x86_64
                  compiler: gcc
                  build_type: Release
                  compiler.cppstd: 17
                  compiler.version: 11
                options
                  with_networking: True
                  shared: True
                  char_type: utf-8
                  with_multiprocess_rolling_file_appender: False
                  with_odbc_appender: False
                  with_wchar_t: False
                  with_qt: False
                  char_encoding: utf-8
                  with_fmt_layout: False
                  with_smtp_appender: False
                requires
                recipe_hash: 
            d480fe6dc12514162961f183351176394d75a5fb
              info
                settings
                  os: Windows
                  compiler.runtime_type: Release
                  compiler.runtime: dynamic
                  arch: x86_64
                  compiler: msvc
                  build_type: Release
                  compiler.cppstd: 14
                  compiler.version: 192
                options
                  with_networking: True
                  shared: False
                  char_type: utf-8
                  with_multiprocess_rolling_file_appender: False
                  with_odbc_appender: False
                  with_wchar_t: False
                  with_qt: False
                  char_encoding: utf-8
                  with_fmt_layout: False
                requires
                recipe_hash: 
            0a2e543a6ffe9d70439ec9460a85487dec92dce2
              info
                settings
                  os: Macos
                  compiler.libcxx: libc++
                  arch: armv8
                  compiler: apple-clang
                  build_type: Release
                  compiler.cppstd: 17
                  compiler.version: 13
                options
                  with_networking: True
                  shared: False
                  char_type: utf-8
                  with_multiprocess_rolling_file_appender: False
                  with_odbc_appender: False
                  with_wchar_t: False
                  with_qt: False
                  char_encoding: utf-8
                  fPIC: True
                  with_fmt_layout: False
                  with_smtp_appender: False
                requires
                recipe_hash: 
            317310caec217f8bbec02c2e6efe93321172e66d
              info
                settings
                  os: Macos
                  compiler.libcxx: libc++
                  arch: armv8
                  compiler: apple-clang
                  build_type: Release
                  compiler.cppstd: 17
                  compiler.version: 13
                options
                  with_networking: True
                  shared: True
                  char_type: utf-8
                  with_multiprocess_rolling_file_appender: False
                  with_odbc_appender: False
                  with_wchar_t: False
                  with_qt: False
                  char_encoding: utf-8
                  with_fmt_layout: False
                  with_smtp_appender: False
                requires
                recipe_hash: 
            7b2577ae29ffba15d7082db4387542ee85412761
              info
                settings
                  os: Windows
                  compiler.runtime_type: Release
                  compiler.runtime: dynamic
                  arch: x86_64
                  compiler: msvc
                  build_type: Release
                  compiler.cppstd: 14
                  compiler.version: 192
                options
                  with_networking: True
                  shared: True
                  char_type: utf-8
                  with_multiprocess_rolling_file_appender: False
                  with_odbc_appender: False
                  with_wchar_t: False
                  with_qt: False
                  char_encoding: utf-8
                  with_fmt_layout: False
                requires
                recipe_hash: 
            4e5aa3e886f030aae11c7b6abcadf14f34995ea4
              info
                settings
                  os: Windows
                  compiler.runtime_type: Release
                  compiler.runtime: dynamic
                  arch: x86_64
                  compiler: msvc
                  build_type: Release
                  compiler.cppstd: 14
                  compiler.version: 193
                options
                  with_networking: True
                  shared: False
                  char_type: utf-8
                  with_multiprocess_rolling_file_appender: False
                  with_odbc_appender: False
                  with_wchar_t: False
                  with_qt: False
                  char_encoding: utf-8
                  with_fmt_layout: False
                requires
                recipe_hash: 
            af6aa8953d65ed9868cb7bc9f629bdac090f020f
              info
                settings
                  os: Windows
                  compiler.runtime_type: Release
                  compiler.runtime: dynamic
                  arch: x86_64
                  compiler: msvc
                  build_type: Release
                  compiler.cppstd: 14
                  compiler.version: 193
                options
                  with_networking: True
                  shared: True
                  char_type: utf-8
                  with_multiprocess_rolling_file_appender: False
                  with_odbc_appender: False
                  with_wchar_t: False
                  with_qt: False
                  char_encoding: utf-8
                  with_fmt_layout: False
                requires
                recipe_hash: 
            0548e2331aa0131a5a92e68ae976e987bf544417
              info
                settings
                  os: Linux
                  compiler.libcxx: libstdc++11
                  arch: x86_64
                  compiler: gcc
                  build_type: Release
                  compiler.cppstd: 17
                  compiler.version: 11
                options
                  with_networking: True
                  shared: False
                  char_type: utf-8
                  with_multiprocess_rolling_file_appender: False
                  with_odbc_appender: False
                  with_wchar_t: False
                  with_qt: False
                  char_encoding: utf-8
                  fPIC: True
                  with_fmt_layout: False
                  with_smtp_appender: False
                requires
                recipe_hash: 

Thank you for your help

NetVince avatar Jun 18 '25 08:06 NetVince

I am very confused about one thing:

recipe_hash: d480fe6dc12514162961f183351176394d75a5fb

This recipe_hash is quite a legacy Conan 1.X thing. It shouldn't be there.

Also your settings are:

settings
os: Windows
compiler.runtime_type: Release
compiler.runtime: dynamic
arch: x86_64
compiler: msvc
build_type: Release
compiler.cppstd: 14
compiler.version: 193

They should be in alphabetical order.

Could you please confirm that you are using the latest Conan 2.17 version?

Is it possible that you are using quite an old server version? Could you please provide details about your server version? Have you done any manipulation to the conaninfo.txt files?

If you can please share with me the contents of the conaninfo.txt file of

log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5:67b172f77d42a821579a4d5438281874f87eab59

You might be able to download it directly from the server or downloading the package:

$ conan download log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5:67b172f77d42a821579a4d5438281874f87eab59
$ conan cache path log4cxx/1.2.0#95be70abf50d3c18e43b56697a2acdd5:67b172f77d42a821579a4d5438281874f87eab59
<package-folder>

then inside that folder, read the conaninfo.txt.

Then, regarding the issue with the compatibility.py it seems your definition is not complete:

 if conanfile.settings.compiler == "intel-cc" :
            gcc_fallback = {"settings":[("compiler","gcc"),("compiler.cppstd","17"),("compiler.version","11")]}
            return [gcc_fallback]

but you can see the existing binary has:

os: Linux
compiler.libcxx: libstdc++11
arch: x86_64
compiler: gcc
build_type: Release
compiler.cppstd: 17
compiler.version: 11

That means that you are missing the definition of compiler.libcxx too in your compatibility.py

memsharded avatar Jun 18 '25 10:06 memsharded

Yes I'm using Conan version 2.16.1. No I didn't change the conaninfo.txt. I tried to find it, but there is no conaninfo.txt in my package

NetVince avatar Jun 18 '25 12:06 NetVince

I tried to find it, but there is no conaninfo.txt in my package

All package binaries must have a conaninfo.txt inside them, otherwise they are broken

memsharded avatar Jun 18 '25 12:06 memsharded

I found it :

[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
[options]
char_encoding=utf-8
char_type=utf-8
shared=True
with_fmt_layout=False
with_multiprocess_rolling_file_appender=False
with_networking=True
with_odbc_appender=False
with_qt=False
with_smtp_appender=False
with_wchar_t=False
[requires]
apr-util/1.6.Z
apr/1.7.Z
libiconv/1.17.Z 

NetVince avatar Jun 18 '25 12:06 NetVince