Hi,
Sorry if the question is silly, but, is it possible to build H2O with Profile-guided optimization ?
Regards,
PGO is a compiler feature, and yes, you can.
Thank you @meritozh for your answer.
By any chance, do you know how to do it?
I tried this:
env CXXFLAGS='-march=native -fprofile-dir=/src/h2o/pgo -fprofile-generate=/src/h2o/pgo' cmake -DWITH_MRUBY=on
make
After installing, stopping/starting H2O, accessing a page, stopping H2O, I was expecting files to be written into the /src/h2o/pgo folder (to feed the fprofile-use in the next build). But the pgo folder remains empty.
Use CMAKE_C_FLAGS
flags, its c, not c++. h2o use cmake, so you should modify _CMakeLists.txt_, use cmake builtin variables to override default behavior. And remember, cleanup all cmake generated files first.
What @meritozh says. Though IIRC you do not need to modify CMakeLists.txt. The CMakeLists.txt of H2O inherits environment variable CMAKE_C_FLAGS
when being set (see https://github.com/h2o/h2o/blob/master/CMakeLists.txt#L206).
Thank you @meritozh and @kazuho !
Most helpful comment
Use
CMAKE_C_FLAGS
flags, its c, not c++. h2o use cmake, so you should modify _CMakeLists.txt_, use cmake builtin variables to override default behavior. And remember, cleanup all cmake generated files first.