rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.76k stars 312 forks source link

Bear fails to build in red hat 7 #461

Closed arturo-salinas closed 2 years ago

arturo-salinas commented 2 years ago

Describe the bug Dependence fails to build.

To Reproduce export LD_LIBRARY_PATH=/usr/local/lib64
CXX_COMPILER=/usr/local/bin/g++
C_COMPILER=/usr/local/bin/gcc

cmake -DCMAKE_INSTALL_LIBDIR=$LD_LIBRARY_PATH -DENABLE_UNIT_TESTS=OFF \
-DENABLE_FUNC_TESTS=OFF -DCMAKE_CXX_COMPILER=$CXX_COMPILER \
-DCMAKE_MAKE_PROGRAM=$make \
-DCMAKE_C_COMPILER=$C_COMPILER ..

make

arturo-salinas commented 2 years ago

error_build.log

rizsotto commented 2 years ago

Please check out the compiler version you are using. (And make sure it supports C++17, as the INSTALL.md suggests. Maybe try to compile some basic C++17 code to make sure you got that right.)

arturo-salinas commented 2 years ago

I've found the problem. There is a bug; CMAKE_C_COMPILER is not being passed to the grpc dependency. Then grpc will build with the default compiler that can happen does not support C++17.

rizsotto commented 2 years ago

Thanks @arturo-salinas , that might be the reason... Could you make a PR when it passing the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the 3rd party dependencies?

arturo-salinas commented 2 years ago

yes it is the reason. I tested myself. I create a PR. When can this fix be merged and tagged with a release tag? Thank you @rizsotto

rizsotto commented 2 years ago

Thanks for the PR @arturo-salinas , it's merged to master now. Release will come later (not sure about the date yet).