klogg icon indicating copy to clipboard operation
klogg copied to clipboard

[Build error] When I build this project on Ubuntu18.04LTS, it will fail

Open ykk136 opened this issue 1 year ago • 8 comments

Thanks for your great software. I encounter some issues when I build this project on Ubuntu18.04 LTS.

  1. Firstly, I use "cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .." to get required cmake dependencies, and then use "cmake --build ." to build this project, but so many errors occur just like: image image

  2. Secondly, I clean the build directory, and use "cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DKLOGG_USE_HYPERSCAN=OFF ..", and I can build it successfully, but when I open a log file, it will crash and output segmentation fault.

ykk136 avatar May 28 '23 13:05 ykk136

And I confirmed that my AMD CPU does support ssse3.

ykk136 avatar May 28 '23 13:05 ykk136

Could you provide the output of lscpu? It does look like some cpu instruction is enabled in build but missing from physical cpu, could be popcnt

variar avatar May 28 '23 16:05 variar

Thanks for your comment, I used lscpu, and the result is: image

Is there any way to solve this build issue?

ykk136 avatar Jun 04 '23 03:06 ykk136

Thanks for lscpu. That cpu has all required instructions. What compiler are you using? Could you attach the output of clean cmake configuration step?

variar avatar Jun 04 '23 05:06 variar

For the compilation environment, I list all the tools as:

  1. gcc / g++: 7.5.0 image image

  2. cmake: 3.20 image

  3. libboost: 1.65 image

  4. Ragel: 6.10 image

And I rebuild the project, it seems that these errors occur when the build process reaches end point image

And I tried to clean the output of cmake using cmake --build ./ --target clean, no output info, and I checked that the /build_root/output dir is cleaned. image

ykk136 avatar Jun 04 '23 06:06 ykk136

The build tools are the same as in ubuntu 18.04 docker container. Could you try passing -DKLOGG_USE_LTO=OFF to cmake? That should disable link time optimizations, and that is used for klogg builds for ubuntu 18.04 in ci pipleline.

variar avatar Jun 04 '23 10:06 variar

The build tools are the same as in ubuntu 18.04 docker container. Could you try passing -DKLOGG_USE_LTO=OFF to cmake? That should disable link time optimizations, and that is used for klogg builds for ubuntu 18.04 in ci pipleline.

Thanks for the info, but I tried it and not helpful. Finally I found that we must using -DKLOGG_GENERIC_CPU=ON to the cmake, then it would be okay

ykk136 avatar Aug 24 '24 13:08 ykk136

One more question about Generic_CPU flag. What is the difference between ucm_add_flags(C CXX "-march=x86-64 -mtune=generic") and ucm_add_flags(C CXX "-march=native -mtune=generic")? Will it imapct the final performance of KLogg?

ykk136 avatar Aug 24 '24 14:08 ykk136