Error setting logtostderr under Windows

275 views
Skip to first unread message

arrigo

unread,
May 15, 2015, 2:30:06 PM5/15/15
to ceres-...@googlegroups.com
When I pass '-logtostderr -v=1' to the command line, google::ParseCommandLineFlags(&argc, &argv, true) terminates with:
ERROR: unknown command line flag 'logtostderr'

I'm using the simple_bundle_adjuster.cc as a template. After some debugging I found that
 CommandLineFlag* FlagRegistry::FindFlagLocked(const char* name)
in gflags.cc does not find 'logtostderr' in its dictionary of command line options strings. This is under Windows 8 with VS 2013. Any ideas?

Thanks,

-Arrigo

Alex Stewart

unread,
May 15, 2015, 2:36:58 PM5/15/15
to ceres-...@googlegroups.com
Arrigo,

I think you compiled Ceres with the MINIGLOG option enabled.  This uses a *very* basic stand-in for glog which does not support the gflags glog does.  If you want proper control over the output logs then you should recompile Ceres using glog (which is used when the MINIGLOG option is off).

-Alex

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/1d094761-068f-4f62-9b5a-6049d37f0da6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

arrigo

unread,
May 15, 2015, 3:25:50 PM5/15/15
to ceres-...@googlegroups.com
Alex,

I just rebuilt ceres to make sure it is linked with glog (see CMake log below), and I have the same error. For some reason FindFlagLocked() does not have 'logtostderr' in its dictionary.

Thanks,

-Arrigo

The C compiler identification is MSVC 18.0.21005.1

The CXX compiler identification is MSVC 18.0.21005.1

Check for working C compiler using: Visual Studio 12 2013 Win64

Check for working C compiler using: Visual Studio 12 2013 Win64 -- works

Detecting C compiler ABI info

Detecting C compiler ABI info - done

Check for working CXX compiler using: Visual Studio 12 2013 Win64

Check for working CXX compiler using: Visual Studio 12 2013 Win64 -- works

Detecting CXX compiler ABI info

Detecting CXX compiler ABI info - done

-- Found Eigen version 3.2.4: C:/ceres-solver/eigen-eigen-10219c95fe65

===============================================================

Disabling the use of Eigen as a sparse linear algebra library.

This does not affect the covariance estimation algorithm

which can still use the EIGEN_SPARSE_QR algorithm.

===============================================================

-- Building without LAPACK.

-- Building without SuiteSparse.

-- Found CXSparse version: 3.1.4, building with CXSparse.

-- Found Google Flags header in: C:/gflags-master/build/include, in namespace: gflags

-- Found Google Log header in: C:/glog-master/src/windows

-- Building with OpenMP.

-- Found unordered_map/set in std namespace.

-- Found shared_ptr in std namespace using <memory> header.

-- Building Ceres as a static library.


=================================================================================


-- Build type: Debug. Performance will be terrible!

-- Add -DCMAKE_BUILD_TYPE=Release to the CMake command line to get an optimized build.


=================================================================================

Creating configured Ceres config.h output directory: C:/ceres-solver/build/config/ceres/internal

Enabling CERES_NO_LAPACK in Ceres config.h

Enabling CERES_NO_SUITESPARSE in Ceres config.h

Enabling CERES_USE_OPENMP in Ceres config.h

Enabling CERES_STD_UNORDERED_MAP in Ceres config.h

-- Build the examples.

Configuring done

Generating done

Alex Stewart

unread,
May 15, 2015, 4:16:34 PM5/15/15
to ceres-...@googlegroups.com
1) Are you sure your glog build is actually using gflags?  It is not a requirement and would certainly explain your problem, it may not have detected gflags when it was configured.

2) If you think glog is compiled against gflags, then this may be related to your problem:

-- Build type: Debug. Performance will be terrible!
-- Add -DCMAKE_BUILD_TYPE=Release to the CMake command line to get an optimized build.

Does it work if you compile Ceres in Release?  If so, then I *think* (I don’t use MSVC) what may be happening is that you have some form of Release/Debug DLL mismatch with glog & gflags, perhaps glog-Release is compiled against gflags, but glog-Debug is not.

-Alex

Reply all
Reply to author
Forward
0 new messages