2017-08-02 18:14:14 -07:00
|
|
|
cmake_minimum_required(VERSION 3.4)
|
2017-01-17 16:56:40 -08:00
|
|
|
|
|
|
|
project(ray)
|
|
|
|
|
2017-12-14 14:54:09 -08:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
|
|
|
|
|
|
|
|
# This ensures that things like gnu++11 get passed correctly
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
|
2018-07-18 12:33:02 -07:00
|
|
|
# Use old C++ ABI to be compatible with TensorFlow
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
|
|
|
|
|
2017-12-14 14:54:09 -08:00
|
|
|
# We require a C++11 compliant compiler
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
update ray cmake build process (#2853)
* use cmake to build ray project, no need to appply build.sh before cmake, fix some abuse of cmake, improve the build performance
* support boost external project, avoid using the system or build.sh boost
* keep compatible with build.sh, remove boost and arrow build from it.
* bugfix: parquet bison version control, plasma_java lib install problem
* bugfix: cmake, do not compile plasma java client if no need
* bugfix: component failures test timeout machenism has problem for plasma manager failed case
* bugfix: arrow use lib64 in centos, travis check-git-clang-format-output.sh does not support other branches except master
* revert some fix
* set arrow python executable, fix format error in component_failures_test.py
* make clean arrow python build directory
* update cmake code style, back to support cmake minimum version 3.4
2018-09-13 02:19:33 +08:00
|
|
|
# ray build options
|
|
|
|
option(RAY_BUILD_PYTHON
|
|
|
|
"build python library"
|
|
|
|
OFF)
|
|
|
|
|
|
|
|
option(RAY_BUILD_JAVA
|
|
|
|
"build java library"
|
|
|
|
OFF)
|
|
|
|
|
2017-12-14 14:54:09 -08:00
|
|
|
option(RAY_BUILD_STATIC
|
2017-12-26 16:22:04 -08:00
|
|
|
"Build the libray static libraries"
|
2017-12-14 14:54:09 -08:00
|
|
|
ON)
|
|
|
|
|
|
|
|
option(RAY_BUILD_SHARED
|
2017-12-26 16:22:04 -08:00
|
|
|
"Build the libray shared libraries"
|
2017-12-14 14:54:09 -08:00
|
|
|
ON)
|
|
|
|
|
|
|
|
option(RAY_BUILD_TESTS
|
|
|
|
"Build the Ray googletest unit tests"
|
|
|
|
ON)
|
|
|
|
|
2018-01-31 11:01:12 -08:00
|
|
|
option(RAY_USE_NEW_GCS
|
|
|
|
"Use the new GCS implementation"
|
|
|
|
OFF)
|
|
|
|
|
2018-08-24 00:43:38 +08:00
|
|
|
option(RAY_USE_GLOG
|
|
|
|
"Build the logging system using glog"
|
|
|
|
ON)
|
|
|
|
|
update ray cmake build process (#2853)
* use cmake to build ray project, no need to appply build.sh before cmake, fix some abuse of cmake, improve the build performance
* support boost external project, avoid using the system or build.sh boost
* keep compatible with build.sh, remove boost and arrow build from it.
* bugfix: parquet bison version control, plasma_java lib install problem
* bugfix: cmake, do not compile plasma java client if no need
* bugfix: component failures test timeout machenism has problem for plasma manager failed case
* bugfix: arrow use lib64 in centos, travis check-git-clang-format-output.sh does not support other branches except master
* revert some fix
* set arrow python executable, fix format error in component_failures_test.py
* make clean arrow python build directory
* update cmake code style, back to support cmake minimum version 3.4
2018-09-13 02:19:33 +08:00
|
|
|
if (RAY_BUILD_PYTHON)
|
|
|
|
set(CMAKE_RAY_LANG_PYTHON YES)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (RAY_BUILD_JAVA)
|
|
|
|
set(CMAKE_RAY_LANG_JAVA YES)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if ("${CMAKE_RAY_LANG_JAVA}" STREQUAL "NO" AND "${CMAKE_RAY_LANG_PYTHON}" STREQUAL "NO")
|
|
|
|
message(FATAL_ERROR "Please specify which language support you want to build by passing \
|
|
|
|
-DRAY_BUILD_PYTHON=on and/or -DRAY_BUILD_JAVA=on to CMake")
|
|
|
|
endif ()
|
|
|
|
|
2018-01-31 11:01:12 -08:00
|
|
|
if (RAY_USE_NEW_GCS)
|
|
|
|
add_definitions(-DRAY_USE_NEW_GCS)
|
|
|
|
endif()
|
|
|
|
|
2017-12-14 14:54:09 -08:00
|
|
|
include(ExternalProject)
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
include(BuildUtils)
|
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
include(ThirdpartyToolchain)
|
update ray cmake build process (#2853)
* use cmake to build ray project, no need to appply build.sh before cmake, fix some abuse of cmake, improve the build performance
* support boost external project, avoid using the system or build.sh boost
* keep compatible with build.sh, remove boost and arrow build from it.
* bugfix: parquet bison version control, plasma_java lib install problem
* bugfix: cmake, do not compile plasma java client if no need
* bugfix: component failures test timeout machenism has problem for plasma manager failed case
* bugfix: arrow use lib64 in centos, travis check-git-clang-format-output.sh does not support other branches except master
* revert some fix
* set arrow python executable, fix format error in component_failures_test.py
* make clean arrow python build directory
* update cmake code style, back to support cmake minimum version 3.4
2018-09-13 02:19:33 +08:00
|
|
|
include(Common)
|
2018-07-04 23:23:48 -07:00
|
|
|
|
|
|
|
# TODO(rkn): Fix all of this. This include is needed for the following
|
|
|
|
# reason. The local scheduler depends on tables.cc which depends on
|
|
|
|
# node_manager_generated.h which depends on gcs_generated.h. However,
|
|
|
|
# the include statement for gcs_generated.h doesn't include the file
|
|
|
|
# path, so we include the relevant directory here.
|
|
|
|
set(GCS_FBS_OUTPUT_DIRECTORY
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/src/ray/gcs/format")
|
|
|
|
include_directories(${GCS_FBS_OUTPUT_DIRECTORY})
|
|
|
|
|
|
|
|
|
2017-12-26 16:22:04 -08:00
|
|
|
include_directories(SYSTEM ${ARROW_INCLUDE_DIR})
|
|
|
|
include_directories(SYSTEM ${PLASMA_INCLUDE_DIR})
|
2017-12-14 14:54:09 -08:00
|
|
|
include_directories("${CMAKE_CURRENT_LIST_DIR}/src/")
|
2017-07-31 21:04:15 -07:00
|
|
|
|
2017-12-14 14:54:09 -08:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/ray/)
|
2017-01-17 16:56:40 -08:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/common/)
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/plasma/)
|
2017-02-27 12:24:07 -08:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/local_scheduler/)
|
2017-01-17 16:56:40 -08:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/global_scheduler/)
|
2018-06-02 07:28:27 +08:00
|
|
|
|
update ray cmake build process (#2853)
* use cmake to build ray project, no need to appply build.sh before cmake, fix some abuse of cmake, improve the build performance
* support boost external project, avoid using the system or build.sh boost
* keep compatible with build.sh, remove boost and arrow build from it.
* bugfix: parquet bison version control, plasma_java lib install problem
* bugfix: cmake, do not compile plasma java client if no need
* bugfix: component failures test timeout machenism has problem for plasma manager failed case
* bugfix: arrow use lib64 in centos, travis check-git-clang-format-output.sh does not support other branches except master
* revert some fix
* set arrow python executable, fix format error in component_failures_test.py
* make clean arrow python build directory
* update cmake code style, back to support cmake minimum version 3.4
2018-09-13 02:19:33 +08:00
|
|
|
# final target copy_ray
|
|
|
|
add_custom_target(copy_ray ALL)
|
|
|
|
|
|
|
|
# copy plasma_store_server
|
|
|
|
add_custom_command(TARGET copy_ray POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E
|
|
|
|
copy ${ARROW_HOME}/bin/plasma_store_server ${CMAKE_CURRENT_BINARY_DIR}/src/plasma)
|
|
|
|
|
2018-06-02 07:28:27 +08:00
|
|
|
if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES")
|
update ray cmake build process (#2853)
* use cmake to build ray project, no need to appply build.sh before cmake, fix some abuse of cmake, improve the build performance
* support boost external project, avoid using the system or build.sh boost
* keep compatible with build.sh, remove boost and arrow build from it.
* bugfix: parquet bison version control, plasma_java lib install problem
* bugfix: cmake, do not compile plasma java client if no need
* bugfix: component failures test timeout machenism has problem for plasma manager failed case
* bugfix: arrow use lib64 in centos, travis check-git-clang-format-output.sh does not support other branches except master
* revert some fix
* set arrow python executable, fix format error in component_failures_test.py
* make clean arrow python build directory
* update cmake code style, back to support cmake minimum version 3.4
2018-09-13 02:19:33 +08:00
|
|
|
# add pyarrow as the dependency
|
|
|
|
add_dependencies(copy_ray pyarrow_ext)
|
|
|
|
|
2018-06-02 07:28:27 +08:00
|
|
|
# NOTE: The lists below must be kept in sync with ray/python/setup.py.
|
|
|
|
|
|
|
|
set(ray_file_list
|
|
|
|
"src/common/thirdparty/redis/src/redis-server"
|
|
|
|
"src/common/redis_module/libray_redis_module.so"
|
|
|
|
"src/plasma/plasma_manager"
|
|
|
|
"src/local_scheduler/local_scheduler"
|
|
|
|
"src/local_scheduler/liblocal_scheduler_library_python.so"
|
|
|
|
"src/global_scheduler/global_scheduler"
|
|
|
|
"src/ray/raylet/raylet_monitor"
|
|
|
|
"src/ray/raylet/raylet")
|
|
|
|
|
|
|
|
if (RAY_USE_NEW_GCS)
|
|
|
|
list(APPEND ray_file_list "src/credis/build/src/libmember.so")
|
|
|
|
list(APPEND ray_file_list "src/credis/build/src/libmaster.so")
|
|
|
|
list(APPEND ray_file_list "src/credis/redis/src/redis-server")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (DEFINED ENV{INCLUDE_UI} AND "$ENV{INCLUDE_UI}" STREQUAL "1")
|
|
|
|
list(APPEND ray_file_list "src/catapult_files/index.html")
|
|
|
|
list(APPEND ray_file_list "src/catapult_files/trace_viewer_full.html")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(build_ray_file_list)
|
|
|
|
foreach(file ${ray_file_list})
|
|
|
|
list(APPEND build_ray_file_list ${CMAKE_BINARY_DIR}/${file})
|
|
|
|
endforeach()
|
|
|
|
|
2018-09-15 22:11:12 -07:00
|
|
|
add_custom_target(copy_ray_files DEPENDS ${build_ray_file_list} copy_redis ray_redis_module)
|
update ray cmake build process (#2853)
* use cmake to build ray project, no need to appply build.sh before cmake, fix some abuse of cmake, improve the build performance
* support boost external project, avoid using the system or build.sh boost
* keep compatible with build.sh, remove boost and arrow build from it.
* bugfix: parquet bison version control, plasma_java lib install problem
* bugfix: cmake, do not compile plasma java client if no need
* bugfix: component failures test timeout machenism has problem for plasma manager failed case
* bugfix: arrow use lib64 in centos, travis check-git-clang-format-output.sh does not support other branches except master
* revert some fix
* set arrow python executable, fix format error in component_failures_test.py
* make clean arrow python build directory
* update cmake code style, back to support cmake minimum version 3.4
2018-09-13 02:19:33 +08:00
|
|
|
add_dependencies(copy_ray copy_ray_files)
|
2018-06-22 06:18:00 +08:00
|
|
|
|
2018-06-08 20:41:54 -07:00
|
|
|
# Make sure that the Python extensions are built before copying the files.
|
update ray cmake build process (#2853)
* use cmake to build ray project, no need to appply build.sh before cmake, fix some abuse of cmake, improve the build performance
* support boost external project, avoid using the system or build.sh boost
* keep compatible with build.sh, remove boost and arrow build from it.
* bugfix: parquet bison version control, plasma_java lib install problem
* bugfix: cmake, do not compile plasma java client if no need
* bugfix: component failures test timeout machenism has problem for plasma manager failed case
* bugfix: arrow use lib64 in centos, travis check-git-clang-format-output.sh does not support other branches except master
* revert some fix
* set arrow python executable, fix format error in component_failures_test.py
* make clean arrow python build directory
* update cmake code style, back to support cmake minimum version 3.4
2018-09-13 02:19:33 +08:00
|
|
|
get_local_scheduler_library("python" LOCAL_SCHEDULER_LIBRARY_PYTHON)
|
|
|
|
add_dependencies(copy_ray ${LOCAL_SCHEDULER_LIBRARY_PYTHON})
|
2018-06-13 10:18:09 -07:00
|
|
|
|
2018-06-02 07:28:27 +08:00
|
|
|
foreach(file ${ray_file_list})
|
|
|
|
add_custom_command(TARGET copy_ray POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E
|
|
|
|
copy ${CMAKE_BINARY_DIR}/${file}
|
|
|
|
${CMAKE_BINARY_DIR}/../python/ray/core/${file})
|
|
|
|
endforeach()
|
update ray cmake build process (#2853)
* use cmake to build ray project, no need to appply build.sh before cmake, fix some abuse of cmake, improve the build performance
* support boost external project, avoid using the system or build.sh boost
* keep compatible with build.sh, remove boost and arrow build from it.
* bugfix: parquet bison version control, plasma_java lib install problem
* bugfix: cmake, do not compile plasma java client if no need
* bugfix: component failures test timeout machenism has problem for plasma manager failed case
* bugfix: arrow use lib64 in centos, travis check-git-clang-format-output.sh does not support other branches except master
* revert some fix
* set arrow python executable, fix format error in component_failures_test.py
* make clean arrow python build directory
* update cmake code style, back to support cmake minimum version 3.4
2018-09-13 02:19:33 +08:00
|
|
|
|
|
|
|
# copy plasma_store_server to python
|
|
|
|
add_custom_command(TARGET copy_ray POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E
|
|
|
|
copy ${ARROW_HOME}/bin/plasma_store_server ${CMAKE_SOURCE_DIR}/python/ray/core/src/plasma/)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if ("${CMAKE_RAY_LANG_JAVA}" STREQUAL "YES")
|
|
|
|
get_local_scheduler_library("java" LOCAL_SCHEDULER_LIBRARY_JAVA)
|
|
|
|
add_dependencies(copy_ray ${LOCAL_SCHEDULER_LIBRARY_JAVA})
|
|
|
|
|
|
|
|
# copy libplasma_java files
|
|
|
|
add_custom_command(TARGET copy_ray POST_BUILD
|
|
|
|
COMMAND bash -c "cp ${ARROW_HOME}/lib/libplasma_java.* ${CMAKE_CURRENT_BINARY_DIR}/src/plasma")
|
2018-06-02 07:28:27 +08:00
|
|
|
endif()
|