> On Sept. 11, 2015, 7:22 p.m., Alex Clemmer wrote:
> > I think that `-DGTEST_USE_OWN_TR1_TUPLE` is actually unnecessary now that 
> > you've upgraded to GMock 1.7 (in commie 
> > a8970ce78f1abbee3dd4de282d54ced38d0e5fa1). Let me just double-check my 
> > understanding here just to make sure we're on the same page.
> > 
> > I've run CMake on my OS X machine and included the output below[1]. You can 
> > see that I'm running vanilla OS X, and that my compiler is clang. When I 
> > swap out the GMock version to be v1.6 (instead of v1.7, which is what it 
> > currently is), I get the error tr1/tuple error you see at [2].
> > 
> > BUT, when I run it with GMock v1.7, the issue is fixed. To confirm the fix, 
> > I consulted the source of `gtest-port.h` and found some code[3] that 
> > appears to intelligently figure out whether this flag should be set 
> > automatically.
> > 
> > If this is true, then I think this patch can omit this flag set entirely.
> > 
> > 
> > [1] CMake config output:
> > ```
> >  ~/src/mesos/build $ cmake ..
> > -- The C compiler identification is AppleClang 6.1.0.6020053
> > -- The CXX compiler identification is AppleClang 6.1.0.6020053
> > -- Check for working C compiler: /usr/bin/cc
> > -- Check for working C compiler: /usr/bin/cc -- works
> > -- Detecting C compiler ABI info
> > -- Detecting C compiler ABI info - done
> > -- Check for working CXX compiler: /usr/bin/c++
> > -- Check for working CXX compiler: /usr/bin/c++ -- works
> > -- Detecting CXX compiler ABI info
> > -- Detecting CXX compiler ABI info - done
> > -- ************************************************************
> > -- ********* Beginning Mesos CMake configuration step *********
> > -- ************************************************************
> > -- INSTALLATION PREFIX: /usr/local
> > -- MACHINE SPECS:
> > --     Hostname:
> > --     OS:       DARWIN(14.1.0)
> > --     Arch:     X86_64
> > --     BitMode:
> > --     BuildID:
> > -- ************************************************************
> > -- Performing Test COMPILER_SUPPORTS_CXX11
> > -- Performing Test COMPILER_SUPPORTS_CXX11 - Success
> > -- Looking for include file pthread.h
> > -- Looking for include file pthread.h - found
> > -- Looking for pthread_create
> > -- Looking for pthread_create - found
> > -- Found Threads: TRUE
> > -- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.5")
> > -- Found APR headers: /usr/include/apr-1
> > -- Found APR library: /usr/lib/libapr-1.dylib
> > -- Found APRUTIL headers: /usr/include/apr-1
> > -- Found APRUTIL library: /usr/lib/libaprutil-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_client-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_delta-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_diff-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_fs-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_fs_fs-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_fs_util-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_ra-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_ra_local-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_ra_serf-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_ra_svn-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_repos-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_subr-1.dylib
> > -- Found SVN lib: /usr/local/lib/libsvn_wc-1.dylib
> > -- Found SVN: 
> > /usr/local/lib/libsvn_client-1.dylib;/usr/local/lib/libsvn_delta-1.dylib;/usr/local/lib/libsvn_diff-1.dylib;/usr/local/lib/libsvn_fs-1.dylib;/usr/local/lib/libsvn_fs_fs-1.dylib;/usr/local/lib/libsvn_fs_util-1.dylib;/usr/local/lib/libsvn_ra-1.dylib;/usr/local/lib/libsvn_ra_local-1.dylib;/usr/local/lib/libsvn_ra_serf-1.dylib;/usr/local/lib/libsvn_ra_svn-1.dylib;/usr/local/lib/libsvn_repos-1.dylib;/usr/local/lib/libsvn_subr-1.dylib;/usr/local/lib/libsvn_wc-1.dylib
> > -- Configuring done
> > -- Generating done
> > -- Build files have been written to: /Users/alex/src/mesos/build
> > ```
> > 
> > [2] Error generated with GMock v1.6 on my machine:
> > ```
> > libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
> > -I/Users/alex/src/mesos/build/3rdparty/libprocess/3rdparty/gmock-1.6.0/src/gmock-1.6.0/gtest
> >  -I./build-aux 
> > -I/Users/alex/src/mesos/build/3rdparty/libprocess/3rdparty/gmock-1.6.0/src/gmock-1.6.0/gtest
> >  
> > -I/Users/alex/src/mesos/build/3rdparty/libprocess/3rdparty/gmock-1.6.0/src/gmock-1.6.0/gtest/include
> >  -D_THREAD_SAFE -DGTEST_HAS_PTHREAD=1 -g -O2 -MT src/gtest-all.lo -MD -MP 
> > -MF src/.deps/gtest-all.Tpo -c 
> > /Users/alex/src/mesos/build/3rdparty/libprocess/3rdparty/gmock-1.6.0/src/gmock-1.6.0/gtest/src/gtest-all.cc
> >   -fno-common -DPIC -o src/.libs/gtest-all.o
> > In file included from 
> > /Users/alex/src/mesos/build/3rdparty/libprocess/3rdparty/gmock-1.6.0/src/gmock-1.6.0/gtest/src/gtest-all.cc:39:
> > In file included from 
> > /Users/alex/src/mesos/build/3rdparty/libprocess/3rdparty/gmock-1.6.0/src/gmock-1.6.0/gtest/include/gtest/gtest.h:57:
> > In file included from 
> > /Users/alex/src/mesos/build/3rdparty/libprocess/3rdparty/gmock-1.6.0/src/gmock-1.6.0/gtest/include/gtest/internal/gtest-internal.h:40:
> > /Users/alex/src/mesos/build/3rdparty/libprocess/3rdparty/gmock-1.6.0/src/gmock-1.6.0/gtest/include/gtest/internal/gtest-port.h:499:13:
> >  fatal error:
> >       'tr1/tuple' file not found
> > #   include <tr1/tuple>  // NOLINT
> >             ^
> > 1 error generated.
> > ```
> > 
> > [3] Part of `gtest-port.h` that appears to intelligently set 
> > `GTEST_USE_OWN_TR1_TUPLE`: 
> > https://github.com/google/googletest/blob/master/googletest/include/gtest/internal/gtest-port.h#L639-L655
> 
> haosdent huang wrote:
>     I remember GTEST_LANG_CXX11 and GTEST_USE_OWN_TR1_TUPLE need use 
> together. Let me check this.
> 
> haosdent huang wrote:
>     Yes, need use "-std=c++11 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_LANG_CXX11" 
> to compile when use gmock-1.6.0.tar.gz

I think <tr1/tuple> is similiar like this one, and in autotools, we use 
-stdlib=libc++:
https://github.com/BVLC/caffe/issues/1358


- haosdent


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37502/#review98669
-----------------------------------------------------------


On Sept. 4, 2015, 4:25 a.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37502/
> -----------------------------------------------------------
> 
> (Updated Sept. 4, 2015, 4:25 a.m.)
> 
> 
> Review request for mesos, Artem Harutyunyan, Alex Clemmer, and Joseph Wu.
> 
> 
> Bugs: MESOS-3270
>     https://issues.apache.org/jira/browse/MESOS-3270
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add CMAKE_CXX_FLAGS to GMOCK_CONFIG_CMD in CMake.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/CMakeLists.txt 
> 997cc0d0e316e316136d4746e50e9e292a82b36b 
> 
> Diff: https://reviews.apache.org/r/37502/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> haosdent huang
> 
>

Reply via email to