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

cmake generator crashes when checking compiler version #1011

Closed
Manu343726 opened this issue Feb 20, 2017 · 2 comments
Closed

cmake generator crashes when checking compiler version #1011

Manu343726 opened this issue Feb 20, 2017 · 2 comments

Comments

@Manu343726
Copy link
Contributor

See https://travis-ci.org/foonathan/type_safe/jobs/203579448#L1231
I think this is related to the compiler version number parsing.

@memsharded
Copy link
Member

I see a couple of things here.

First, the auto-detection of conan is detecting gcc 4.6, which would be the default provided by travis. Unless you are using that compiler, you have to provide the settings you are actually using for your build in your test_package like:

$ conan test_package --build=outdated -s compiler=gcc -s compiler.version=5.4 -s compiler.libcxx=libstdc++

You can also remove the generators = 'cmake' from the recipe, it is not used at all. Maybe same for username and channel?

In the build you can read:

-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 5.4.1

Even if not using the C compiler, it is a very good idea to upgrade it same to the CXX compiler, and setting the environment appropriately, it avoids headaches, specially when pulling dependencies that actually are C code.

I can see in the build of the library, prior to using conan, problems with FindXXX.cmake of the dependencies:

CMake Warning at CMakeLists.txt:8 (find_package):
  By not providing "Finddebug_assert.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "debug_assert", but CMake did not find one.

From the recipe I can read in https://www.conan.io/source/debug_assert/1.1/Manu343726/testing, it seems that you are not exporting the Find.cmake, and later you are not packaging it. You can do both and benefit, building the package after installing the dependencies, that will use the package Find.cmake. Please ask for help or info about this if you need.

Regarding your issue: Yes, there is a single point where list is used in conanbuildinfo.cmake, which is the version parsing. It is true that compiler and version check can be fully disabled (just enable CONAN_DISABLE_CHECK_COMPILER), but they exist to avoid problems, like mismatchs between the installed settings and the real build settings.

It would be very useful if you could print your cmake variables:

message(STATUS "CMAKE_CXX_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "CMAKE_CXX_COMPILER_ID ${CMAKE_CXX_COMPILER_ID}")

To help debugging this issue. Thanks for reporting this!

@Manu343726
Copy link
Contributor Author

I'm closing this since it seems fixed in latest releases. Thanks memshardina.

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

No branches or pull requests

2 participants