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: Building conan-glew on Ubuntu 18.04 - Incorrect 'gcc' version #477

Closed
nigels-com opened this issue Oct 10, 2018 · 6 comments
Closed
Labels

Comments

@nigels-com
Copy link

I'm really quite puzzled where this version 4.9 gcc setting is coming from?

-- Conan: Checking correct version: 7.3
CMake Error at ../../../conanbuildinfo.cmake:295 (message):
  Incorrect 'gcc' version 'compiler.version=4.9' is not the one detected by
  CMake: 'GNU=7.3'

It doesn't seem be due to

$ cat ~/.conan/profiles/default
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

$ git clone https://github.com/bincrafters/conan-glew.git
$ cd conan-glew
$ python build.py

****************************************************************************************************

       _____                          _____           _                      _______          _
      / ____|                        |  __ \         | |                    |__   __|        | |
     | |     ___  _ __   __ _ _ __   | |__) |_ _  ___| | ____ _  __ _  ___     | | ___   ___ | |___
     | |    / _ \| '_ \ / _` | '_ \  |  ___/ _` |/ __| |/ / _` |/ _` |/ _ \    | |/ _ \ / _ \| / __|
     | |___| (_) | | | | (_| | | | | | |  | (_| | (__|   < (_| | (_| |  __/    | | (_) | (_) | \__ \
      \_____\___/|_| |_|\__,_|_| |_| |_|   \__,_|\___|_|\_\__,_|\__, |\___|    |_|\___/ \___/|_|___/
                                                                 __/ |
                                                                |___/


Version: 0.19.4
 >> Branch detected
   >> testing/2.1.0

[local_vars]
+---------------------------+--------------+
| Configuration             | value        |
|---------------------------+--------------|
| username                  | bincrafters  |
| stable_branch_pattern     | stable/*     |
| specified_channel         | testing      |
| upload_only_when_stable   | True         |
| channel                   | testing      |
| lcow_user_workaround      |              |
| vs10_x86_64_enabled       | False        |
| args                      |              |
| docker_platform_param     |              |
| sudo_docker_command       | sudo -E      |
| conan_pip_package         | conan==1.8.1 |
| sudo_pip_command          | sudo -E      |
| docker_shell              | /bin/sh -c   |
| skip_check_credentials    | False        |
| stable_channel            | stable       |
| use_docker                | False        |
| docker_conan_home         | /home/conan  |
| partial_reference         | glew/2.1.0   |
| docker_32_images          | False        |
| exclude_vcvars_precommand | False        |
| builds_in_current_page    | []           |
+---------------------------+--------------+

 >> Running builds...

[pip_update]
The directory '/home/nigels/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/nigels/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: conan==1.8.1 in /home/nigels/.local/lib/python2.7/site-packages
Requirement already satisfied: PyYAML<3.14.0,>=3.11 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: requests<3.0.0,>=2.7.0 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: patch==1.16 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: pluginbase<1.0,>=0.5 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: colorama<0.4.0,>=0.3.3 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: pygments<3.0,>=2.0 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: fasteners>=0.14.1 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: bottle<0.13,>=0.12.8 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: astroid>=1.6.5 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: six>=1.10.0 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: deprecation<2.1,>=2.0 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: tqdm==4.20.0 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: PyJWT<2.0.0,>=1.4.0 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: node-semver==0.2.0 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: future==0.16.0 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: distro<1.2.0,>=1.0.2 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: pylint>=1.9.3 in /home/nigels/.local/lib/python2.7/site-packages (from conan==1.8.1)
Requirement already satisfied: idna<2.8,>=2.5 in /home/nigels/.local/lib/python2.7/site-packages (from requests<3.0.0,>=2.7.0->conan==1.8.1)
Requirement already satisfied: certifi>=2017.4.17 in /home/nigels/.local/lib/python2.7/site-packages (from requests<3.0.0,>=2.7.0->conan==1.8.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/nigels/.local/lib/python2.7/site-packages (from requests<3.0.0,>=2.7.0->conan==1.8.1)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in /home/nigels/.local/lib/python2.7/site-packages (from requests<3.0.0,>=2.7.0->conan==1.8.1)
Requirement already satisfied: monotonic>=0.1 in /home/nigels/.local/lib/python2.7/site-packages (from fasteners>=0.14.1->conan==1.8.1)
Requirement already satisfied: lazy-object-proxy in /home/nigels/.local/lib/python2.7/site-packages (from astroid>=1.6.5->conan==1.8.1)
Requirement already satisfied: wrapt in /home/nigels/.local/lib/python2.7/site-packages (from astroid>=1.6.5->conan==1.8.1)
Requirement already satisfied: enum34>=1.1.3; python_version < "3.4" in /home/nigels/.local/lib/python2.7/site-packages (from astroid>=1.6.5->conan==1.8.1)
Requirement already satisfied: singledispatch; python_version < "3.4" in /home/nigels/.local/lib/python2.7/site-packages (from astroid>=1.6.5->conan==1.8.1)
Requirement already satisfied: backports.functools-lru-cache; python_version < "3.4" in /home/nigels/.local/lib/python2.7/site-packages (from astroid>=1.6.5->conan==1.8.1)
Requirement already satisfied: packaging in /home/nigels/.local/lib/python2.7/site-packages (from deprecation<2.1,>=2.0->conan==1.8.1)
Requirement already satisfied: isort>=4.2.5 in /home/nigels/.local/lib/python2.7/site-packages (from pylint>=1.9.3->conan==1.8.1)
Requirement already satisfied: configparser; python_version == "2.7" in /home/nigels/.local/lib/python2.7/site-packages (from pylint>=1.9.3->conan==1.8.1)
Requirement already satisfied: mccabe in /home/nigels/.local/lib/python2.7/site-packages (from pylint>=1.9.3->conan==1.8.1)
Requirement already satisfied: pyparsing>=2.0.2 in /home/nigels/.local/lib/python2.7/site-packages (from packaging->deprecation<2.1,>=2.0->conan==1.8.1)
Requirement already satisfied: futures in /home/nigels/.local/lib/python2.7/site-packages (from isort>=4.2.5->pylint>=1.9.3->conan==1.8.1)
Page: 1/1
+--------------------+--------+--------------+------------+---------------+
|   compiler.version | arch   | build_type   | compiler   | glew:shared   |
|--------------------+--------+--------------+------------+---------------|
|                4.9 | x86    | Release      | gcc        | True          |
|                4.9 | x86    | Debug        | gcc        | True          |
|                4.9 | x86    | Release      | gcc        | False         |
|                4.9 | x86    | Debug        | gcc        | False         |
|                4.9 | x86_64 | Release      | gcc        | True          |
|                4.9 | x86_64 | Debug        | gcc        | True          |
|                4.9 | x86_64 | Release      | gcc        | False         |
|                4.9 | x86_64 | Debug        | gcc        | False         |
|                5   | x86    | Release      | gcc        | True          |
|                5   | x86    | Debug        | gcc        | True          |
|                5   | x86    | Release      | gcc        | False         |
|                5   | x86    | Debug        | gcc        | False         |
|                5   | x86_64 | Release      | gcc        | True          |
|                5   | x86_64 | Debug        | gcc        | True          |
|                5   | x86_64 | Release      | gcc        | False         |
|                5   | x86_64 | Debug        | gcc        | False         |
|                6   | x86    | Release      | gcc        | True          |
|                6   | x86    | Debug        | gcc        | True          |
|                6   | x86    | Release      | gcc        | False         |
|                6   | x86    | Debug        | gcc        | False         |
|                6   | x86_64 | Release      | gcc        | True          |
|                6   | x86_64 | Debug        | gcc        | True          |
|                6   | x86_64 | Release      | gcc        | False         |
|                6   | x86_64 | Debug        | gcc        | False         |
|                7   | x86    | Release      | gcc        | True          |
|                7   | x86    | Debug        | gcc        | True          |
|                7   | x86    | Release      | gcc        | False         |
|                7   | x86    | Debug        | gcc        | False         |
|                7   | x86_64 | Release      | gcc        | True          |
|                7   | x86_64 | Debug        | gcc        | True          |
|                7   | x86_64 | Release      | gcc        | False         |
|                7   | x86_64 | Debug        | gcc        | False         |
|                3.8 | x86    | Release      | clang      | True          |
|                3.8 | x86    | Debug        | clang      | True          |
|                3.8 | x86    | Release      | clang      | False         |
|                3.8 | x86    | Debug        | clang      | False         |
|                3.8 | x86_64 | Release      | clang      | True          |
|                3.8 | x86_64 | Debug        | clang      | True          |
|                3.8 | x86_64 | Release      | clang      | False         |
|                3.8 | x86_64 | Debug        | clang      | False         |
|                3.9 | x86    | Release      | clang      | True          |
|                3.9 | x86    | Debug        | clang      | True          |
|                3.9 | x86    | Release      | clang      | False         |
|                3.9 | x86    | Debug        | clang      | False         |
|                3.9 | x86_64 | Release      | clang      | True          |
|                3.9 | x86_64 | Debug        | clang      | True          |
|                3.9 | x86_64 | Release      | clang      | False         |
|                3.9 | x86_64 | Debug        | clang      | False         |
|                4   | x86    | Release      | clang      | True          |
|                4   | x86    | Debug        | clang      | True          |
|                4   | x86    | Release      | clang      | False         |
|                4   | x86    | Debug        | clang      | False         |
|                4   | x86_64 | Release      | clang      | True          |
|                4   | x86_64 | Debug        | clang      | True          |
|                4   | x86_64 | Release      | clang      | False         |
|                4   | x86_64 | Debug        | clang      | False         |
+--------------------+--------+--------------+------------+---------------+


 >> Remote for URL 'https://api.bintray.com/conan/bincrafters/public-conan' already exist, keeping the current remote and its name

****************************************************************************************************
+----------------------+
| Profile              |
|----------------------|
| include(default)     |
|                      |
| [settings]           |
| arch=x86             |
| build_type=Release   |
| compiler=gcc         |
| compiler.version=4.9 |
| [options]            |
| glew:shared=True     |
| [env]                |
|                      |
| [build_requires]     |
+----------------------+

[conan_create]

 >> Calling 'conan create'
+-----------------+----------------------------------------------------+
| Configuration   | value                                              |
|-----------------+----------------------------------------------------|
| build_modes     |                                                    |
| name            | glew                                               |
| profile_name    | /tmp/tmpnRhDuVconan_package_tools_profiles/profile |
| version         | 2.1.0                                              |
| user            | bincrafters                                        |
| channel         | testing                                            |
+-----------------+----------------------------------------------------+
Exporting package recipe
glew/2.1.0@bincrafters/testing export: Copied 1 '.cmake' file: FindGLEW.cmake
glew/2.1.0@bincrafters/testing: The stored package has not changed
Configuration:
[settings]
os=Linux
os_build=Linux
arch=x86
arch_build=x86_64
compiler=gcc
compiler.version=4.9
compiler.libcxx=libstdc++11
build_type=Release
[options]
glew:shared=True
[build_requires]
[env]

glew/2.1.0@bincrafters/testing: WARN: Forced build from source
glew/2.1.0@bincrafters/testing (test package): Installing /home/nigels/dev/conan-glew/test_package/conanfile.py
Requirements
    glew/2.1.0@bincrafters/testing from local cache - Cache
Packages
    glew/2.1.0@bincrafters/testing:eec1124ecea977d62a6a0b6612f899b3f0382991 - Build

Cross-build from 'Linux:x86_64' to 'Linux:x86'
glew/2.1.0@bincrafters/testing: Building your package in /home/nigels/.conan/data/glew/2.1.0/bincrafters/testing/build/eec1124ecea977d62a6a0b6612f899b3f0382991
glew/2.1.0@bincrafters/testing: Copying sources to build folder
glew/2.1.0@bincrafters/testing: Generator cmake created conanbuildinfo.cmake
glew/2.1.0@bincrafters/testing: Calling build()
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Checking correct version: 7.3
CMake Error at ../../../conanbuildinfo.cmake:295 (message):
  Incorrect 'gcc' version 'compiler.version=4.9' is not the one detected by
  CMake: 'GNU=7.3'
Call Stack (most recent call first):
  ../../../conanbuildinfo.cmake:347 (conan_error_compiler_version)
  ../../../conanbuildinfo.cmake:423 (check_compiler_version)
  ../../../conanbuildinfo.cmake:60 (conan_check_compiler)
  CMakeLists.txt:11 (conan_basic_setup)


-- Configuring incomplete, errors occurred!
See also "/home/nigels/.conan/data/glew/2.1.0/bincrafters/testing/build/eec1124ecea977d62a6a0b6612f899b3f0382991/CMakeFiles/CMakeOutput.log".
glew/2.1.0@bincrafters/testing:
glew/2.1.0@bincrafters/testing: ERROR: Package 'eec1124ecea977d62a6a0b6612f899b3f0382991' build failed
glew/2.1.0@bincrafters/testing: WARN: Build folder /home/nigels/.conan/data/glew/2.1.0/bincrafters/testing/build/eec1124ecea977d62a6a0b6612f899b3f0382991
Traceback (most recent call last):
  File "build.py", line 11, in <module>
    builder.run()
  File "/home/nigels/.local/lib/python2.7/site-packages/cpt/packager.py", line 386, in run
    self.run_builds(base_profile_name=base_profile_name)
  File "/home/nigels/.local/lib/python2.7/site-packages/cpt/packager.py", line 463, in run_builds
    r.run()
  File "/home/nigels/.local/lib/python2.7/site-packages/cpt/runner.py", line 69, in run
    test_folder=self._test_folder)
  File "/home/nigels/.local/lib/python2.7/site-packages/conans/client/conan_api.py", line 84, in wrapper
    return f(*args, **kwargs)
  File "/home/nigels/.local/lib/python2.7/site-packages/conans/client/conan_api.py", line 364, in create
    test_build_folder, test_folder, conanfile_path)
  File "/home/nigels/.local/lib/python2.7/site-packages/conans/client/cmd/create.py", line 40, in create
    test_build_folder=test_build_folder)
  File "/home/nigels/.local/lib/python2.7/site-packages/conans/client/cmd/test.py", line 39, in install_build_and_test
    keep_build=keep_build)
  File "/home/nigels/.local/lib/python2.7/site-packages/conans/client/manager.py", line 147, in install
    installer.install(deps_graph, keep_build)
  File "/home/nigels/.local/lib/python2.7/site-packages/conans/client/installer.py", line 273, in install
    self._build(nodes_by_level, deps_graph, keep_build, root_node)
  File "/home/nigels/.local/lib/python2.7/site-packages/conans/client/installer.py", line 299, in _build
    self._handle_node_cache(node, package_ref, keep_build, processed_package_refs)
  File "/home/nigels/.local/lib/python2.7/site-packages/conans/client/installer.py", line 314, in _handle_node_cache
    self._build_package(node, package_ref, output, keep_build)
  File "/home/nigels/.local/lib/python2.7/site-packages/conans/client/installer.py", line 390, in _build_package
    raise exc
conans.errors.ConanExceptionInUserConanfileMethod: glew/2.1.0@bincrafters/testing: Error in build() method, line 58
	cmake.configure(source_dir="%s/build/cmake" % self.source_subfolder, defs={"BUILD_UTILS": "OFF"})
	ConanException: Error 256 while executing cd '/home/nigels/.conan/data/glew/2.1.0/bincrafters/testing/build/eec1124ecea977d62a6a0b6612f899b3f0382991' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCONAN_EXPORTED="1" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="gcc" -DCONAN_COMPILER_VERSION="4.9" -DCONAN_CXX_FLAGS="-m32" -DCONAN_SHARED_LINKER_FLAGS="-m32" -DCONAN_C_FLAGS="-m32" -DBUILD_SHARED_LIBS="ON" -DCMAKE_INSTALL_PREFIX="/home/nigels/.conan/data/glew/2.1.0/bincrafters/testing/package/eec1124ecea977d62a6a0b6612f899b3f0382991" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -Wno-dev -DBUILD_UTILS="OFF" 'source_subfolder/build/cmake'
@ericLemanissier
Copy link
Contributor

I noticed an error on travis when building Qt, since conan 1.8.0 is out. It maybe related because it happens only when cross compiling from x86_64 to x86. In my case some system packages where not installed properly. I fixed it by adding environment variable CONAN_DOCKER_32_IMAGES=1 as documented here. Does it solve your problem too ?

@nigels-com
Copy link
Author

Oh, I see. It's trying to do a matrix build? (Duh!)

This worked: $ CONAN_GCC_VERSIONS=7 CONAN_ARCHS=x86_64 python build.py

Which is good enough for my purpose today.

Thanks for the breadcrumbs, I'll go study the Conan Package Tools documentation....

@SSE4 SSE4 added the question label Oct 10, 2018
@Croydon
Copy link
Member

Croydon commented Oct 10, 2018

Conan Package Tools is via default always tries to build a matrix of various compiler versions and configurations. You could have a look in one of our many repositories or in our templates to see how to configure it correctly.

https://github.com/bincrafters/conan-templates/blob/master/.travis.yml

If you only need one specific compiler/version you can remove the other entries of course. Let us know if you have more questions.

@Croydon Croydon closed this as completed Oct 10, 2018
@Croydon
Copy link
Member

Croydon commented Oct 11, 2018

@nigels-com At a second look, I'm not sure if you actually wanted to use the Conan Package Tools. The Conan Package tools are used for mass building packages for various configurations.
You DON'T need them if you want to do a local build.

You need to set up one time our repository (for packages we didn't include in conan-center yet):
conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan

Then you can install it via
conan install glew/2.1.0@bincrafters/stable

@nigels-com
Copy link
Author

nigels-com commented Oct 11, 2018

@Croydon I arrived in conan-land via GLEW since I've been revving on that to do a release. I was poking around with the contributed conan-build as a means of getting hands-on with conan and decide if this is something that I'd like to do more with. I made a Conan package for FreeGLUT today which isn't quite perfect, but is looking promising.

https://github.com/nigels-com/conan-glut
https://travis-ci.org/nigels-com/conan-glut/builds
https://ci.appveyor.com/project/nigels-com/conan-glut
https://bintray.com/nigels-com/conan/glut

One of my general comments is that since I'm in Australia (otherwise known as the "outer-rim" of the Internet) I'm having some pain with docker containers taking a long time to update themselves from the non-local package repositories. And just now, bintray is timing out for my uploads. I can happily spin-up an EC2 instance in North America for revving on stuff, I guess, but hopefully wiring in more parameterisation is plausible.

At work I've been doing similar patterns of Jenkins builds using Docker, so the conan paradigm rings true, even if our cmake monolith looks daunting initially. Even if we can "just" get some larger things such as boost via conan, that would be a good step forward, without perhaps chasing every last thing in the zoo.

@Croydon
Copy link
Member

Croydon commented Oct 11, 2018

@nigels-com I have worked on freeglut before by the way, please have a look here: conan-io/wishlist#124 and here https://github.com/croydon/conan-freeglut

I got it working on Fedora, but linking fails on Ubuntu, Windows and macOS so far. Didn't got the time yet to work on that, also my understanding of the dependencies are probably not got enough to get this finished. Please feel free to contribute there, once it is working I would transfer it over to Bincrafters.

Please feel also free to join our Slack here: https://cpplang.slack.com/messages/C41CWV9HA/ (in the rooms Conan and Bincrafters)

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

No branches or pull requests

4 participants