Search code examples
conan

Conan, C++ package manager, don't work for boost


I run: conan install Boost/1.64.0@conan/stable, and it fails.
Output:

C:\temp>conan install Boost/1.64.0@conan/stable
Boost/1.64.0@conan/stable: Not found in local cache, looking in remotes...
Boost/1.64.0@conan/stable: Trying with 'bintray'...
Boost/1.64.0@conan/stable: Trying with 'conan.io'...
ERROR: Unable to find 'Boost/1.64.0@conan/stable' in remotes

Trying other package, works:

C:\temp>conan install fmt/4.0.0@bincrafters/stable
fmt/4.0.0@bincrafters/stable: Not found in local cache, looking in remotes...
fmt/4.0.0@bincrafters/stable: Trying with 'bintray'...
fmt/4.0.0@bincrafters/stable: Trying with 'conan.io'...
Downloading conanmanifest.txt
[==================================================] 121B/121B
Downloading conanfile.py
[==================================================] 1.8KB/1.8KB
fmt/4.0.0@bincrafters/stable: Installing package
Requirements
    fmt/4.0.0@bincrafters/stable from conan.io
Packages
    fmt/4.0.0@bincrafters/stable:63da998e3642b50bee33f4449826b2d623661505

fmt/4.0.0@bincrafters/stable: Retrieving package 63da998e3642b50bee33f4449826b2d623661505
fmt/4.0.0@bincrafters/stable: Looking for package 63da998e3642b50bee33f4449826b2d623661505 in remote 'conan.io'
Downloading conanmanifest.txt
[==================================================] 938B/938B
Downloading conaninfo.txt
[==================================================] 491B/491B
Downloading conan_package.tgz
[==================================================] 159.8KB/159.8KB
fmt/4.0.0@bincrafters/stable: Package installed 63da998e3642b50bee33f4449826b2d623661505

Any idea why the package isn't found? How to debug it?


Solution

  • Conan is a decentralized package manager (kind of git-like style), so it can have many remotes. By default it comes configured with 2 remotes:

    • conan-transit: Is a read-only copy of the old conan.io repository, which contains many different Boost packages, from different authors. Quality is variable, so some packages might work only for certain OS, or might fail for some configurations.

    • conan-center: It is a moderated/reviewed repository, package creators can submit inclusion requests to share their packages with the community.

    So far conan-transit contains several Boost/1.64 packages, so can check it with:

    $ conan search Boost* -r=conan-transit
    $ conan search Boost* -r=conan-center
    

    As you can see the package you are trying to install doesn't exist in these repositories.

    As I said above, conan is decentralized, so you can use different remotes. For example, the "bincrafters" community has a bintray repo that can be added with:

    $ conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
    $ conan search Boost* -r=bincrafters
    

    You will see they have a large number of Boost/1.64 packages, because they have created a modularized version of boost, in which every library lives in a different package, so you only get installed what you need.

    UPDATE: Packages in the central repository are being renamed by the community to lowercase. Try with boost lowercase in the above if necessary.