You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2015/07/24 01:49:12 UTC

[1/3] mesos git commit: Cause CMake to fail and return error code if C++11 not supported.

Repository: mesos
Updated Branches:
  refs/heads/master dfd55d2a1 -> 5a5ab96d6


Cause CMake to fail and return error code if C++11 not supported.

The current CMake build system will print a warning that your compiler
doesn't support C++11, but still return exit code 0. (It also returns
a garbled error message.)

This commit will cause it to hard-fail the config step, and return an
error code. It will also generate a non-garbled error message.

Review: https://reviews.apache.org/r/36743


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0765aa61
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0765aa61
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0765aa61

Branch: refs/heads/master
Commit: 0765aa615c93195532ab50d375a7db83b89c6e28
Parents: dfd55d2
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Jul 23 16:39:45 2015 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Thu Jul 23 16:39:45 2015 -0700

----------------------------------------------------------------------
 cmake/MesosConfigure.cmake | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0765aa61/cmake/MesosConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/MesosConfigure.cmake b/cmake/MesosConfigure.cmake
index 16b72f1..ee47842 100755
--- a/cmake/MesosConfigure.cmake
+++ b/cmake/MesosConfigure.cmake
@@ -41,6 +41,8 @@ enable_testing()
 
 # CONFIGURE COMPILATION.
 ########################
+string(COMPARE EQUAL ${CMAKE_SYSTEM_NAME} "Linux" LINUX)
+
 if (_DEBUG)
   set(CMAKE_BUILD_TYPE Debug)
 endif (_DEBUG)
@@ -51,9 +53,9 @@ if (COMPILER_SUPPORTS_CXX11)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 else (COMPILER_SUPPORTS_CXX11)
   message(
-    STATUS
-    The compiler ${CMAKE_CXX_COMPILER} does not support the `-std=c++11` flag.
-    Please use a different C++ compiler.)
+    FATAL_ERROR
+    "The compiler ${CMAKE_CXX_COMPILER} does not support the `-std=c++11` flag. "
+    "Please use a different C++ compiler.")
 endif (COMPILER_SUPPORTS_CXX11)
 
 # Convenience flags to simplify Windows support in C++ source.


[2/3] mesos git commit: Add small fixes allowing CMake to build Process tests on OS X 10.10.

Posted by be...@apache.org.
Add small fixes allowing CMake to build Process tests on OS X 10.10.

There are two things that have to change in the current CMake build
solution in order to work on OS X 10.10:

  * librt (which holds the POSIX.1b Realtime Extensions interfaces in
    Linux, including things like async I/O and memory-mapped files,
    etc.)  does not exist on OS X, and does not need to be linked.

  * The version of GTest attempts to find std::tr1::tuple, which is
    not available on OS X 10.10. Like we have done in autotools
    (see[1] and also configure.ac) we simply define
    `GTEST_USE_OWN_TR1_TUPLE` when we're compiling on OS X.

[1] https://mail-archives.apache.org/mod_mbox/mesos-dev/201403.mbox/%3C20140306223933.2625.25724@reviews.apache.org%3E

Review: https://reviews.apache.org/r/36741


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c0c03da8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c0c03da8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c0c03da8

Branch: refs/heads/master
Commit: c0c03da872405ac363f6ff0699fc4e6ab0b5a9e3
Parents: 0765aa6
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Jul 23 16:40:03 2015 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Thu Jul 23 16:49:08 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/CMakeLists.txt           | 13 ++++++++++---
 3rdparty/libprocess/cmake/ProcessConfigure.cmake      | 10 ++++++++--
 3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake | 10 ++++++++++
 3 files changed, 28 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c0c03da8/3rdparty/libprocess/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/CMakeLists.txt b/3rdparty/libprocess/3rdparty/CMakeLists.txt
index 851ab94..d7c6dfb 100644
--- a/3rdparty/libprocess/3rdparty/CMakeLists.txt
+++ b/3rdparty/libprocess/3rdparty/CMakeLists.txt
@@ -139,14 +139,21 @@ else (REBUNDLED)
   set(PROTOBUF_URL https://github.com/hausdorff/mesos/raw/test_cmake/3rdparty/libprocess/3rdparty/protobuf-${PROTOBUF_VERSION}.tar.gz)
 endif (REBUNDLED)
 
-if (NOT WIN32)
+if (APPLE)
+  # GTEST on OSX needs its own tr1 tuple.
+  # TODO(dhamon): Update to gmock 1.7 and pass GTEST_LANG_CXX11 when
+  # in C++11 mode.
+  set(GMOCK_BUILD_CMD  make CPPFLAGS=-DGTEST_USE_OWN_TR1_TUPLE)
+  set(GMOCK_CONFIG_CMD ${GMOCK_ROOT}/configure --prefix=${GMOCK_ROOT}-lib/lib)
+elseif (NOT WIN32)
   set(GMOCK_CONFIG_CMD ${GMOCK_ROOT}/configure --prefix=${GMOCK_ROOT}-lib/lib)
   set(GMOCK_BUILD_CMD  make)
+endif (APPLE)
 
+if (NOT WIN32)
   set(PROTOBUF_CONFIG_CMD  ${PROTOBUF_ROOT}/src/../configure --prefix=${PROTOBUF_LIB})
   set(PROTOBUF_BUILD_CMD   make)
   set(PROTOBUF_INSTALL_CMD make install)
-
 endif (NOT WIN32)
 
 ExternalProject_Add(
@@ -175,4 +182,4 @@ list(
   ${CMAKE_SOURCE_DIR}/3rdparty/libprocess/3rdparty/stout/cmake
   )
 include(StoutTestsConfigure)
-add_subdirectory(stout/tests)
\ No newline at end of file
+add_subdirectory(stout/tests)

http://git-wip-us.apache.org/repos/asf/mesos/blob/c0c03da8/3rdparty/libprocess/cmake/ProcessConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessConfigure.cmake b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
index d6cdd05..4681eef 100755
--- a/3rdparty/libprocess/cmake/ProcessConfigure.cmake
+++ b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
@@ -134,11 +134,17 @@ set(PROCESS_LIBS
 
 if (NOT WIN32)
   find_package(ZLIB REQUIRED)
-  find_library(LIBRT_LIBRARIES rt REQUIRED)
+
+  # TODO(hausdorff): The `LINUX` flag comes from MesosConfigure; when
+  # we port the bootstrap script to CMake, we should also copy this
+  # logic into .cmake files in the Stout and Process libraries'
+  # folders individually.
+  if (LINUX)
+    set(PROCESS_LIBS ${PROCESS_LIBS} rt)
+  endif (LINUX)
 
   set(PROCESS_LIBS
     ${PROCESS_LIBS}
     ${ZLIB_LIBRARIES}
-    ${LIBRT_LIBRARIES}
     )
 endif (NOT WIN32)

http://git-wip-us.apache.org/repos/asf/mesos/blob/c0c03da8/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake b/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
index 082489c..3c1bb0b 100644
--- a/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
+++ b/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
@@ -39,6 +39,16 @@ EXTERNAL("protobuf" "2.5.0" "${PROCESS_3RD_BIN}")
 set(GTEST_SRC          ${GMOCK_ROOT}/gtest)
 set(GPERFTOOLS_VERSION 2.0)
 set(GPERFTOOLS         ${PROCESS_3RD_BIN}/gperftools-${GPERFTOOLS_VERSION})
+set(PROTOBUF_LIB       ${PROTOBUF_ROOT}-lib/lib)
+
+# COMPILER CONFIGURATION.
+#########################
+if (APPLE)
+  # GTEST on OSX needs its own tr1 tuple.
+  # TODO(dhamon): Update to gmock 1.7 and pass GTEST_LANG_CXX11 when
+  # in C++11 mode.
+  add_definitions(-DGTEST_USE_OWN_TR1_TUPLE=1)
+endif (APPLE)
 
 # DEFINE PROCESS TEST LIBRARY DEPENDENCIES. Tells the process library build
 # tests target download/configure/build all third-party libraries before


[3/3] mesos git commit: Add small fixes allowing CMake to build Stout tests on OS X 10.10.

Posted by be...@apache.org.
Add small fixes allowing CMake to build Stout tests on OS X 10.10.

There are two things that have to change in the current CMake build
solution in order to work on OS X 10.10:

  * librt (which holds the POSIX.1b Realtime Extensions interfaces in
    Linux, including things like async I/O and memory-mapped files,
    etc.)  does not exist on OS X, and does not need to be linked.

  * The version of GTest attempts to find std::tr1::tuple, which is
    not available on OS X 10.10. Like we have done in autotools
    (see[1] and also configure.ac) we simply define
    `GTEST_USE_OWN_TR1_TUPLE` when we're compiling on OS X.

[1] https://mail-archives.apache.org/mod_mbox/mesos-dev/201403.mbox/%3C20140306223933.2625.25724@reviews.apache.org%3E

Review: https://reviews.apache.org/r/36740


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5a5ab96d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5a5ab96d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5a5ab96d

Branch: refs/heads/master
Commit: 5a5ab96d6810b1dd55cc3cb159e192997cca4a4c
Parents: c0c03da
Author: Alex Clemmer <cl...@gmail.com>
Authored: Thu Jul 23 16:41:07 2015 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Thu Jul 23 16:49:08 2015 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/cmake/FindSvn.cmake          |  3 +--
 .../stout/cmake/StoutTestsConfigure.cmake       | 24 +++++++++++++-------
 2 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5a5ab96d/3rdparty/libprocess/3rdparty/stout/cmake/FindSvn.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/cmake/FindSvn.cmake b/3rdparty/libprocess/3rdparty/stout/cmake/FindSvn.cmake
index c0c0f34..8773739 100644
--- a/3rdparty/libprocess/3rdparty/stout/cmake/FindSvn.cmake
+++ b/3rdparty/libprocess/3rdparty/stout/cmake/FindSvn.cmake
@@ -47,7 +47,6 @@ set(SVN_LIB_NAMES
   svn_delta-1
   svn_diff-1
   svn_fs-1
-  svn_fs_base-1
   svn_fs_fs-1
   svn_fs_util-1
   svn_ra-1
@@ -121,4 +120,4 @@ endif ((NUM_FOUND_LIBS AND (NUM_REQD_LIBS EQUAL NUM_FOUND_LIBS)) AND
 mark_as_advanced(
   SVN_LIB
   SVN_INCLUDE_DIR
-  )
\ No newline at end of file
+  )

http://git-wip-us.apache.org/repos/asf/mesos/blob/5a5ab96d/3rdparty/libprocess/3rdparty/stout/cmake/StoutTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/cmake/StoutTestsConfigure.cmake b/3rdparty/libprocess/3rdparty/stout/cmake/StoutTestsConfigure.cmake
index e9be4aa..6e7eb00 100644
--- a/3rdparty/libprocess/3rdparty/stout/cmake/StoutTestsConfigure.cmake
+++ b/3rdparty/libprocess/3rdparty/stout/cmake/StoutTestsConfigure.cmake
@@ -17,6 +17,15 @@
 find_package(Apr REQUIRED)
 find_package(Svn REQUIRED)
 
+# COMPILER CONFIGURATION.
+#########################
+if (APPLE)
+  # GTEST on OSX needs its own tr1 tuple.
+  # TODO(dhamon): Update to gmock 1.7 and pass GTEST_LANG_CXX11 when
+  # in C++11 mode.
+  add_definitions(-DGTEST_USE_OWN_TR1_TUPLE=1)
+endif (APPLE)
+
 # DEFINE PROCESS LIBRARY DEPENDENCIES. Tells the process library build targets
 # download/configure/build all third-party libraries before attempting to build.
 ################################################################################
@@ -83,11 +92,10 @@ set(STOUT_TEST_LIBS
   ${SVN_LIBS}
   )
 
-if (NOT WIN32)
-  find_library(LIBRT_LIBRARIES rt REQUIRED)
-
-  set(STOUT_TEST_LIBS
-    ${STOUT_TEST_LIBS}
-    ${LIBRT_LIBRARIES}
-    )
-endif (NOT WIN32)
+# TODO(hausdorff): The `LINUX` flag comes from MesosConfigure; when we
+# port the bootstrap script to CMake, we should also copy this logic
+# into .cmake files in the Stout and Process libraries' folders
+# individually.
+if (LINUX)
+  set(STOUT_TEST_LIBS ${STOUT_TEST_LIBS} rt)
+endif (LINUX)
\ No newline at end of file