Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Is there any way to get Conan to work with gcc 10? #6538

Closed
1 task done
tjwrona opened this issue Feb 13, 2020 · 12 comments · Fixed by #6551
Closed
1 task done

[question] Is there any way to get Conan to work with gcc 10? #6538

tjwrona opened this issue Feb 13, 2020 · 12 comments · Fixed by #6551

Comments

@tjwrona
Copy link

tjwrona commented Feb 13, 2020

I'm trying to upgrade a library I'm working on to use gcc 10 (which is technically not released yet) because I need some of the new C++20 features that aren't available in older versions of gcc. When I try to use Conan to get the dependencies I get an error saying that the compiler is not recognized. Is there any way to get Conan to work with gcc 10 besides waiting until it is officially supported?

This is the error I get if I try:

-- Conan: Automatic detection of conan settings from cmake
-- Conan: Settings= -s;build_type=Debug;-s;compiler=gcc;-s;compiler.version=10;-s;compiler.libcxx=libstdc++11
-- Conan executing: conan install /home/tim/Documents/git-repos/cpp-dsp/conanfile.txt -s build_type=Debug -s compiler=gcc -s compiler.version=10 -s compiler.libcxx=libstdc++11 -g=cmake --build=missing
ERROR: Invalid setting '10' is not a valid 'settings.compiler.version' value.
Possible values are ['4.1', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5', '5.1', '5.2', '5.3', '5.4', '5.5', '6', '6.1', '6.2', '6.3', '6.4', '7', '7.1', '7.2', '7.3', '7.4', '8', '8.1', '8.2', '8.3', '9', '9.1', '9.2']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
@tjwrona
Copy link
Author

tjwrona commented Feb 13, 2020

Actually it looks like I can just add version 10 in my "~/.conan/settings.yml" file, but even after doing that I'm getting errors with the conan install. It seems like there may still be a bug in here making it think that it should look for "1" instead of "10" during the install.

ERROR: Invalid setting '1' is not a valid 'settings.compiler.version' value.
Possible values are ['10', '4.1', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5', '5.1', '5.2', '5.3', '5.4', '5.5', '6', '6.1', '6.2', '6.3', '6.4', '7', '7.1', '7.2', '7.3', '7.4', '8', '8.1', '8.2', '8.3', '9', '9.1', '9.2']

@jgsogo
Copy link
Contributor

jgsogo commented Feb 13, 2020

Hi, @tjwrona1992

You did it right, adding it to your settings.yml should be enough (note.- if you are using build-helpers that translate settings to compiler flags, or tools, you may need to modify them in order to take into account new default, interface changes,... until we add official support for it)

From the log "Automatic detection of conan settings from cmake" I infer you are using Conan through the conan-cmake integration (https://github.com/conan-io/cmake-conan) so, maybe, the bug (it should read version 10, not 1) is on that project.

Can you run a conan install <reference> --profile=<your/gcc/10/profile> in the command line? If that works, then the issue should be in cmake-conan.

Thanks

@tjwrona
Copy link
Author

tjwrona commented Feb 13, 2020

@jgsogo, the error saying "Invalid setting '1'" occurs when I run conan install directly from the command line and bypass conan-cmake so I don't think the error is occurring within conan-cmake

@jgsogo
Copy link
Contributor

jgsogo commented Feb 14, 2020

I'm trying to reproduce the error, but it works in my machine:

conan.conf

image

Create a very simple conanfile:

⇒  conan new name/version -b  

And run a create command:

⇒  conan create . -s os=Linux -s compiler=gcc -s compiler.version=10 -s compiler.libcxx=libstdc++11 
Exporting package recipe
name/version: A new conanfile.py version was exported
name/version: Folder: /Users/jgsogo/.conan/data/name/version/_/_/export
name/version: Exported revision: f272c9de17e436b6e6f2ab871d6192da
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=10
os=Linux
os_build=Macos
[options]
[build_requires]
[env]

name/version: Forced build from source
Installing package: name/version
Requirements
    name/version from local cache - Cache
Packages
    name/version:73468d6cd433312abe58cd86e0da983f5d6f13ce - Build
...

Are you running anything different?

Thanks!

@tjwrona
Copy link
Author

tjwrona commented Feb 14, 2020

@jgsogo I was trying to compile one of my personal projects that uses Conan to grab a dependency on "GTest"

https://github.com/tnt-coders/cpp-dsp

This can compile with any C++17 compatible compiler, but I'm trying to use gcc10 to have the ability to use some C++20 features.

In addition to Conan this project has a dependency on CMake v14.0 or higher (Although if you don't run the "cmake" commands and just do the conan install you may be able to reproduce the issue without it)

The process I went through was:

  1. Build and install gcc10
  2. Build and install CMake v3.16.4
  3. Install Conan
  4. clone the git repo for my project
  5. Add "10" as a valid gcc version in "~/.conan/settings.yml"
  6. try to run conan install for the project
mkdir build
cd build
conan install ..

@tjwrona
Copy link
Author

tjwrona commented Feb 14, 2020

@jgsogo it's also worth mentioning that after I added "1" as a valid compiler it did work, and then I removed the "1" and it continued to work. So it likely requires a full reinstall of Conan (or clearing of all local data) in order to reproduce the issue.

@jgsogo
Copy link
Contributor

jgsogo commented Feb 14, 2020

What Conan version are you using (conan --version)?

@jgsogo
Copy link
Contributor

jgsogo commented Feb 14, 2020

Can you copy/paste here the full log you get? It will help me to know in which step you are getting the failure. Thanks!

@tjwrona
Copy link
Author

tjwrona commented Feb 14, 2020

I will have to see if I can get the same behavior when I get home. I will try uninstalling Conan and reinstalling it then building the project again to see if it triggers the same error. I am using the latest stable version (whatever pip install conan gets you as of a day or so ago)

@tjwrona
Copy link
Author

tjwrona commented Feb 15, 2020

After uninstalling and reinstalling Conan I was able to reproduce the error. The full error message is:

$ conan install ..
WARN: Migration: Updating settings.yml
Migration: Settings already up to date
ERROR: Invalid setting '1' is not a valid 'settings.compiler.version' value.
Possible values are ['10', '4.1', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5', '5.1', '5.2', '5.3', '5.4', '5.5', '6', '6.1', '6.2', '6.3', '6.4', '7', '7.1', '7.2', '7.3', '7.4', '8', '8.1', '8.2', '8.3', '9', '9.1', '9.2']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"

Unfortunately it doesn't provide much more info than you had before :(

@jgsogo
Copy link
Contributor

jgsogo commented Feb 17, 2020

Hi, what do you have in your default profile (conan profile show default)? (That one is the profile Conan uses if no argument is given)

@memsharded
Copy link
Member

The failure is in detect.py:

re.search("([0-9](\.[0-9])?)", out).group()

with out="10.0", it returns 1.

This is a bug, should be easy to fix, lets try for 1.23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants