[MDEV-18273] CMake Error at storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake:178 Created: 2019-01-16  Updated: 2021-01-09  Resolved: 2021-01-09

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Server
Affects Version/s: 10.3.12
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Jan Kohnert Assignee: Sergei Golubchik
Resolution: Cannot Reproduce Votes: 0
Labels: contribution
Environment:

Arch Linux (AUR-Package mariadb-10.3)


Attachments: File fix_cmake_compiler_flag_tests.patch    
Issue Links:
Duplicate
is duplicated by MDEV-17103 tokudb doesn't build with gcc8 due to... Closed
Relates
relates to MCOL-504 CMake Error at storage/tokudb/Percona... Closed

 Description   

Trying to cmake the project in a non-english environment leads to the following error:

CMake Error at storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake:178 (message): 
/usr/bin/c++ doesn't support -std=c++11 or -std=c++0x, you need one that does. Call Stack (most recent call first): storage/tokudb/PerconaFT/CMakeLists.txt:57 (include)
 
-- Configuring incomplete, errors occurred!

The problem does not occur in an english environment (f.e LANG=C cmake).

Further investigation leads to a broken check in cmake/check_compiler_flag.cmake, which does a regex search for valid compiler flags. Since gcc in a f.e. german environment does not output "error", but "Fehler", the regex check does not work as expected. It issues warning to some flags set before the failing test, which then lead to the error seen above.

I prepared a patch that uses the cmake-builtin check_c_compiler_flag/check_cxx_compiler_flag in that file. One additional fix had to be done in order to get rid of MY_CHECK_C_COMPILER_FLAG defined in the same file (only one check directly used that function).

Since I could not find the feature documented for cmake<3.0.2 (the first cmake-3 doc on the cmake-webpage), I had to change the minimum cmake version to 3.0.2, too. Possibly one could push the version further to a more recent version of cmake; my local cmake-3.13.2 works just fine.

Best regards Jan



 Comments   
Comment by Sergey Vojtovich [ 2020-02-20 ]

confirmed by code analysis, didn't try reproducing though.

Comment by Sergei Golubchik [ 2021-01-09 ]

I cannot repeat it. Tried with LANG=C and with LANG=de_DE, I get exactly the same CMakeCache.txt, that is all compiler feature detection works identically.

Presumably, it was fixed in MDEV-17103

Generated at Thu Feb 08 08:42:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.