Skip to content

glog flags like --logtostderr are missing on a clean build #28

Closed

Description

@jeroen-dhollander

Please use this template for reporting suspected bugs or requests for help.

Issue Description

If you run the build_openr.sh script on a clean system where OpenR has not been compiled before,
the glog flags are missing from the openr binary (so you do not see them in the help, and trying to use them complains about these flags being missing).

The reason for this is that build_openr.sh builds glog before gflags:

#
# install other dependencies from source
#
install_glog
install_gflags

Which means the glog installation can't find gflags, so it doesn't include those.

This can be seen for example in the logging.h file.

On the first compile:

└─⊳ grep -1 gflags\.h deps/glog/src/glog/logging.h
#if 0
#include <gflags/gflags.h>
#endif

On the second compile:

└─⊳ grep -1 gflags\.h deps/glog/src/glog/logging.h
#if 1
#include <gflags/gflags.h>
#endif

The fix is to simply reorder those lines so gflags is always created before glog

Environment

  • tag or commit hash on which this occured
  • OS version: <e.g. ubuntu-16.04>
    I used 439a9cd890e37749de4a1c94aa5091c61ef79090, but the issue is still present on master

Minimal test code / Steps to reproduce the issue

  1. do a clean compilation of openr

What's the actual result?

openr --logtostderr
openr[5961]: Starting OpenR daemon.
ERROR: unknown command line flag 'logtostderr'

What's the expected result?

openr --logtostderr
openr[6010]: Starting OpenR daemon.
I0524 18:05:40.330364  6013 Main.cpp:419] Starting Watchdog thread ...
I0524 18:05:40.340278  6017 NetlinkSystemHandler.cpp:114] Initializng Netlink from server thread
I0524 18:05:40.340450  6017 Main.cpp:480] Starting NetlinkSystem server...
I0524 18:05:40.340917  6018 Main.cpp:504] Starting ConfigStore thread...
I0524 18:05:40.341977  6020 Main.cpp:524] Starting ZmqMonitor thread...
I0524 18:05:40.343966  6022 Main.cpp:549] Starting KvStore thread...
<snip>

Activity

  1. saifhhasan commented on May 24, 2018

    @saifhhasan
    Contributor

    Thanks @jeroen-dhollander for finding issue as well as root-causing it. Would you be interested in authoring pull request with the fix?

    And maybe same for fbzmq as open/r depends on fbzmq to compile it ?
    https://github.com/facebook/fbzmq/blob/master/build/build_fbzmq.sh#L244

    We can send it out internally if you're running busy :)

  2. jeroen-dhollander commented on May 24, 2018

    @jeroen-dhollander
    Author

    I'll try to create a pull request later today.

  3. saifhhasan commented on Jun 4, 2018

    @saifhhasan
    Contributor

    Issue has been resolved. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions