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

can't use c++17 with gcc 5 #9417

Closed
dvirtz opened this issue Aug 12, 2021 · 5 comments · Fixed by #9431
Closed

can't use c++17 with gcc 5 #9417

dvirtz opened this issue Aug 12, 2021 · 5 comments · Fixed by #9431
Assignees
Milestone

Comments

@dvirtz
Copy link

dvirtz commented Aug 12, 2021

installing with compiler.cppstd=17 compiler=gcc compiler.version=5 fails even though GCC 5 supports c++17.
This is because the checks in

if Version(gcc_version) >= "5.1":
are done with minor versions and '5' < '5.1'.
On the other hand, setting compiler.version=5.4 fails due to https://github.com/conan-io/conan-package-tools/blob/e3c29b9e3e2dd72c661beff2674fc3d4f4b16a7a/cpt/builds_generator.py#L88

Environment Details (include every applicable attribute)

  • Operating System+version: Ubuntu 16.04
  • Compiler+version: gcc 5.4
  • Conan version: 1.39.0
  • Python version: 3.7.10

Steps to reproduce (Include if Applicable)

see above

Logs (Executed commands with output) (Include/Attach if Applicable)

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/root/.vscode-server/extensions/ms-python.python-2021.8.1105858891/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module>
    cli.main()
  File "/root/.vscode-server/extensions/ms-python.python-2021.8.1105858891/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
    run()
  File "/root/.vscode-server/extensions/ms-python.python-2021.8.1105858891/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
    runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
  File "/usr/lib/python3.7/runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/root/conan-recipes/scripts/build_recipe.py", line 95, in <module>
    run_autodetect()
  File "/usr/lib/python3.7/site-packages/bincrafters/build_autodetect.py", line 113, in run_autodetect
    builder.run()
  File "/usr/lib/python3.7/site-packages/cpt/packager.py", line 584, in run
    self.run_builds(base_profile_name=base_profile_name)
  File "/usr/lib/python3.7/site-packages/cpt/packager.py", line 679, in run_builds
    r.run()
  File "/usr/lib/python3.7/site-packages/cpt/runner.py", line 136, in run
    lockfile=self._lockfile)
  File "/usr/lib/python3.7/site-packages/conans/client/conan_api.py", line 93, in wrapper
    return f(api, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/conans/client/conan_api.py", line 364, in create
    self.app.cache, self.app.out, lockfile=lockfile)
  File "/usr/lib/python3.7/site-packages/conans/client/conan_api.py", line 1559, in get_graph_info
    phost.process_settings(cache)
  File "/usr/lib/python3.7/site-packages/conans/model/profile.py", line 53, in process_settings
    settings_preprocessor.preprocess(self.processed_settings)
  File "/usr/lib/python3.7/site-packages/conans/client/settings_preprocessor.py", line 9, in preprocess
    _check_cppstd(settings)
  File "/usr/lib/python3.7/site-packages/conans/client/settings_preprocessor.py", line 46, in _check_cppstd
    compiler_cppstd, "compiler.cppstd")
  File "/usr/lib/python3.7/site-packages/conans/client/settings_preprocessor.py", line 40, in check_flag_available
    available))
conans.errors.ConanException: The specified 'compiler.cppstd=17' is not available for 'gcc 5'. Possible values are ['98', 'gnu98', '11', 'gnu11', '14', 'gnu14']'
@Renari
Copy link

Renari commented Aug 12, 2021

This is probably disabled because not all features of C++17 are supported until GCC7.

https://en.cppreference.com/w/cpp/compiler_support#cpp17

@dvirtz
Copy link
Author

dvirtz commented Aug 12, 2021 via email

@lasote lasote self-assigned this Aug 16, 2021
@lasote
Copy link
Contributor

lasote commented Aug 16, 2021

Thanks for reporting. I think this is a Conan bug, thank you for reporting.

@lasote lasote added this to the 1.40 milestone Aug 16, 2021
@memsharded
Copy link
Member

#9431 will fix this for 1.40, the flag added will be -std=c++1z

@dvirtz
Copy link
Author

dvirtz commented Aug 16, 2021 via email

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.

4 participants