I am making my own c++ classification program using caffe library. I want to hide all logging messages during caffe's model initialization step.
According to Disable glog's "LOG(INFO)" logging, I could disable most of logs by setting environment variable
GLOG_minloglevel=2
from command line.
But, What I really want is to remove all logs from the executable itself, so the user can not turn on the logs by resetting GLOG_minloglevel value.
I could find a way to strip glog's logging message on compile time from http://rpg.ifi.uzh.ch/docs/glog.html. It says I can remove logs like this:
> #define GOOGLE_STRIP_LOG 1 // this must go before the #include!
> #include <glog/logging.h>
Since my application uses caffe's c++ library, I needed to rebuild caffe library with adding following option add_definitions(-DGOOGLE_STRIP_LOG=2)
to caffe's CMakeLists.txt.
The compile was successful, but when I ran my application with new caffe library, it stops with segmentation fault error during model initialization step.
I could get a bit more detailed error message by running with gdb like this:
Program received signal SIGSEGV, Segmentation fault. __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:153 153 ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such file or directory
When I roll back to the original caffe library without add_definitions(-DGOOGLE_STRIP_LOG=2)
in caffe's CMakeLists.txt, my application runs fine.
Can anyone give me a hint for solving this problem?
Thank you in advance.