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

Do not force the compiler version #73

Closed
madmann91 opened this issue Jun 8, 2020 · 2 comments
Closed

Do not force the compiler version #73

madmann91 opened this issue Jun 8, 2020 · 2 comments

Comments

@madmann91
Copy link
Contributor

The most recent commits break the build on my system. I have gcc in version 10, so the line set(CMAKE_C_COMPILER "gcc-9") breaks everything for me. I believe it would be better to set that per-build, if required with the CMake GUI, instead of forcing a specific version by default. Alternatively, it is possible to use the following example to detect if inter-procedural optimization is supported by the compiler (starting from CMake 3.9.6):

check_ipo_supported(RESULT result OUTPUT output)
if(result)
  set_property(TARGET foo PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
  message(WARNING "IPO is not supported: ${output}")
endif()

(reference: https://cmake.org/cmake/help/v3.9/module/CheckIPOSupported.html)

@vkoskiv
Copy link
Owner

vkoskiv commented Jun 8, 2020

Actually that set(CMAKE_C_COMPILER "gcc-9") is in there by accident. I just added it for testing, and indeed one should just do cmake . -DCMAKE_C_COMPILER=<compiler> instead. The helper scripts in the rebuild directory do just this.

And yeah, after seeing the massive performance boost from a little tweak to CMakeLists.txt, I was a bit anxious to commit it in as quickly as possible. I'll apply that check you outlined shortly.

I think requiring CMake 3.9 and newer is fine, all my experiments with running this on ancient hardware use plain shell scripts for the build system anyway.

@vkoskiv
Copy link
Owner

vkoskiv commented Jun 8, 2020

Resolved by d56da63

@vkoskiv vkoskiv closed this as completed Jun 8, 2020
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