diff --git a/.gitignore b/.gitignore index 21d8edfc4f96..0ca3ea6da4a6 100644 --- a/.gitignore +++ b/.gitignore @@ -92,10 +92,6 @@ scripts/nodes.txt *.dSYM/ *.su -# CMake -cmake-build-debug/ -build - # Python setup files *.egg-info diff --git a/.travis.yml b/.travis.yml index 60c88509c6a6..b0122df25cae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -109,7 +109,6 @@ matrix: - python -m pytest -v --durations=5 --timeout=300 python/ray/tests/test_multi_node_2.py - python -m pytest -v --durations=5 --timeout=300 python/ray/tests/test_node_manager.py - # Build Linux wheels. - os: linux dist: trusty @@ -142,16 +141,6 @@ matrix: - ./ci/travis/test-wheels.sh - # Test GCS integration - - os: linux - dist: trusty - env: - - PYTHON=3.5 - - RAY_USE_NEW_GCS=on - - PYTHONWARNINGS=ignore - - RAY_USE_CMAKE=1 - - install: - eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py` - if [ $RAY_CI_TUNE_AFFECTED != "1" ] && [ $RAY_CI_RLLIB_AFFECTED != "1" ] && [ $RAY_CI_PYTHON_AFFECTED != "1" ]; then exit; fi diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 84236d4e9ce5..000000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,174 +0,0 @@ -cmake_minimum_required(VERSION 3.4) - -project(ray) - -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) - -# Use old C++ ABI to be compatible with TensorFlow -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0") - -# We require a C++11 compliant compiler -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -# ray build options -option(RAY_BUILD_PYTHON - "build python library" - OFF) - -option(RAY_BUILD_JAVA - "build java library" - OFF) - -option(RAY_BUILD_STATIC - "Build the libray static libraries" - ON) - -option(RAY_BUILD_SHARED - "Build the libray shared libraries" - ON) - -option(RAY_BUILD_TESTS - "Build the Ray googletest unit tests" - ON) - -option(RAY_USE_NEW_GCS - "Use the new GCS implementation" - OFF) - -option(RAY_USE_GLOG - "Build the logging system using glog" - ON) - -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 () - -if (RAY_USE_NEW_GCS) - add_definitions(-DRAY_USE_NEW_GCS) -endif() - -include(ExternalProject) -include(GNUInstallDirs) -include(BuildUtils) -enable_testing() - -include(ThirdpartyToolchain) -include(Common) - -# 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}) - - -include_directories(SYSTEM ${ARROW_INCLUDE_DIR}) -include_directories(SYSTEM ${PLASMA_INCLUDE_DIR}) -include_directories("${CMAKE_CURRENT_LIST_DIR}/src/") - -add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/ray/) - -# final target copy_ray -add_custom_target(copy_ray ALL) - -# copy plasma_store_server -add_custom_command(TARGET copy_ray POST_BUILD - COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/src/plasma - COMMAND ${CMAKE_COMMAND} -E - copy ${ARROW_HOME}/bin/plasma_store_server ${CMAKE_CURRENT_BINARY_DIR}/src/plasma/) - -if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES") - # add pyarrow as the dependency - add_dependencies(copy_ray pyarrow_ext) - - # NOTE: The lists below must be kept in sync with ray/python/setup.py. - - set(ray_file_list - "src/ray/thirdparty/redis/src/redis-server" - "src/ray/gcs/redis_module/libray_redis_module.so" - "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() - - # The goal of the if statement below is to require the catapult files to be - # present INCLUDE_UI=1 is set and to include the UI files if they are present. - # This should match the logic in build_ui.sh. - if (EXISTS "${CMAKE_BINARY_DIR}/src/catapult_files/index.html" OR "$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() - - add_custom_target(copy_ray_files DEPENDS ${build_ray_file_list} copy_redis ray_redis_module) - add_dependencies(copy_ray copy_ray_files) - - # Build Cython extensions - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/python) - - 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() - - # 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/) - - # copy Cython files - add_custom_command(TARGET copy_ray POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/python/_raylet.so ${CMAKE_SOURCE_DIR}/python/ray/) - -endif() - -if ("${CMAKE_RAY_LANG_JAVA}" STREQUAL "YES") - get_raylet_library("java" RAYLET_LIBRARY_JAVA) - add_dependencies(copy_ray ${RAYLET_LIBRARY_JAVA}) - - # Copy java native dependencies. - add_custom_command(TARGET copy_ray POST_BUILD - COMMAND mkdir -p ${CMAKE_SOURCE_DIR}/java/runtime/native_dependencies) - set(java_native_dependencies - "src/ray/thirdparty/redis/src/redis-server" - "src/ray/gcs/redis_module/libray_redis_module.so" - "src/ray/raylet/raylet" - "src/ray/raylet/libraylet_library_java.*") - foreach(file ${java_native_dependencies}) - add_custom_command(TARGET copy_ray POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${file} - ${CMAKE_SOURCE_DIR}/java/runtime/native_dependencies) - endforeach() -add_custom_command(TARGET copy_ray POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${ARROW_HOME}/bin/plasma_store_server - ${CMAKE_SOURCE_DIR}/java/runtime/native_dependencies) - add_custom_command(TARGET copy_ray POST_BUILD - COMMAND $(CMAKE_COMMAND) -E copy ${ARROW_LIBRARY_DIR}/libplasma_java.* - ${CMAKE_SOURCE_DIR}/java/runtime/native_dependencies) -endif() diff --git a/build.sh b/build.sh index c3b96ec5a79b..f7e027da83fc 100755 --- a/build.sh +++ b/build.sh @@ -13,7 +13,6 @@ function usage() echo echo "Options:" echo " -h|--help print the help info" - echo " -d|--debug CMAKE_BUILD_TYPE=Debug (default is RelWithDebInfo)" echo " -l|--language language1[,language2]" echo " a list of languages to build native libraries." echo " Supported languages include \"python\" and \"java\"." @@ -37,11 +36,6 @@ RAY_BUILD_PYTHON="YES" RAY_BUILD_JAVA="NO" PYTHON_EXECUTABLE="" BUILD_DIR="" -if [ "$VALGRIND" = "1" ]; then - CBUILD_TYPE="Debug" -else - CBUILD_TYPE="RelWithDebInfo" -fi # Parse options while [[ $# > 0 ]]; do @@ -51,9 +45,6 @@ while [[ $# > 0 ]]; do usage exit 0 ;; - -d|--debug) - CBUILD_TYPE=Debug - ;; -l|--languags) LANGUAGE="$2" RAY_BUILD_PYTHON="NO" @@ -101,36 +92,21 @@ fi pushd "$BUILD_DIR" -if [ ! -z "$RAY_USE_CMAKE" ] ; then - # avoid the command failed and exits - # and cmake will check some directories to determine whether some targets built - make clean || true - rm -rf external/arrow-install - - cmake -DCMAKE_BUILD_TYPE=$CBUILD_TYPE \ - -DCMAKE_RAY_LANG_JAVA=$RAY_BUILD_JAVA \ - -DCMAKE_RAY_LANG_PYTHON=$RAY_BUILD_PYTHON \ - -DRAY_USE_NEW_GCS=$RAY_USE_NEW_GCS \ - -DPYTHON_EXECUTABLE:FILEPATH=$PYTHON_EXECUTABLE $ROOT_DIR - - make -j${PARALLEL} -else - # The following line installs pyarrow from S3, these wheels have been - # generated from https://github.com/ray-project/arrow-build from - # the commit listed in the command. - $PYTHON_EXECUTABLE -m pip install \ - --target=$ROOT_DIR/python/ray/pyarrow_files pyarrow==0.12.0.RAY \ - --find-links https://s3-us-west-2.amazonaws.com/arrow-wheels/ca1fa51f0901f5a4298f0e4faea00f24e5dd7bb7/index.html - export PYTHON_BIN_PATH="$PYTHON_EXECUTABLE" - - if [ "$RAY_BUILD_JAVA" == "YES" ]; then - bazel run //java:bazel_deps -- generate -r $ROOT_DIR -s java/third_party/workspace.bzl -d java/dependencies.yaml - bazel build //java:all --verbose_failures - fi +# The following line installs pyarrow from S3, these wheels have been +# generated from https://github.com/ray-project/arrow-build from +# the commit listed in the command. +$PYTHON_EXECUTABLE -m pip install \ + --target=$ROOT_DIR/python/ray/pyarrow_files pyarrow==0.12.0.RAY \ + --find-links https://s3-us-west-2.amazonaws.com/arrow-wheels/ca1fa51f0901f5a4298f0e4faea00f24e5dd7bb7/index.html +export PYTHON_BIN_PATH="$PYTHON_EXECUTABLE" + +if [ "$RAY_BUILD_JAVA" == "YES" ]; then + bazel run //java:bazel_deps -- generate -r $ROOT_DIR -s java/third_party/workspace.bzl -d java/dependencies.yaml + bazel build //java:all --verbose_failures +fi - if [ "$RAY_BUILD_PYTHON" == "YES" ]; then - bazel build //:ray_pkg --verbose_failures - fi +if [ "$RAY_BUILD_PYTHON" == "YES" ]; then + bazel build //:ray_pkg --verbose_failures fi popd diff --git a/ci/long_running_tests/config.yaml b/ci/long_running_tests/config.yaml index e15fee7fe6a9..b67a2b969726 100644 --- a/ci/long_running_tests/config.yaml +++ b/ci/long_running_tests/config.yaml @@ -47,7 +47,7 @@ setup_commands: - pip install boto3==1.4.8 cython==0.29.0 # # Uncomment the following if you wish to install Ray instead. # - sudo apt-get update - # - sudo apt-get install -y cmake pkg-config build-essential autoconf curl libtool unzip flex bison python + # - sudo apt-get install -y build-essential curl unzip # - git clone https://github.com/ray-project/ray || true # - cd ray/python; git checkout master; git pull; pip install -e . --verbose # Install nightly Ray wheels. diff --git a/ci/stress_tests/stress_testing_config.yaml b/ci/stress_tests/stress_testing_config.yaml index 47c7dbf3e8d2..3ea6f7f717a3 100644 --- a/ci/stress_tests/stress_testing_config.yaml +++ b/ci/stress_tests/stress_testing_config.yaml @@ -91,7 +91,7 @@ setup_commands: # - sudo dpkg --configure -a # Install basics. - sudo apt-get update - - sudo apt-get install -y cmake pkg-config build-essential autoconf curl libtool unzip flex bison python + - sudo apt-get install -y build-essential curl unzip # Install Anaconda. - wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh || true - bash Anaconda3-5.0.1-Linux-x86_64.sh -b -p $HOME/anaconda3 || true diff --git a/ci/travis/install-dependencies.sh b/ci/travis/install-dependencies.sh index fb4bc5ac077d..13d472a5535d 100755 --- a/ci/travis/install-dependencies.sh +++ b/ci/travis/install-dependencies.sh @@ -36,15 +36,6 @@ elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then pip install -q scipy tensorflow cython==0.29.0 gym opencv-python-headless pyyaml pandas==0.23.4 requests \ feather-format lxml openpyxl xlrd py-spy setproctitle pytest-timeout flaky networkx tabulate psutil elif [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "macosx" ]]; then - # check that brew is installed - which -s brew - if [[ $? != 0 ]]; then - echo "Could not find brew, please install brew (see http://brew.sh/)." - exit 1 - else - echo "Updating brew." - brew update > /dev/null - fi # Install miniconda. wget https://repo.continuum.io/miniconda/Miniconda2-4.5.4-MacOSX-x86_64.sh -O miniconda.sh -nv bash miniconda.sh -b -p $HOME/miniconda @@ -52,15 +43,6 @@ elif [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "macosx" ]]; then pip install -q cython==0.29.0 tensorflow gym opencv-python-headless pyyaml pandas==0.23.4 requests \ feather-format lxml openpyxl xlrd py-spy setproctitle faulthandler pytest-timeout mock flaky networkx tabulate psutil elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "macosx" ]]; then - # check that brew is installed - which -s brew - if [[ $? != 0 ]]; then - echo "Could not find brew, please install brew (see http://brew.sh/)." - exit 1 - else - echo "Updating brew." - brew update > /dev/null - fi # Install miniconda. wget https://repo.continuum.io/miniconda/Miniconda3-4.5.4-MacOSX-x86_64.sh -O miniconda.sh -nv bash miniconda.sh -b -p $HOME/miniconda @@ -80,18 +62,7 @@ elif [[ "$LINUX_WHEELS" == "1" ]]; then sudo apt-get install docker sudo usermod -a -G docker travis elif [[ "$MAC_WHEELS" == "1" ]]; then - which -s brew - if [[ $? != 0 ]]; then - echo "Could not find brew, please install brew (see http://brew.sh/)." - exit 1 - else - echo "Updating brew." - brew update > /dev/null - fi - brew install cmake pkg-config automake autoconf libtool openssl bison > /dev/null - # We use true to avoid exiting with an error code because the brew install can - # fail if a package is already installed. - true + : else echo "Unrecognized environment." exit 1 diff --git a/cmake/Modules/ArrowExternalProject.cmake b/cmake/Modules/ArrowExternalProject.cmake deleted file mode 100644 index 31dccb1add16..000000000000 --- a/cmake/Modules/ArrowExternalProject.cmake +++ /dev/null @@ -1,119 +0,0 @@ -# arrow external project -# target: -# - arrow_ep -# depends: -# -# this module defines: -# - ARROW_HOME -# - ARROW_SOURCE_DIR -# - ARROW_INCLUDE_DIR -# - ARROW_SHARED_LIB -# - ARROW_STATIC_LIB -# - ARROW_LIBRARY_DIR -# - PLASMA_INCLUDE_DIR -# - PLASMA_STATIC_LIB -# - PLASMA_SHARED_LIB - -set(arrow_URL https://github.com/ray-project/arrow.git) -# This commit is based on https://github.com/apache/arrow/pull/3526. We -# include the link here to make it easier to find the right commit because -# Arrow often rewrites git history and invalidates certain commits. -# It has been patched to fix an upstream symbol clash with TensorFlow, -# the patch is available at -# https://github.com/ray-project/arrow/commit/68299c5f48289c4f39a948cbd0426b9199a9df1e -# See the discussion in https://github.com/apache/arrow/pull/3177 -# WARNING: If the arrow version is updated, you need to also update the -# SETUPTOOLS_SCM_PRETEND_VERSION version string in the ThirdpartyToolchain.cmake -# file -set(arrow_TAG 68299c5f48289c4f39a948cbd0426b9199a9df1e) - -set(ARROW_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/arrow-install) -set(ARROW_HOME ${ARROW_INSTALL_PREFIX}) -set(ARROW_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/external/arrow/src/arrow_ep) - -set(ARROW_INCLUDE_DIR ${ARROW_HOME}/include) -set(ARROW_LIBRARY_DIR ${ARROW_HOME}/lib${LIB_SUFFIX}) -set(ARROW_SHARED_LIB ${ARROW_LIBRARY_DIR}/libarrow${CMAKE_SHARED_LIBRARY_SUFFIX}) -set(ARROW_STATIC_LIB ${ARROW_LIBRARY_DIR}/libarrow.a) - -# plasma in arrow -set(PLASMA_INCLUDE_DIR ${ARROW_HOME}/include) -set(PLASMA_SHARED_LIB ${ARROW_LIBRARY_DIR}/libplasma${CMAKE_SHARED_LIBRARY_SUFFIX}) -set(PLASMA_STATIC_LIB ${ARROW_LIBRARY_DIR}/libplasma.a) - -find_package(PythonInterp REQUIRED) -message(STATUS "PYTHON_EXECUTABLE for arrow: ${PYTHON_EXECUTABLE}") - -set(ARROW_CMAKE_ARGS - -DCMAKE_BUILD_TYPE:STRING=Release - -DCMAKE_INSTALL_PREFIX=${ARROW_INSTALL_PREFIX} - -DCMAKE_C_FLAGS=-g -O3 ${EP_C_FLAGS} - -DCMAKE_CXX_FLAGS=-g -O3 ${EP_CXX_FLAGS} - -DARROW_BUILD_TESTS=off - -DARROW_HDFS=on - -DARROW_BOOST_USE_SHARED=off - -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE} - -DARROW_PYTHON=on - -DARROW_PLASMA=on - -DARROW_TENSORFLOW=on - -DARROW_JEMALLOC=off - -DARROW_WITH_BROTLI=off - -DARROW_WITH_LZ4=on - -DARROW_WITH_ZSTD=off - -DFLATBUFFERS_HOME=${FLATBUFFERS_HOME} - -DBOOST_ROOT=${BOOST_ROOT} - -DGLOG_HOME=${GLOG_HOME}) - -if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES") - # PyArrow needs following settings. - set(ARROW_CMAKE_ARGS ${ARROW_CMAKE_ARGS} - -DARROW_WITH_THRIFT=ON - -DARROW_PARQUET=ON - -DARROW_WITH_ZLIB=ON) -else() - set(ARROW_CMAKE_ARGS ${ARROW_CMAKE_ARGS} - -DARROW_WITH_THRIFT=OFF - -DARROW_PARQUET=OFF - -DARROW_WITH_ZLIB=OFF) -endif () -if (APPLE) - set(ARROW_CMAKE_ARGS ${ARROW_CMAKE_ARGS} - -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison) -endif() - -if ("${CMAKE_RAY_LANG_JAVA}" STREQUAL "YES") - set(ARROW_CMAKE_ARGS ${ARROW_CMAKE_ARGS} -DARROW_PLASMA_JAVA_CLIENT=ON) -endif () - -message(STATUS "ARROW_CMAKE_ARGS: ${ARROW_CMAKE_ARGS}") - -if (CMAKE_VERSION VERSION_GREATER "3.7") - set(ARROW_CONFIGURE SOURCE_SUBDIR "cpp" CMAKE_ARGS ${ARROW_CMAKE_ARGS}) -else() - set(ARROW_CONFIGURE CONFIGURE_COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" - ${ARROW_CMAKE_ARGS} "${ARROW_SOURCE_DIR}/cpp") -endif() - -ExternalProject_Add(arrow_ep - PREFIX external/arrow - DEPENDS flatbuffers boost glog - GIT_REPOSITORY ${arrow_URL} - GIT_TAG ${arrow_TAG} - UPDATE_COMMAND "" - ${ARROW_CONFIGURE} - BUILD_BYPRODUCTS "${ARROW_SHARED_LIB}" "${ARROW_STATIC_LIB}") - -if ("${CMAKE_RAY_LANG_JAVA}" STREQUAL "YES") - set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${ARROW_SOURCE_DIR}/java/target/") - - if(NOT EXISTS ${ARROW_SOURCE_DIR}/java/target/) - ExternalProject_Add_Step(arrow_ep arrow_ep_install_java_lib - COMMAND bash -c "cd ${ARROW_SOURCE_DIR}/java && mvn clean install -pl plasma -am -Dmaven.test.skip > /dev/null" - DEPENDEES build) - endif() - - # add install of library plasma_java, it is not configured in plasma CMakeLists.txt - ExternalProject_Add_Step(arrow_ep arrow_ep_install_plasma_java - COMMAND bash -c "cp -rf ${CMAKE_CURRENT_BINARY_DIR}/external/arrow/src/arrow_ep-build/release/libplasma_java.* ${ARROW_LIBRARY_DIR}/" - DEPENDEES install) -endif () diff --git a/cmake/Modules/BoostExternalProject.cmake b/cmake/Modules/BoostExternalProject.cmake deleted file mode 100644 index b5b19cd2f4a4..000000000000 --- a/cmake/Modules/BoostExternalProject.cmake +++ /dev/null @@ -1,69 +0,0 @@ -# Boost external project -# target: -# - boost_ep -# defines: -# - Boost_INCLUDE_DIR -# - Boost_SYSTEM_LIBRARY -# - Boost_FILESYSTEM_LIBRARY -# - Boost_THREAD_LIBRARY - -option(RAY_BUILD_BOOST "Whether to build boost locally" ON) - -# Set the required boost version. -set(BOOST_MAJOR_VERSION 1) -set(BOOST_MINOR_VERSION 68) -set(BOOST_SUBMINOR_VERSION 0) -set(TARGET_BOOST_VERSION ${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_SUBMINOR_VERSION}) - -# boost is a stable library in ray, and it supports to find -# the boost pre-built in environment to speed up build process -if (DEFINED ENV{RAY_BOOST_ROOT} AND EXISTS $ENV{RAY_BOOST_ROOT}) - set(Boost_USE_STATIC_LIBS ON) - set(BOOST_ROOT "$ENV{RAY_BOOST_ROOT}") - find_package(Boost ${TARGET_BOOST_VERSION} COMPONENTS system filesystem thread) - if (Boost_FOUND) - # If there is a newer version of Boost, there will be a warning message and Boost_FOUND is true. - set(FOUND_BOOST_VERSION ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}) - if (${TARGET_BOOST_VERSION} STREQUAL ${FOUND_BOOST_VERSION}) - set(RAY_BUILD_BOOST OFF) - set(Boost_INCLUDE_DIR ${Boost_INCLUDE_DIRS}) - # Boost_SYSTEM_LIBRARY, Boost_FILESYSTEM_LIBRARY, Boost_THREAD_LIBRARY will be set by find_package(Boost). - add_custom_target(boost_ep) - else() - message("Required Boost Version ${TARGET_BOOST_VERSION} does not match the path: $ENV{RAY_BOOST_ROOT}. Will build Boost Locally.") - endif() - endif(Boost_FOUND) -endif() - -if (RAY_BUILD_BOOST) - set(Boost_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/boost-install) - - set(Boost_INCLUDE_DIR ${Boost_INSTALL_PREFIX}/include) - set(BOOST_ROOT ${Boost_INSTALL_PREFIX}) - set(Boost_LIBRARY_DIR ${Boost_INSTALL_PREFIX}/lib) - set(Boost_SYSTEM_LIBRARY ${Boost_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}boost_system${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(Boost_THREAD_LIBRARY ${Boost_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}boost_thread${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(Boost_FILESYSTEM_LIBRARY ${Boost_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}boost_filesystem${CMAKE_STATIC_LIBRARY_SUFFIX}) - - #set(boost_URL https://github.com/boostorg/boost.git) - #set(boost_TAG boost-1.68.0) - - set(Boost_TAR_GZ_URL http://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz) - set(Boost_BUILD_PRODUCTS ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}) - set(Boost_URL_MD5 "5d8b4503582fffa9eefdb9045359c239") - - set(Boost_USE_STATIC_LIBS ON) - - ExternalProject_Add(boost_ep - PREFIX external/boost - URL ${Boost_TAR_GZ_URL} - URL_MD5 ${Boost_URL_MD5} - # GIT_REPOSITORY ${boost_URL} - # GIT_TAG ${boost_TAG} - # GIT_SUBMODULES "" - BUILD_IN_SOURCE 1 - BUILD_BYPRODUCTS ${Boost_BUILD_PRODUCTS} - CONFIGURE_COMMAND ./bootstrap.sh - BUILD_COMMAND bash -c "./b2 cxxflags=\"-fPIC -D_GLIBCXX_USE_CXX11_ABI=0\" cflags=-fPIC variant=release link=static --with-filesystem --with-system --with-thread --with-atomic --with-chrono --with-date_time --with-regex -j8 install --prefix=${Boost_INSTALL_PREFIX} > /dev/null" - INSTALL_COMMAND "") -endif () diff --git a/cmake/Modules/BuildUtils.cmake b/cmake/Modules/BuildUtils.cmake deleted file mode 100644 index cd8a107b49be..000000000000 --- a/cmake/Modules/BuildUtils.cmake +++ /dev/null @@ -1,238 +0,0 @@ -function(ADD_THIRDPARTY_LIB LIB_NAME) - set(options) - set(one_value_args SHARED_LIB STATIC_LIB) - set(multi_value_args DEPS) - cmake_parse_arguments(ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) - if(ARG_UNPARSED_ARGUMENTS) - message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") - endif() - - if(ARG_STATIC_LIB AND ARG_SHARED_LIB) - if(NOT ARG_STATIC_LIB) - message(FATAL_ERROR "No static or shared library provided for ${LIB_NAME}") - endif() - - SET(AUG_LIB_NAME "${LIB_NAME}_static") - add_library(${AUG_LIB_NAME} STATIC IMPORTED) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_STATIC_LIB}") - message("Added static library dependency ${LIB_NAME}: ${ARG_STATIC_LIB}") - - SET(AUG_LIB_NAME "${LIB_NAME}_shared") - add_library(${AUG_LIB_NAME} SHARED IMPORTED) - - if(MSVC) - # Mark the ”.lib” location as part of a Windows DLL - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_IMPLIB "${ARG_SHARED_LIB}") - else() - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_SHARED_LIB}") - endif() - if(ARG_DEPS) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${ARG_DEPS}") - endif() - message("Added shared library dependency ${LIB_NAME}: ${ARG_SHARED_LIB}") - elseif(ARG_STATIC_LIB) - add_library(${LIB_NAME} STATIC IMPORTED) - set_target_properties(${LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_STATIC_LIB}") - SET(AUG_LIB_NAME "${LIB_NAME}_static") - add_library(${AUG_LIB_NAME} STATIC IMPORTED) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_STATIC_LIB}") - if(ARG_DEPS) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${ARG_DEPS}") - endif() - message("Added static library dependency ${LIB_NAME}: ${ARG_STATIC_LIB}") - elseif(ARG_SHARED_LIB) - add_library(${LIB_NAME} SHARED IMPORTED) - set_target_properties(${LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_SHARED_LIB}") - SET(AUG_LIB_NAME "${LIB_NAME}_shared") - add_library(${AUG_LIB_NAME} SHARED IMPORTED) - - if(MSVC) - # Mark the ”.lib” location as part of a Windows DLL - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_IMPLIB "${ARG_SHARED_LIB}") - else() - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_SHARED_LIB}") - endif() - message("Added shared library dependency ${LIB_NAME}: ${ARG_SHARED_LIB}") - if(ARG_DEPS) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${ARG_DEPS}") - endif() - else() - message(FATAL_ERROR "No static or shared library provided for ${LIB_NAME}") - endif() -endfunction() - -function(ADD_RAY_LIB LIB_NAME) - set(options) - set(one_value_args SHARED_LINK_FLAGS) - set(multi_value_args SOURCES STATIC_LINK_LIBS STATIC_PRIVATE_LINK_LIBS SHARED_LINK_LIBS SHARED_PRIVATE_LINK_LIBS DEPENDENCIES) - cmake_parse_arguments(ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) - if(ARG_UNPARSED_ARGUMENTS) - message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") - endif() - - add_library(${LIB_NAME}_objlib OBJECT - ${ARG_SOURCES} - ) - - if (ARG_DEPENDENCIES) - add_dependencies(${LIB_NAME}_objlib ${ARG_DEPENDENCIES}) - endif() - - # Necessary to make static linking into other shared libraries work properly - set_property(TARGET ${LIB_NAME}_objlib PROPERTY POSITION_INDEPENDENT_CODE 1) - - set(RUNTIME_INSTALL_DIR bin) - - if (RAY_BUILD_SHARED) - add_library(${LIB_NAME}_shared SHARED $) - - if(APPLE) - # On OS X, you can avoid linking at library load time and instead - # expecting that the symbols have been loaded separately. This happens - # with libpython* where there can be conflicts between system Python and - # the Python from a thirdparty distribution - set(ARG_SHARED_LINK_FLAGS - "-undefined dynamic_lookup ${ARG_SHARED_LINK_FLAGS}") - endif() - - set_target_properties(${LIB_NAME}_shared - PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}" - RUNTIME_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}" - PDB_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}" - LINK_FLAGS "${ARG_SHARED_LINK_FLAGS}" - OUTPUT_NAME ${LIB_NAME} - VERSION "${RAY_ABI_VERSION}" - SOVERSION "${RAY_SO_VERSION}") - - target_link_libraries(${LIB_NAME}_shared - LINK_PUBLIC ${ARG_SHARED_LINK_LIBS} - LINK_PRIVATE ${ARG_SHARED_PRIVATE_LINK_LIBS}) - - if (RAY_RPATH_ORIGIN) - if (APPLE) - set(_lib_install_rpath "@loader_path") - else() - set(_lib_install_rpath "\$ORIGIN") - endif() - set_target_properties(${LIB_NAME}_shared PROPERTIES - INSTALL_RPATH ${_lib_install_rpath}) - endif() - - install(TARGETS ${LIB_NAME}_shared - RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - - if (RAY_BUILD_STATIC) - if (MSVC) - set(LIB_NAME_STATIC ${LIB_NAME}_static) - else() - set(LIB_NAME_STATIC ${LIB_NAME}) - endif() - add_library(${LIB_NAME}_static STATIC $) - set_target_properties(${LIB_NAME}_static - PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}" - OUTPUT_NAME ${LIB_NAME_STATIC}) - - target_link_libraries(${LIB_NAME}_static - LINK_PUBLIC ${ARG_STATIC_LINK_LIBS} - LINK_PRIVATE ${ARG_STATIC_PRIVATE_LINK_LIBS}) - - install(TARGETS ${LIB_NAME}_static - RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() - - if (APPLE) - set_target_properties(${LIB_NAME}_shared - PROPERTIES - BUILD_WITH_INSTALL_RPATH ON - INSTALL_NAME_DIR "@rpath") - endif() - -endfunction() - -############################################################ -# Testing -############################################################ -# Add a new test case, with or without an executable that should be built. -# -# REL_TEST_NAME is the name of the test. It may be a single component -# (e.g. monotime-test) or contain additional components (e.g. -# net/net_util-test). Either way, the last component must be a globally -# unique name. -# -# The unit test is added with a label of "unittest" to support filtering with -# ctest. -# -# Arguments after the test name will be passed to set_tests_properties(). -function(ADD_RAY_TEST REL_TEST_NAME) - set(options NO_VALGRIND) - set(single_value_args) - set(multi_value_args STATIC_LINK_LIBS) - cmake_parse_arguments(ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) - if(ARG_UNPARSED_ARGUMENTS) - message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") - endif() - - if(NO_TESTS OR NOT RAY_BUILD_STATIC) - return() - endif() - get_filename_component(TEST_NAME ${REL_TEST_NAME} NAME_WE) - - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${REL_TEST_NAME}.cc) - # This test has a corresponding .cc file, set it up as an executable. - set(TEST_PATH "${EXECUTABLE_OUTPUT_PATH}/${TEST_NAME}") - add_executable(${TEST_NAME} "${REL_TEST_NAME}.cc") - - if (ARG_STATIC_LINK_LIBS) - # Customize link libraries - target_link_libraries(${TEST_NAME} ${ARG_STATIC_LINK_LIBS}) - else() - target_link_libraries(${TEST_NAME} ${RAY_TEST_LINK_LIBS}) - endif() - add_dependencies(unittest ${TEST_NAME}) - else() - # No executable, just invoke the test (probably a script) directly. - set(TEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${REL_TEST_NAME}) - endif() - - if (RAY_TEST_MEMCHECK AND NOT ARG_NO_VALGRIND) - SET_PROPERTY(TARGET ${TEST_NAME} - APPEND_STRING PROPERTY - COMPILE_FLAGS " -RAY_VALGRIND") - add_test(${TEST_NAME} - bash -c "cd ${EXECUTABLE_OUTPUT_PATH}; valgrind --tool=memcheck --leak-check=full --leak-check-heuristics=stdstring --error-exitcode=1 ${TEST_PATH}") - elseif(MSVC) - add_test(${TEST_NAME} ${TEST_PATH}) - else() - add_test(${TEST_NAME} - ${BUILD_SUPPORT_DIR}/run-test.sh ${CMAKE_BINARY_DIR} test ${TEST_PATH}) - endif() - set_tests_properties(${TEST_NAME} PROPERTIES LABELS "unittest") -endfunction() - -# A wrapper for target_link_libraries() that is compatible with NO_TESTS. -function(RAY_TEST_LINK_LIBRARIES REL_TEST_NAME) - if(NO_TESTS) - return() - endif() - get_filename_component(TEST_NAME ${REL_TEST_NAME} NAME_WE) - - target_link_libraries(${TEST_NAME} ${ARGN}) -endfunction() diff --git a/cmake/Modules/Common.cmake b/cmake/Modules/Common.cmake deleted file mode 100644 index 7d33f13e9d45..000000000000 --- a/cmake/Modules/Common.cmake +++ /dev/null @@ -1,43 +0,0 @@ -# Code for compiling flatbuffers - -include(ExternalProject) -include(CMakeParseArguments) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -Werror -Wall -Wno-error=unused-function -Wno-error=strict-aliasing") - -# The rdynamic flag is needed to produce better backtraces on Linux. -if(UNIX AND NOT APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic") -endif() - -# Custom CFLAGS - -set(CMAKE_C_FLAGS "-g -Wall -Wextra -Werror=implicit-function-declaration -Wno-sign-compare -Wno-unused-parameter -Wno-type-limits -Wno-missing-field-initializers --std=c99 -fPIC -std=c99") - -# language-specific -if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES") - # Code for finding Python - find_package(PythonInterp REQUIRED) - find_package(NumPy REQUIRED) - - # Now find the Python include directories. - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import *; print(get_python_inc())" - OUTPUT_VARIABLE PYTHON_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE) - message(STATUS "PYTHON_INCLUDE_DIRS: " ${PYTHON_INCLUDE_DIRS}) - - message(STATUS "Using PYTHON_EXECUTABLE: " ${PYTHON_EXECUTABLE}) - message(STATUS "Using PYTHON_INCLUDE_DIRS: " ${PYTHON_INCLUDE_DIRS}) -endif () - -if ("${CMAKE_RAY_LANG_JAVA}" STREQUAL "YES") - find_package(JNI REQUIRED) - # add jni support - include_directories(${JAVA_INCLUDE_PATH}) - include_directories(${JAVA_INCLUDE_PATH2}) - if (JNI_FOUND) - message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") - message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}") - else() - message (WARNING "NOT FIND JNI") - endif() -endif() diff --git a/cmake/Modules/FindNumPy.cmake b/cmake/Modules/FindNumPy.cmake deleted file mode 100644 index 037dbdb5fdbd..000000000000 --- a/cmake/Modules/FindNumPy.cmake +++ /dev/null @@ -1,54 +0,0 @@ -# - Find the NumPy libraries -# This module finds if NumPy is installed, and sets the following variables -# indicating where it is. -# -# -# NUMPY_FOUND - was NumPy found -# NUMPY_VERSION - the version of NumPy found as a string -# NUMPY_VERSION_MAJOR - the major version number of NumPy -# NUMPY_VERSION_MINOR - the minor version number of NumPy -# NUMPY_VERSION_PATCH - the patch version number of NumPy -# NUMPY_VERSION_DECIMAL - e.g. version 1.6.1 is 10601 -# NUMPY_INCLUDE_DIR - path to the NumPy include files - -unset(NUMPY_VERSION) -unset(NUMPY_INCLUDE_DIR) - -if(PYTHONINTERP_FOUND) - execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" - "import numpy as n; print(n.__version__); print(n.get_include());" - RESULT_VARIABLE __result - OUTPUT_VARIABLE __output - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(__result MATCHES 0) - string(REGEX REPLACE ";" "\\\\;" __values ${__output}) - string(REGEX REPLACE "\r?\n" ";" __values ${__values}) - list(GET __values 0 NUMPY_VERSION) - list(GET __values 1 NUMPY_INCLUDE_DIR) - - string(REGEX MATCH "^([0-9])+\\.([0-9])+\\.([0-9])+" __ver_check "${NUMPY_VERSION}") - if(NOT "${__ver_check}" STREQUAL "") - set(NUMPY_VERSION_MAJOR ${CMAKE_MATCH_1}) - set(NUMPY_VERSION_MINOR ${CMAKE_MATCH_2}) - set(NUMPY_VERSION_PATCH ${CMAKE_MATCH_3}) - math(EXPR NUMPY_VERSION_DECIMAL - "(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}") - string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIR ${NUMPY_INCLUDE_DIR}) - else() - unset(NUMPY_VERSION) - unset(NUMPY_INCLUDE_DIR) - message(STATUS "Requested NumPy version and include path, but got instead:\n${__output}\n") - endif() - endif() -else() - message(STATUS "To find NumPy Python interpreter is required to be found.") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(NumPy REQUIRED_VARS NUMPY_INCLUDE_DIR NUMPY_VERSION - VERSION_VAR NUMPY_VERSION) - -if(NUMPY_FOUND) - message(STATUS "NumPy ver. ${NUMPY_VERSION} found (include: ${NUMPY_INCLUDE_DIR})") -endif() diff --git a/cmake/Modules/FindRay.cmake b/cmake/Modules/FindRay.cmake deleted file mode 100644 index 815a5aa42f5c..000000000000 --- a/cmake/Modules/FindRay.cmake +++ /dev/null @@ -1,77 +0,0 @@ -# - Find RAY -# This module defines -# RAY_INCLUDE_DIR, directory containing headers -# RAY_LIBS, directory containing ray libraries -# RAY_STATIC_LIB, path to static library -# RAY_SHARED_LIB, path to shared library -# RAY_FOUND, whether ray has been found - -include(FindPkgConfig) - -if ("$ENV{RAY_HOME}" STREQUAL "") - pkg_check_modules(RAY ray) - if (RAY_FOUND) - pkg_get_variable(RAY_ABI_VERSION ray abi_version) - message(STATUS "Ray ABI version: ${RAY_ABI_VERSION}") - pkg_get_variable(RAY_SO_VERSION ray so_version) - message(STATUS "Ray SO version: ${RAY_SO_VERSION}") - set(RAY_INCLUDE_DIR ${RAY_INCLUDE_DIRS}) - set(RAY_LIBS ${RAY_LIBRARY_DIRS}) - set(RAY_SEARCH_LIB_PATH ${RAY_LIBRARY_DIRS}) - endif() -else() - set(RAY_HOME "$ENV{RAY_HOME}") - - set(RAY_SEARCH_HEADER_PATHS - ${RAY_HOME}/include - ) - - set(RAY_SEARCH_LIB_PATH - ${RAY_HOME}/lib - ) - - find_path(RAY_INCLUDE_DIR ray/gcs/client.h PATHS - ${RAY_SEARCH_HEADER_PATHS} - # make sure we don't accidentally pick up a different version - NO_DEFAULT_PATH - ) -endif() - -find_library(RAY_LIB_PATH NAMES ray - PATHS - ${RAY_SEARCH_LIB_PATH} - NO_DEFAULT_PATH) -get_filename_component(RAY_LIBS ${RAY_LIB_PATH} DIRECTORY) - -if (RAY_INCLUDE_DIR AND RAY_LIBS) - set(RAY_FOUND TRUE) - set(RAY_LIB_NAME ray) - - set(RAY_STATIC_LIB ${RAY_LIBS}/lib${RAY_LIB_NAME}.a) - - set(RAY_SHARED_LIB ${RAY_LIBS}/lib${RAY_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) -endif() - -if (RAY_FOUND) - if (NOT Ray_FIND_QUIETLY) - message(STATUS "Found the Ray core library: ${RAY_LIB_PATH}") - endif () -else () - if (NOT Ray_FIND_QUIETLY) - set(RAY_ERR_MSG "Could not find the Ray library. Looked for headers") - set(RAY_ERR_MSG "${RAY_ERR_MSG} in ${RAY_SEARCH_HEADER_PATHS}, and for libs") - set(RAY_ERR_MSG "${RAY_ERR_MSG} in ${RAY_SEARCH_LIB_PATH}") - if (Ray_FIND_REQUIRED) - message(FATAL_ERROR "${RAY_ERR_MSG}") - else (Ray_FIND_REQUIRED) - message(STATUS "${RAY_ERR_MSG}") - endif (Ray_FIND_REQUIRED) - endif () - set(RAY_FOUND FALSE) -endif () - -mark_as_advanced( - RAY_INCLUDE_DIR - RAY_STATIC_LIB - RAY_SHARED_LIB -) diff --git a/cmake/Modules/FlatBuffersExternalProject.cmake b/cmake/Modules/FlatBuffersExternalProject.cmake deleted file mode 100644 index 15be464491cc..000000000000 --- a/cmake/Modules/FlatBuffersExternalProject.cmake +++ /dev/null @@ -1,43 +0,0 @@ -# flatbuffers external project -# target: -# - flatbuffer_ep -# depends: -# -# defines: -# - FLATBUFFERS_HOME -# - FLATBUFFERS_INCLUDE_DIR -# - FLATBUFFERS_STATIC_LIB -# - FLATBUFFERS_COMPILER -# - FBS_DEPENDS, to keep compatible - -if(DEFINED ENV{RAY_FLATBUFFERS_HOME} AND EXISTS $ENV{RAY_FLATBUFFERS_HOME}) - set(FLATBUFFERS_HOME "$ENV{RAY_FLATBUFFERS_HOME}") - set(FLATBUFFERS_INCLUDE_DIR "${FLATBUFFERS_HOME}/include") - set(FLATBUFFERS_STATIC_LIB "${FLATBUFFERS_HOME}/lib${LIB_SUFFIX}/libflatbuffers.a") - set(FLATBUFFERS_COMPILER "${FLATBUFFERS_HOME}/bin/flatc") - - add_custom_target(flatbuffers_ep) -else() - set(flatbuffers_VERSION "1.10.0") - set(flatbuffers_URL "https://github.com/google/flatbuffers/archive/v${flatbuffers_VERSION}.tar.gz") - set(flatbuffers_URL_MD5 "f7d19a3f021d93422b0bc287d7148cd2") - - set(FLATBUFFERS_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/external/flatbuffers-install") - - set(FLATBUFFERS_HOME "${FLATBUFFERS_INSTALL_PREFIX}") - set(FLATBUFFERS_INCLUDE_DIR "${FLATBUFFERS_INSTALL_PREFIX}/include") - set(FLATBUFFERS_STATIC_LIB "${FLATBUFFERS_INSTALL_PREFIX}/lib${LIB_SUFFIX}/libflatbuffers.a") - set(FLATBUFFERS_COMPILER "${FLATBUFFERS_INSTALL_PREFIX}/bin/flatc") - - ExternalProject_Add(flatbuffers_ep - PREFIX external/flatbuffers - URL ${flatbuffers_URL} - URL_MD5 ${flatbuffers_URL_MD5} - CMAKE_ARGS - "-DCMAKE_CXX_FLAGS=-fPIC" - "-DCMAKE_INSTALL_PREFIX:PATH=${FLATBUFFERS_INSTALL_PREFIX}" - "-DFLATBUFFERS_BUILD_TESTS=OFF" - "-DCMAKE_BUILD_TYPE=RELEASE") -endif() - -set(FBS_DEPENDS flatbuffers_ep) diff --git a/cmake/Modules/GlogExternalProject.cmake b/cmake/Modules/GlogExternalProject.cmake deleted file mode 100644 index 2900bae4d523..000000000000 --- a/cmake/Modules/GlogExternalProject.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# glog external project -# target: -# - glog_ep -# defines: -# - GLOG_HOME -# - GLOG_INCLUDE_DIR -# - GLOG_STATIC_LIB - -if(DEFINED ENV{RAY_GLOG_HOME} AND EXISTS $ENV{RAY_GLOG_HOME}) - set(GLOG_HOME "$ENV{RAY_GLOG_HOME}") - set(GLOG_INCLUDE_DIR "${GLOG_HOME}/include") - set(GLOG_STATIC_LIB "${GLOG_HOME}/lib/libglog.a") - - add_custom_target(glog_ep) -else() - message(STATUS "Starting to build glog") - set(GLOG_VERSION "0.3.5") - # keep the url md5 equals with the version, `md5 v0.3.5.tar.gz` - set(GLOG_URL_MD5 "5df6d78b81e51b90ac0ecd7ed932b0d4") - set(GLOG_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS} -fPIC") - if(APPLE) - set(GLOG_CMAKE_CXX_FLAGS "${GLOG_CMAKE_CXX_FLAGS} -mmacosx-version-min=10.12") - endif() - - set(GLOG_URL "https://github.com/google/glog/archive/v${GLOG_VERSION}.tar.gz") - set(GLOG_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/external/glog-install") - set(GLOG_HOME "${GLOG_PREFIX}") - set(GLOG_INCLUDE_DIR "${GLOG_PREFIX}/include") - set(GLOG_STATIC_LIB "${GLOG_PREFIX}/lib/libglog.a") - - set(GLOG_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX=${GLOG_PREFIX} - -DBUILD_SHARED_LIBS=OFF - -DBUILD_TESTING=OFF - -DWITH_GFLAGS=OFF - -DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${GLOG_CMAKE_CXX_FLAGS} - -DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_C_FLAGS} - -DCMAKE_CXX_FLAGS=${GLOG_CMAKE_CXX_FLAGS}) - - ExternalProject_Add(glog_ep - PREFIX external/glog - URL ${GLOG_URL} - URL_MD5 ${GLOG_URL_MD5} - ${EP_LOG_OPTIONS} - BUILD_IN_SOURCE 1 - BUILD_BYPRODUCTS "${GLOG_STATIC_LIB}" - CMAKE_ARGS ${GLOG_CMAKE_ARGS}) -endif() diff --git a/cmake/Modules/GtestExternalProject.cmake b/cmake/Modules/GtestExternalProject.cmake deleted file mode 100644 index 66e5a76f1d87..000000000000 --- a/cmake/Modules/GtestExternalProject.cmake +++ /dev/null @@ -1,71 +0,0 @@ -# gtest external project -# target: -# - googletest_ep -# defines: -# - GTEST_HOME -# - GTEST_STATIC_LIB -# - GTEST_MAIN_STATIC_LIB -# - GMOCK_MAIN_STATIC_LIB - -set(GTEST_FOUND FALSE) - -if(DEFINED ENV{RAY_GTEST_HOME} AND EXISTS $ENV{RAY_GTEST_HOME}) - set(GTEST_HOME "$ENV{RAY_GTEST_HOME}") - find_path(GTEST_INCLUDE_DIR NAMES gtest/gtest.h - PATHS ${GTEST_HOME} NO_DEFAULT_PATH - PATH_SUFFIXES "include") - find_library(GTEST_LIBRARIES NAMES gtest gtest_main gmock_main - PATHS ${GTEST_HOME} NO_DEFAULT_PATH - PATH_SUFFIXES "lib") - if(GTEST_INCLUDE_DIR AND GTEST_LIBRARIES) - set(GTEST_FOUND TRUE) - set(GTEST_STATIC_LIB - "${GTEST_HOME}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(GTEST_MAIN_STATIC_LIB - "${GTEST_HOME}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(GMOCK_MAIN_STATIC_LIB - "${GTEST_HOME}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}") - - add_custom_target(googletest_ep) - endif() - -endif() - -if(NOT GTEST_FOUND) - set(GTEST_VERSION "1.8.0") - - if(APPLE) - set(GTEST_CMAKE_CXX_FLAGS "-fPIC -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-value -Wno-ignored-attributes") - elseif(NOT MSVC) - set(GTEST_CMAKE_CXX_FLAGS "-fPIC") - endif() - if(CMAKE_BUILD_TYPE) - string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE) - endif() - set(GTEST_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}} ${GTEST_CMAKE_CXX_FLAGS}") - - set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/external/googletest-install") - set(GTEST_INCLUDE_DIR "${GTEST_PREFIX}/include") - set(GTEST_STATIC_LIB - "${GTEST_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(GTEST_MAIN_STATIC_LIB - "${GTEST_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(GMOCK_MAIN_STATIC_LIB - "${GTEST_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(GTEST_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX=${GTEST_PREFIX} - -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS}) - if (MSVC AND NOT ARROW_USE_STATIC_CRT) - set(GTEST_CMAKE_ARGS ${GTEST_CMAKE_ARGS} -Dgtest_force_shared_crt=ON) - endif() - - set(GTEST_URL_MD5 "16877098823401d1bf2ed7891d7dce36") - - ExternalProject_Add(googletest_ep - PREFIX external/googletest - URL "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz" - URL_MD5 ${GTEST_URL_MD5} - BUILD_BYPRODUCTS ${GTEST_STATIC_LIB} ${GTEST_MAIN_STATIC_LIB} ${GMOCK_MAIN_STATIC_LIB} - CMAKE_ARGS ${GTEST_CMAKE_ARGS} - ${EP_LOG_OPTIONS}) -endif() diff --git a/cmake/Modules/ParquetExternalProject.cmake b/cmake/Modules/ParquetExternalProject.cmake deleted file mode 100644 index 7088e39e6f2a..000000000000 --- a/cmake/Modules/ParquetExternalProject.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# parquet external project -# target: -# - parquet_ep -# depends: -# - arrow_ep -# defines: -# - PARQUET_HOME -# - PARQUET_INCLUDE_DIR -# - PARQUET_STATIC_LIB -# - PARQUET_SHARED_LIB - -include(ExternalProject) - -set(parquet_URL https://github.com/apache/parquet-cpp.git) -set(parquet_TAG 63f41b00bddecb172bd5b3aa0366b4653f498811) - -# install parquet into arrow_home... -set(PARQUET_INSTALL_PREFIX ${ARROW_HOME}) -set(PARQUET_HOME ${PARQUET_INSTALL_PREFIX}) -set(PARQUET_INCLUDE_DIR ${PARQUET_INSTALL_PREFIX}/include) -set(PARQUET_STATIC_LIB ${PARQUET_INSTALL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}parquet.a) -set(PARQUET_SHARED_LIB ${PARQUET_INSTALL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_SHARED_LIBRARY_SUFFIX}) - -set(parquet_CMAKE_ARGS - -DCMAKE_BUILD_TYPE:STRING=Release - -DCMAKE_INSTALL_PREFIX=${PARQUET_INSTALL_PREFIX} - -DARROW_HOME=${ARROW_HOME} - -DBOOST_ROOT=${BOOST_ROOT} - -DPARQUET_BUILD_BENCHMARKS=off - -DPARQUET_BUILD_EXECUTABLES=off - -DPARQUET_BUILD_TESTS=off) - -set(parquet_ENV "") -if (APPLE) - set(parquet_ENV "PATH=/usr/local/opt/bison/bin:$ENV{PATH}" - "OPENSSL_ROOT_DIR=/usr/local/opt/openssl") -endif () - -ExternalProject_Add(parquet_ep - PREFIX external/parquet - DEPENDS arrow - GIT_REPOSITORY ${parquet_URL} - GIT_TAG ${parquet_TAG} - BUILD_COMMAND ${CMAKE_COMMAND} -E env ${parquet_ENV} $(MAKE) - CMAKE_ARGS ${parquet_CMAKE_ARGS}) diff --git a/cmake/Modules/ThirdpartyToolchain.cmake b/cmake/Modules/ThirdpartyToolchain.cmake deleted file mode 100644 index 50bad160b40b..000000000000 --- a/cmake/Modules/ThirdpartyToolchain.cmake +++ /dev/null @@ -1,158 +0,0 @@ -# include all ray third party dependencies - -# Because we use the old C++ ABI to be compatible with TensorFlow, -# we have to turn it on for dependencies too -set(EP_CXX_FLAGS "${EP_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0") - -# The following is needed because in CentOS, the lib directory is named lib64 -if(EXISTS "/etc/redhat-release" AND CMAKE_SIZEOF_VOID_P EQUAL 8) - set(LIB_SUFFIX 64) -endif() - -if(RAY_BUILD_TESTS OR RAY_BUILD_BENCHMARKS) - add_custom_target(unittest ctest -L unittest) - - include(GtestExternalProject) - message(STATUS "GTest include dir: ${GTEST_INCLUDE_DIR}") - message(STATUS "GTest static library: ${GTEST_STATIC_LIB}") - message(STATUS "GTest static main library: ${GTEST_MAIN_STATIC_LIB}") - message(STATUS "GMock static main library: ${GMOCK_MAIN_STATIC_LIB}") - include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) - ADD_THIRDPARTY_LIB(gtest - STATIC_LIB ${GTEST_STATIC_LIB}) - ADD_THIRDPARTY_LIB(gtest_main - STATIC_LIB ${GTEST_MAIN_STATIC_LIB}) - ADD_THIRDPARTY_LIB(gmock_main - STATIC_LIB ${GMOCK_MAIN_STATIC_LIB}) - - add_dependencies(gtest googletest_ep) - add_dependencies(gtest_main googletest_ep) - add_dependencies(gmock_main googletest_ep) -endif() - -include(GlogExternalProject) -message(STATUS "Glog home: ${GLOG_HOME}") -message(STATUS "Glog include dir: ${GLOG_INCLUDE_DIR}") -message(STATUS "Glog static lib: ${GLOG_STATIC_LIB}") - -include_directories(${GLOG_INCLUDE_DIR}) -ADD_THIRDPARTY_LIB(glog - STATIC_LIB ${GLOG_STATIC_LIB}) - -add_dependencies(glog glog_ep) - -# boost -include(BoostExternalProject) - -message(STATUS "Boost root: ${BOOST_ROOT}") -message(STATUS "Boost include dir: ${Boost_INCLUDE_DIR}") -message(STATUS "Boost system library: ${Boost_SYSTEM_LIBRARY}") -message(STATUS "Boost filesystem library: ${Boost_FILESYSTEM_LIBRARY}") -include_directories(${Boost_INCLUDE_DIR}) - -ADD_THIRDPARTY_LIB(boost_system - STATIC_LIB ${Boost_SYSTEM_LIBRARY}) -ADD_THIRDPARTY_LIB(boost_filesystem - STATIC_LIB ${Boost_FILESYSTEM_LIBRARY}) -ADD_THIRDPARTY_LIB(boost_thread - STATIC_LIB ${Boost_THREAD_LIBRARY}) - -add_dependencies(boost_system boost_ep) -add_dependencies(boost_filesystem boost_ep) -add_dependencies(boost_thread boost_ep) - -add_custom_target(boost DEPENDS boost_system boost_filesystem boost_thread) - -# flatbuffers -include(FlatBuffersExternalProject) - -message(STATUS "Flatbuffers home: ${FLATBUFFERS_HOME}") -message(STATUS "Flatbuffers include dir: ${FLATBUFFERS_INCLUDE_DIR}") -message(STATUS "Flatbuffers static library: ${FLATBUFFERS_STATIC_LIB}") -message(STATUS "Flatbuffers compiler: ${FLATBUFFERS_COMPILER}") -include_directories(SYSTEM ${FLATBUFFERS_INCLUDE_DIR}) - -ADD_THIRDPARTY_LIB(flatbuffers STATIC_LIB ${FLATBUFFERS_STATIC_LIB}) - -add_dependencies(flatbuffers flatbuffers_ep) - -# Apache Arrow, use FLATBUFFERS_HOME and BOOST_ROOT -include(ArrowExternalProject) - -message(STATUS "Arrow home: ${ARROW_HOME}") -message(STATUS "Arrow source dir: ${ARROW_SOURCE_DIR}") -message(STATUS "Arrow include dir: ${ARROW_INCLUDE_DIR}") -message(STATUS "Arrow static library: ${ARROW_STATIC_LIB}") -message(STATUS "Arrow shared library: ${ARROW_SHARED_LIB}") -include_directories(SYSTEM ${ARROW_INCLUDE_DIR}) - -ADD_THIRDPARTY_LIB(arrow STATIC_LIB ${ARROW_STATIC_LIB}) - -add_dependencies(arrow arrow_ep) - -# Plasma, it is already built in arrow -message(STATUS "Plasma include dir: ${PLASMA_INCLUDE_DIR}") -message(STATUS "Plasma static library: ${PLASMA_STATIC_LIB}") -message(STATUS "Plasma shared library: ${PLASMA_SHARED_LIB}") -include_directories(SYSTEM ${PLASMA_INCLUDE_DIR}) - -ADD_THIRDPARTY_LIB(plasma STATIC_LIB ${PLASMA_STATIC_LIB}) - -add_dependencies(plasma plasma_ep) - -if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES") - # clean the arrow_ep/python/build/lib.xxxxx directory, - # or when you build with another python version, it creates multiple lib.xxxx directories - set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${ARROW_SOURCE_DIR}/python/build/") - set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_SOURCE_DIR}/python/ray/pyarrow_files/pyarrow") - - # here we use externalProject to process pyarrow building - # add_custom_command would have problem with setup.py - if(EXISTS ${ARROW_SOURCE_DIR}/python/build/) - # if we did not run `make clean`, skip the rebuild of pyarrow - add_custom_target(pyarrow_ext) - else() - # pyarrow - find_package(PythonInterp REQUIRED) - message(STATUS "PYTHON_EXECUTABLE for pyarrow: ${PYTHON_EXECUTABLE}") - - # PYARROW_PARALLEL= , so it will add -j to pyarrow build - set(pyarrow_ENV - "SETUPTOOLS_SCM_PRETEND_VERSION=0.12.0-RAY" - "PKG_CONFIG_PATH=${ARROW_LIBRARY_DIR}/pkgconfig" - "PYARROW_WITH_PLASMA=1" - "PYARROW_WITH_TENSORFLOW=1" - "PYARROW_BUNDLE_ARROW_CPP=1" - "PARQUET_HOME=${PARQUET_HOME}" - "BOOST_ROOT=${BOOST_ROOT}" - "PYARROW_WITH_PARQUET=1" - "PYARROW_PARALLEL=") - - if (APPLE) - # Since 10.14, the XCode toolchain only accepts libc++ as the - # standard library. We set it only on 10.14, because on some - # configurations of older macOS, we get the following error - # with libc++: - # [...]/usr/bin/c++ '-stdlib=libc++' -isysroot [...] -mmacosx-version-min=10.6 [...] - # clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) - - exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION) - string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION}) - message(STATUS "-- Darwin version = ${DARWIN_VERSION}") - if (DARWIN_VERSION GREATER 17) - set(pyarrow_ENV ${pyarrow_ENV} "CXXFLAGS='-stdlib=libc++'") - endif() - endif() - - ExternalProject_Add(pyarrow_ext - PREFIX external/pyarrow - DEPENDS arrow_ep - DOWNLOAD_COMMAND "" - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND cd ${ARROW_SOURCE_DIR}/python && ${CMAKE_COMMAND} -E env ${pyarrow_ENV} ${PYTHON_EXECUTABLE} setup.py build - BUILD_COMMAND cd ${ARROW_SOURCE_DIR}/python && ${CMAKE_COMMAND} -E env ${pyarrow_ENV} ${PYTHON_EXECUTABLE} setup.py build_ext - INSTALL_COMMAND bash -c "cp -rf \$(find ${ARROW_SOURCE_DIR}/python/build/ -maxdepth 1 -type d -print | grep -m1 'lib')/pyarrow ${CMAKE_SOURCE_DIR}/python/ray/pyarrow_files/") - - endif() - -endif () diff --git a/cmake/Modules/UseCython.cmake b/cmake/Modules/UseCython.cmake deleted file mode 100755 index 9a1a2f3c242c..000000000000 --- a/cmake/Modules/UseCython.cmake +++ /dev/null @@ -1,317 +0,0 @@ -# Define a function to create Cython modules. -# -# For more information on the Cython project, see http://cython.org/. -# "Cython is a language that makes writing C extensions for the Python language -# as easy as Python itself." -# -# This file defines a CMake function to build a Cython Python module. -# To use it, first include this file. -# -# include( UseCython ) -# -# Then call cython_add_module to create a module. -# -# cython_add_module( ... ) -# -# To create a standalone executable, the function -# -# cython_add_standalone_executable( [MAIN_MODULE src1] ... ) -# -# To avoid dependence on Python, set the PYTHON_LIBRARY cache variable to point -# to a static library. If a MAIN_MODULE source is specified, -# the "if __name__ == '__main__':" from that module is used as the C main() method -# for the executable. If MAIN_MODULE, the source with the same basename as -# is assumed to be the MAIN_MODULE. -# -# Where is the name of the resulting Python module and -# ... are source files to be compiled into the module, e.g. *.pyx, -# *.py, *.c, *.cxx, etc. A CMake target is created with name . This can -# be used for target_link_libraries(), etc. -# -# The sample paths set with the CMake include_directories() command will be used -# for include directories to search for *.pxd when running the Cython complire. -# -# Cache variables that effect the behavior include: -# -# CYTHON_ANNOTATE -# CYTHON_NO_DOCSTRINGS -# CYTHON_FLAGS -# -# Source file properties that effect the build process are -# -# CYTHON_IS_CXX -# -# If this is set of a *.pyx file with CMake set_source_files_properties() -# command, the file will be compiled as a C++ file. -# -# See also FindCython.cmake - -#============================================================================= -# Copyright 2011 Kitware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -# Configuration options. -set( CYTHON_ANNOTATE OFF - CACHE BOOL "Create an annotated .html file when compiling *.pyx." ) -set( CYTHON_NO_DOCSTRINGS OFF - CACHE BOOL "Strip docstrings from the compiled module." ) -set( CYTHON_FLAGS "" CACHE STRING - "Extra flags to the cython compiler." ) -mark_as_advanced( CYTHON_ANNOTATE CYTHON_NO_DOCSTRINGS CYTHON_FLAGS ) - -find_package( PythonLibs REQUIRED ) - -set( CYTHON_CXX_EXTENSION "cxx" ) -set( CYTHON_C_EXTENSION "c" ) - -# Create a *.c or *.cxx file from a *.pyx file. -# Input the generated file basename. The generate file will put into the variable -# placed in the "generated_file" argument. Finally all the *.py and *.pyx files. -function( compile_pyx _name generated_file ) - # Default to assuming all files are C. - set( cxx_arg "" ) - set( extension ${CYTHON_C_EXTENSION} ) - set( pyx_lang "C" ) - set( comment "Compiling Cython C source for ${_name}..." ) - - set( cython_include_directories "" ) - set( pxd_dependencies "" ) - set( pxi_dependencies "" ) - set( c_header_dependencies "" ) - set( pyx_locations "" ) - - foreach( pyx_file ${ARGN} ) - get_filename_component( pyx_file_basename "${pyx_file}" NAME_WE ) - - # Determine if it is a C or C++ file. - get_source_file_property( property_is_cxx ${pyx_file} CYTHON_IS_CXX ) - if( ${property_is_cxx} ) - set( cxx_arg "--cplus" ) - set( extension ${CYTHON_CXX_EXTENSION} ) - set( pyx_lang "CXX" ) - set( comment "Compiling Cython CXX source for ${_name}..." ) - endif() - - # Get the include directories. - get_source_file_property( pyx_location ${pyx_file} LOCATION ) - get_filename_component( pyx_path ${pyx_location} PATH ) - # TODO(suquark): Temporarily commented out for compiling errors. - # get_directory_property( cmake_include_directories DIRECTORY ${pyx_path} INCLUDE_DIRECTORIES ) - # list( APPEND cython_include_directories ${cmake_include_directories} ) - list( APPEND pyx_locations "${pyx_location}" ) - - # Determine dependencies. - # Add the pxd file will the same name as the given pyx file. - unset( corresponding_pxd_file CACHE ) - find_file( corresponding_pxd_file ${pyx_file_basename}.pxd - PATHS "${pyx_path}" ${cmake_include_directories} - NO_DEFAULT_PATH ) - if( corresponding_pxd_file ) - list( APPEND pxd_dependencies "${corresponding_pxd_file}" ) - endif() - - # Look for included pxi files - file(STRINGS "${pyx_file}" include_statements REGEX "include +['\"]([^'\"]+).*") - foreach(statement ${include_statements}) - string(REGEX REPLACE "include +['\"]([^'\"]+).*" "\\1" pxi_file "${statement}") - unset(pxi_location CACHE) - find_file(pxi_location ${pxi_file} - PATHS "${pyx_path}" ${cmake_include_directories} NO_DEFAULT_PATH) - if (pxi_location) - list(APPEND pxi_dependencies ${pxi_location}) - get_filename_component( found_pyi_file_basename "${pxi_file}" NAME_WE ) - get_filename_component( found_pyi_path ${pxi_location} PATH ) - unset( found_pyi_pxd_file CACHE ) - find_file( found_pyi_pxd_file ${found_pyi_file_basename}.pxd - PATHS "${found_pyi_path}" ${cmake_include_directories} NO_DEFAULT_PATH ) - if (found_pyi_pxd_file) - list( APPEND pxd_dependencies "${found_pyi_pxd_file}" ) - endif() - endif() - endforeach() # for each include statement found - - # pxd files to check for additional dependencies. - set( pxds_to_check "${pyx_file}" "${pxd_dependencies}" ) - set( pxds_checked "" ) - set( number_pxds_to_check 1 ) - while( ${number_pxds_to_check} GREATER 0 ) - foreach( pxd ${pxds_to_check} ) - list( APPEND pxds_checked "${pxd}" ) - list( REMOVE_ITEM pxds_to_check "${pxd}" ) - - # check for C header dependencies - file( STRINGS "${pxd}" extern_from_statements - REGEX "cdef[ ]+extern[ ]+from.*$" ) - foreach( statement ${extern_from_statements} ) - # Had trouble getting the quote in the regex - string( REGEX REPLACE "cdef[ ]+extern[ ]+from[ ]+[\"]([^\"]+)[\"].*" "\\1" header "${statement}" ) - unset( header_location CACHE ) - find_file( header_location ${header} PATHS ${cmake_include_directories} ) - if( header_location ) - list( FIND c_header_dependencies "${header_location}" header_idx ) - if( ${header_idx} LESS 0 ) - list( APPEND c_header_dependencies "${header_location}" ) - endif() - endif() - endforeach() - - # check for pxd dependencies - - # Look for cimport statements. - set( module_dependencies "" ) - file( STRINGS "${pxd}" cimport_statements REGEX cimport ) - foreach( statement ${cimport_statements} ) - if( ${statement} MATCHES from ) - string( REGEX REPLACE "from[ ]+([^ ]+).*" "\\1" module "${statement}" ) - else() - string( REGEX REPLACE "cimport[ ]+([^ ]+).*" "\\1" module "${statement}" ) - endif() - list( APPEND module_dependencies ${module} ) - endforeach() - list( REMOVE_DUPLICATES module_dependencies ) - # Add the module to the files to check, if appropriate. - foreach( module ${module_dependencies} ) - unset( pxd_location CACHE ) - find_file( pxd_location ${module}.pxd - PATHS "${pyx_path}" ${cmake_include_directories} NO_DEFAULT_PATH ) - if( pxd_location ) - list( FIND pxds_checked ${pxd_location} pxd_idx ) - if( ${pxd_idx} LESS 0 ) - list( FIND pxds_to_check ${pxd_location} pxd_idx ) - if( ${pxd_idx} LESS 0 ) - list( APPEND pxds_to_check ${pxd_location} ) - list( APPEND pxd_dependencies ${pxd_location} ) - endif() # if it is not already going to be checked - endif() # if it has not already been checked - endif() # if pxd file can be found - endforeach() # for each module dependency discovered - endforeach() # for each pxd file to check - list( LENGTH pxds_to_check number_pxds_to_check ) - endwhile() - - - - endforeach() # pyx_file - - # Set additional flags. - if( CYTHON_ANNOTATE ) - set( annotate_arg "--annotate" ) - endif() - - if( CYTHON_NO_DOCSTRINGS ) - set( no_docstrings_arg "--no-docstrings" ) - endif() - - if( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR - "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo" ) - set( cython_debug_arg "--gdb" ) - endif() - - if( "${PYTHONLIBS_VERSION_STRING}" MATCHES "^2." ) - set( version_arg "-2" ) - elseif( "${PYTHONLIBS_VERSION_STRING}" MATCHES "^3." ) - set( version_arg "-3" ) - else() - set( version_arg ) - endif() - - # Include directory arguments. - list( REMOVE_DUPLICATES cython_include_directories ) - set( include_directory_arg "" ) - foreach( _include_dir ${cython_include_directories} ) - set( include_directory_arg ${include_directory_arg} "-I" "${_include_dir}" ) - endforeach() - - # Determining generated file name. - set( _generated_file "${CMAKE_CURRENT_BINARY_DIR}/${_name}.${extension}" ) - set_source_files_properties( ${_generated_file} PROPERTIES GENERATED TRUE ) - set( ${generated_file} ${_generated_file} PARENT_SCOPE ) - - list( REMOVE_DUPLICATES pxd_dependencies ) - list( REMOVE_DUPLICATES c_header_dependencies ) - - # Add the command to run the compiler. - add_custom_command( OUTPUT ${_generated_file} - COMMAND ${CYTHON_EXECUTABLE} - ARGS ${cxx_arg} ${include_directory_arg} ${version_arg} - ${annotate_arg} ${no_docstrings_arg} ${cython_debug_arg} ${CYTHON_FLAGS} - --output-file ${_generated_file} ${pyx_locations} - DEPENDS ${pyx_locations} ${pxd_dependencies} ${pxi_dependencies} - IMPLICIT_DEPENDS ${pyx_lang} ${c_header_dependencies} - COMMENT ${comment} - ) - - # Remove their visibility to the user. - set( corresponding_pxd_file "" CACHE INTERNAL "" ) - set( header_location "" CACHE INTERNAL "" ) - set( pxd_location "" CACHE INTERNAL "" ) -endfunction() - -# cython_add_module( src1 src2 ... srcN ) -# Build the Cython Python module. -function( cython_add_module _name ) - set( pyx_module_sources "" ) - set( other_module_sources "" ) - foreach( _file ${ARGN} ) - if( ${_file} MATCHES ".*\\.py[x]?$" ) - list( APPEND pyx_module_sources ${_file} ) - else() - list( APPEND other_module_sources ${_file} ) - endif() - endforeach() - compile_pyx( ${_name} generated_file ${pyx_module_sources} ) - include_directories( ${PYTHON_INCLUDE_DIRS} ) - python_add_module( ${_name} ${generated_file} ${other_module_sources} ) - if( APPLE ) - set_target_properties( ${_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) - endif() -endfunction() - -include( CMakeParseArguments ) -# cython_add_standalone_executable( _name [MAIN_MODULE src3.py] src1 src2 ... srcN ) -# Creates a standalone executable the given sources. -function( cython_add_standalone_executable _name ) - set( pyx_module_sources "" ) - set( other_module_sources "" ) - set( main_module "" ) - cmake_parse_arguments( cython_arguments "" "MAIN_MODULE" "" ${ARGN} ) - include_directories( ${PYTHON_INCLUDE_DIRS} ) - foreach( _file ${cython_arguments_UNPARSED_ARGUMENTS} ) - if( ${_file} MATCHES ".*\\.py[x]?$" ) - get_filename_component( _file_we ${_file} NAME_WE ) - if( "${_file_we}" STREQUAL "${_name}" ) - set( main_module "${_file}" ) - elseif( NOT "${_file}" STREQUAL "${cython_arguments_MAIN_MODULE}" ) - set( PYTHON_MODULE_${_file_we}_static_BUILD_SHARED OFF ) - compile_pyx( "${_file_we}_static" generated_file "${_file}" ) - list( APPEND pyx_module_sources "${generated_file}" ) - endif() - else() - list( APPEND other_module_sources ${_file} ) - endif() - endforeach() - - if( cython_arguments_MAIN_MODULE ) - set( main_module ${cython_arguments_MAIN_MODULE} ) - endif() - if( NOT main_module ) - message( FATAL_ERROR "main module not found." ) - endif() - get_filename_component( main_module_we "${main_module}" NAME_WE ) - set( CYTHON_FLAGS ${CYTHON_FLAGS} --embed ) - compile_pyx( "${main_module_we}_static" generated_file ${main_module} ) - add_executable( ${_name} ${generated_file} ${pyx_module_sources} ${other_module_sources} ) - target_link_libraries( ${_name} ${pyx_module_libs} ) -endfunction() diff --git a/doc/source/installation-troubleshooting.rst b/doc/source/installation-troubleshooting.rst index f3b4ea7d41c8..9e881531e3d0 100644 --- a/doc/source/installation-troubleshooting.rst +++ b/doc/source/installation-troubleshooting.rst @@ -28,9 +28,9 @@ One of the Ray libraries is compiled against the wrong version of Python ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If there is a segfault or a sigabort immediately upon importing Ray, one of the -components may have been compiled against the wrong Python libraries. CMake +components may have been compiled against the wrong Python libraries. Bazel should normally find the right version of Python, but this process is not -completely reliable. In this case, check the CMake output from installation and +completely reliable. In this case, check the Bazel output from installation and make sure that the version of the Python libraries that were found match the version of Python that you're using. diff --git a/docker/base-deps/Dockerfile b/docker/base-deps/Dockerfile index b7fa7be6b9cf..c21430c627a4 100644 --- a/docker/base-deps/Dockerfile +++ b/docker/base-deps/Dockerfile @@ -6,14 +6,9 @@ RUN apt-get update \ git \ wget \ cmake \ - pkg-config \ build-essential \ - autoconf \ curl \ - libtool \ unzip \ - flex \ - bison \ && apt-get clean \ && echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh \ && wget \ @@ -26,6 +21,11 @@ RUN apt-get update \ && /opt/conda/bin/conda clean -y --all \ && /opt/conda/bin/pip install \ flatbuffers \ - cython==0.29.0 + cython==0.29.0 \ + numpy==1.15.4 + +# To avoid the following error on Jenkins: +# AttributeError: 'numpy.ufunc' object has no attribute '__module__' +RUN /opt/conda/bin/pip uninstall -y dask ENV PATH "/opt/conda/bin:$PATH" diff --git a/docker/deploy/Dockerfile b/docker/deploy/Dockerfile index 63acc70d97be..68b917d15efa 100644 --- a/docker/deploy/Dockerfile +++ b/docker/deploy/Dockerfile @@ -2,9 +2,10 @@ # for end users. FROM ray-project/base-deps -ENV RAY_USE_CMAKE=1 ADD ray.tar /ray ADD git-rev /ray/git-rev +RUN /ray/ci/travis/install-bazel.sh +ENV PATH=$PATH:/root/bin WORKDIR /ray/python RUN pip install -e . WORKDIR /ray diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt deleted file mode 100644 index e2f6094cae16..000000000000 --- a/python/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# NOTE: These must be checked before including Cython packages to ensure we are using the right python version. -# Segfaults could happen if we are using the wrong version. -set(PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIRS}) - -# Find Cython executable -get_filename_component(_python_path ${PYTHON_EXECUTABLE} PATH) -find_program(CYTHON_EXECUTABLE - NAMES cython cython.bat cython3 - HINTS ${_python_path}) - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cython REQUIRED_VARS CYTHON_EXECUTABLE) - -include(UseCython) - -include_directories("${NUMPY_INCLUDE_DIR}") -include_directories("${CMAKE_CURRENT_LIST_DIR}/../src") -include_directories("${CMAKE_CURRENT_LIST_DIR}") - -# Include some generated Arrow headers. -include_directories("${ARROW_SOURCE_DIR}/../arrow_ep-build/src") - -# If the pyx file is a C++ file, we should specify that here. -set_source_files_properties( - ${CMAKE_CURRENT_LIST_DIR}/ray/_raylet.pyx - PROPERTIES CYTHON_IS_CXX TRUE) - -set(RAY_SRC_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../src/ray") - -cython_add_module( - _raylet - ${RAY_SRC_DIRECTORY}/raylet/raylet_client.cc - ${CMAKE_CURRENT_LIST_DIR}/ray/_raylet.pyx) - -add_dependencies(_raylet ray_static) - -if(APPLE) - target_link_libraries(_raylet "-undefined dynamic_lookup" ray_static) -else() - target_link_libraries(_raylet ray_static) -endif() - -# Make sure that the Python extensions are built before copying the files. -add_dependencies(copy_ray _raylet) diff --git a/python/ray/autoscaler/aws/development-example.yaml b/python/ray/autoscaler/aws/development-example.yaml index b9791799ff04..0986a48ecc05 100644 --- a/python/ray/autoscaler/aws/development-example.yaml +++ b/python/ray/autoscaler/aws/development-example.yaml @@ -87,7 +87,7 @@ setup_commands: # - sudo dpkg --configure -a # Install basics. - sudo apt-get update - - sudo apt-get install -y cmake pkg-config build-essential autoconf curl libtool unzip flex bison python + - sudo apt-get install -y build-essential curl unzip # Install Anaconda. - wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh || true - bash Anaconda3-5.0.1-Linux-x86_64.sh -b -p $HOME/anaconda3 || true diff --git a/python/ray/autoscaler/docker.py b/python/ray/autoscaler/docker.py index 6d80e10ded7a..5a951c627798 100644 --- a/python/ray/autoscaler/docker.py +++ b/python/ray/autoscaler/docker.py @@ -98,7 +98,7 @@ def docker_start_cmds(user, image, mount, cname, user_options): cmds.append(" ".join(docker_check + docker_run)) docker_update = [ " && ".join(("apt-get -y update", "apt-get -y upgrade", - "apt-get install -y git wget cmake psmisc")) + "apt-get install -y git wget psmisc")) ] cmds.extend(with_docker_exec(docker_update, container_name=cname)) return cmds diff --git a/python/setup.py b/python/setup.py index d64559536b30..10eea24f1310 100644 --- a/python/setup.py +++ b/python/setup.py @@ -17,7 +17,7 @@ # before these files have been created, so we have to move the files # manually. -# NOTE: The lists below must be kept in sync with ray/CMakeLists.txt. +# NOTE: The lists below must be kept in sync with ray/BUILD.bazel. ray_files = [ "ray/core/src/ray/thirdparty/redis/src/redis-server", diff --git a/src/ray/CMakeLists.txt b/src/ray/CMakeLists.txt deleted file mode 100644 index 153ed639ad20..000000000000 --- a/src/ray/CMakeLists.txt +++ /dev/null @@ -1,108 +0,0 @@ -cmake_minimum_required(VERSION 3.2) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Werror -std=c++11") - -include_directories(thirdparty/ae) - -set(HIREDIS_SRCS - ${CMAKE_CURRENT_LIST_DIR}/thirdparty/hiredis/async.c - ${CMAKE_CURRENT_LIST_DIR}/thirdparty/hiredis/dict.c - ${CMAKE_CURRENT_LIST_DIR}/thirdparty/hiredis/hiredis.c - ${CMAKE_CURRENT_LIST_DIR}/thirdparty/hiredis/net.c - ${CMAKE_CURRENT_LIST_DIR}/thirdparty/hiredis/read.c - ${CMAKE_CURRENT_LIST_DIR}/thirdparty/hiredis/sds.c -) - -set(UTIL_SRCS - ${CMAKE_CURRENT_LIST_DIR}/thirdparty/sha256.c - ${CMAKE_CURRENT_LIST_DIR}/common/common_protocol.cc -) - -set(RAY_SRCS - id.cc - status.cc - gcs/client.cc - gcs/tables.cc - gcs/redis_context.cc - gcs/asio.cc - util/logging.cc - common/client_connection.cc - common/common_protocol.cc - object_manager/object_manager_client_connection.cc - object_manager/connection_pool.cc - object_manager/object_buffer_pool.cc - object_manager/object_store_notification_manager.cc - object_manager/object_directory.cc - object_manager/object_manager.cc - raylet/monitor.cc - raylet/mock_gcs_client.cc - raylet/task.cc - raylet/task_execution_spec.cc - raylet/task_spec.cc - raylet/worker.cc - raylet/worker_pool.cc - raylet/scheduling_resources.cc - raylet/actor_registration.cc - raylet/scheduling_queue.cc - raylet/scheduling_policy.cc - raylet/task_dependency_manager.cc - raylet/reconstruction_policy.cc - raylet/node_manager.cc - raylet/lineage_cache.cc - raylet/raylet.cc -) - -set(RAY_SYSTEM_LIBS ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} pthread) -if(UNIX AND NOT APPLE) - set(RAY_SYSTEM_LIBS ${RAY_SYSTEM_LIBS} -lrt) -endif() - -set(RAY_LIB_STATIC_LINK_LIBS ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} ${RAY_SYSTEM_LIBS}) - -set(RAY_LIB_DEPENDENCIES - boost_thread - arrow_ep - googletest_ep - gen_gcs_fbs - gen_object_manager_fbs - gen_node_manager_fbs) - -if(RAY_USE_GLOG) - add_definitions(-DRAY_USE_GLOG) - set(RAY_LIB_STATIC_LINK_LIBS ${RAY_LIB_STATIC_LINK_LIBS} glog) - set(RAY_LIB_DEPENDENCIES ${RAY_LIB_DEPENDENCIES} glog) -endif() - -install(FILES - api.h - id.h - status.h - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ray") - -# pkg-config support -configure_file(ray.pc.in - "${CMAKE_CURRENT_BINARY_DIR}/ray.pc" - @ONLY) -install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/ray.pc" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/") - -ADD_RAY_LIB(ray - SOURCES ${RAY_SRCS} ${HIREDIS_SRCS} ${UTIL_SRCS} - DEPENDENCIES ${RAY_LIB_DEPENDENCIES} - SHARED_LINK_LIBS "" - STATIC_LINK_LIBS ${RAY_LIB_STATIC_LINK_LIBS}) - -set(RAY_TEST_LIBS ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} gtest gtest_main gmock_main ${RAY_SYSTEM_LIBS}) - -add_subdirectory(util) -add_subdirectory(gcs) -add_subdirectory(object_manager) -add_subdirectory(raylet) - -add_custom_target(copy_redis ALL) -foreach(file "redis-cli" "redis-server") -add_custom_command(TARGET copy_redis POST_BUILD - COMMAND ${CMAKE_COMMAND} -E - copy ${CMAKE_CURRENT_LIST_DIR}/../../thirdparty/pkg/redis/src/${file} - ${CMAKE_BINARY_DIR}/src/ray/thirdparty/redis/src/${file}) -endforeach() diff --git a/src/ray/gcs/CMakeLists.txt b/src/ray/gcs/CMakeLists.txt deleted file mode 100644 index f09c89f99201..000000000000 --- a/src/ray/gcs/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-function") - -add_subdirectory(redis_module) - -# TODO(rkn): We may need to encode the fact that the ray redis module requires -# some autogenerated flatbuffer files to compile. - -set(GCS_FBS_SRC "${CMAKE_CURRENT_LIST_DIR}/format/gcs.fbs") -set(OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/format/) - -set(GCS_FBS_OUTPUT_FILES - "${OUTPUT_DIR}/gcs_generated.h") - -add_custom_command( - OUTPUT ${GCS_FBS_OUTPUT_FILES} - # The --gen-object-api flag generates a C++ class MessageT for each - # flatbuffers message Message, which can be used to store deserialized - # messages in data structures. This is currently used for ObjectInfo for - # example. - COMMAND ${FLATBUFFERS_COMPILER} -c -o ${OUTPUT_DIR} ${GCS_FBS_SRC} --cpp --gen-object-api --gen-mutable --scoped-enums - DEPENDS ${FBS_DEPENDS} - COMMENT "Running flatc compiler on ${GCS_FBS_SRC}" - VERBATIM) - -add_custom_target(gen_gcs_fbs DEPENDS ${GCS_FBS_OUTPUT_FILES}) -set(RAY_HOME ${CMAKE_CURRENT_LIST_DIR}/../../..) - -# Generate Python bindings for the flatbuffers objects. -set(PYTHON_OUTPUT_DIR ${RAY_HOME}/python/ray/core/generated/) -add_custom_command( - TARGET gen_gcs_fbs - COMMAND ${FLATBUFFERS_COMPILER} -p -o ${PYTHON_OUTPUT_DIR} ${GCS_FBS_SRC} - DEPENDS ${FBS_DEPENDS} - COMMENT "Running flatc compiler on ${GCS_FBS_SRC} for python" - VERBATIM) - -# Generate Java bindings for the flatbuffers objects. -set(JAVA_OUTPUT_DIR ${RAY_HOME}/java/runtime/src/main/java/org/ray/runtime/generated/) -add_custom_command( - TARGET gen_gcs_fbs - COMMAND ${FLATBUFFERS_COMPILER} -j -o ${JAVA_OUTPUT_DIR} ${GCS_FBS_SRC} - COMMAND ${PYTHON_EXECUTABLE} ${RAY_HOME}/java/modify_generated_java_flatbuffers_files.py ${RAY_HOME} - DEPENDS ${FBS_DEPENDS} - COMMENT "Running flatc compiler on ${GCS_FBS_SRC} for Java" - VERBATIM) - -ADD_RAY_TEST(client_test STATIC_LINK_LIBS ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} gtest gtest_main pthread ${Boost_SYSTEM_LIBRARY}) -ADD_RAY_TEST(asio_test STATIC_LINK_LIBS ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} gtest gtest_main pthread ${Boost_SYSTEM_LIBRARY}) - -install(FILES - client.h - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ray/gcs") diff --git a/src/ray/gcs/redis_module/CMakeLists.txt b/src/ray/gcs/redis_module/CMakeLists.txt deleted file mode 100644 index f57d1c89e36b..000000000000 --- a/src/ray/gcs/redis_module/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.4) - -project(ray_redis_module) - -if(APPLE) - set(REDIS_MODULE_CFLAGS -W -Wall -dynamic -fno-common -g -ggdb -std=c++11 -O2) - set(REDIS_MODULE_LDFLAGS "-undefined dynamic_lookup") - set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") -else() - set(REDIS_MODULE_CFLAGS -W -Wall -fno-common -g -ggdb -std=c++11 -O2) - set(REDIS_MODULE_LDFLAGS -shared) -endif() - -add_library(ray_redis_module SHARED ray_redis_module.cc) - -target_compile_options(ray_redis_module PUBLIC ${REDIS_MODULE_CFLAGS} -fPIC) -target_link_libraries(ray_redis_module - # RAY_CHECK needs this lib. - LINK_PUBLIC ray_static - ${REDIS_MODULE_LDFLAGS}) diff --git a/src/ray/object_manager/CMakeLists.txt b/src/ray/object_manager/CMakeLists.txt deleted file mode 100644 index 054bd8cbacfb..000000000000 --- a/src/ray/object_manager/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(OBJECT_MANAGER_FBS_SRC "${CMAKE_CURRENT_LIST_DIR}/format/object_manager.fbs") -set(OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/format/) - -set(OBJECT_MANAGER_FBS_OUTPUT_FILES - "${OUTPUT_DIR}/object_manager_generated.h") - -add_custom_command( - OUTPUT ${OBJECT_MANAGER_FBS_OUTPUT_FILES} - # The --gen-object-api flag generates a C++ class MessageT for each - # flatbuffers message Message, which can be used to store deserialized - # messages in data structures. This is currently used for ObjectInfo for - # example. - COMMAND ${FLATBUFFERS_COMPILER} -c -o ${OUTPUT_DIR} ${OBJECT_MANAGER_FBS_SRC} --cpp --gen-object-api --gen-mutable --scoped-enums - DEPENDS ${FBS_DEPENDS} - COMMENT "Running flatc compiler on ${OBJECT_MANAGER_FBS_SRC}" - VERBATIM) - -add_custom_target(gen_object_manager_fbs DEPENDS ${OBJECT_MANAGER_FBS_OUTPUT_FILES}) - -ADD_RAY_TEST(test/object_manager_test STATIC_LINK_LIBS ${RAY_TEST_LIBS}) -ADD_RAY_TEST(test/object_manager_stress_test STATIC_LINK_LIBS ${RAY_TEST_LIBS}) - -add_library(object_manager object_manager.cc object_manager.h ${OBJECT_MANAGER_FBS_OUTPUT_FILES}) -target_link_libraries(object_manager common ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY}) - -install(FILES - object_manager - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ray/object_manager") diff --git a/src/ray/ray.pc.in b/src/ray/ray.pc.in deleted file mode 100644 index b8c9efbed2d6..000000000000 --- a/src/ray/ray.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ - -so_version=@RAY_SO_VERSION@ -abi_version=@RAY_ABI_VERSION@ - -Name: Ray -Description: Ray is a set of technologies for distributed execution. -Version: @RAY_VERSION@ -Libs: -L${libdir} -lray -Cflags: -I${includedir} diff --git a/src/ray/raylet/CMakeLists.txt b/src/ray/raylet/CMakeLists.txt deleted file mode 100644 index c81a9ed3c8cb..000000000000 --- a/src/ray/raylet/CMakeLists.txt +++ /dev/null @@ -1,99 +0,0 @@ -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - -set(NODE_MANAGER_FBS_SRC "${CMAKE_CURRENT_LIST_DIR}/format/node_manager.fbs") -set(OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/format/) - -set(NODE_MANAGER_FBS_OUTPUT_FILES - "${OUTPUT_DIR}/node_manager_generated.h") - -add_custom_command( - OUTPUT ${NODE_MANAGER_FBS_OUTPUT_FILES} - # The --gen-object-api flag generates a C++ class MessageT for each - # flatbuffers message Message, which can be used to store deserialized - # messages in data structures. This is currently used for ObjectInfo for - # example. - COMMAND ${FLATBUFFERS_COMPILER} -c -o ${OUTPUT_DIR} -I ${GCS_FBS_OUTPUT_DIRECTORY} ${NODE_MANAGER_FBS_SRC} --cpp --gen-object-api --gen-mutable --scoped-enums - DEPENDS ${FBS_DEPENDS} - COMMENT "Running flatc compiler on ${NODE_MANAGER_FBS_SRC}" - VERBATIM) - -add_custom_target(gen_node_manager_fbs DEPENDS ${NODE_MANAGER_FBS_OUTPUT_FILES}) - -# Generate Python bindings for the flatbuffers objects. -set(PYTHON_OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../python/ray/core/generated/) -add_custom_command( - TARGET gen_node_manager_fbs - COMMAND ${FLATBUFFERS_COMPILER} -p -o ${PYTHON_OUTPUT_DIR} -I ${GCS_FBS_OUTPUT_DIRECTORY} ${NODE_MANAGER_FBS_SRC} - DEPENDS ${FBS_DEPENDS} - COMMENT "Running flatc compiler on ${NODE_MANAGER_FBS_SRC}" - VERBATIM) - -add_dependencies(gen_node_manager_fbs flatbuffers_ep) - -ADD_RAY_TEST(object_manager_integration_test STATIC_LINK_LIBS ${RAY_TEST_LIBS}) -ADD_RAY_TEST(worker_pool_test STATIC_LINK_LIBS ${RAY_TEST_LIBS}) -ADD_RAY_TEST(client_connection_test STATIC_LINK_LIBS ${RAY_TEST_LIBS}) -ADD_RAY_TEST(task_test STATIC_LINK_LIBS ${RAY_TEST_LIBS}) -ADD_RAY_TEST(lineage_cache_test STATIC_LINK_LIBS ${RAY_TEST_LIBS}) -ADD_RAY_TEST(task_dependency_manager_test STATIC_LINK_LIBS ${RAY_TEST_LIBS}) -ADD_RAY_TEST(reconstruction_policy_test STATIC_LINK_LIBS ${RAY_TEST_LIBS}) - -include_directories(${GCS_FBS_OUTPUT_DIRECTORY}) -add_library(rayletlib raylet.cc ${NODE_MANAGER_FBS_OUTPUT_FILES}) -target_link_libraries(rayletlib ray_static ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY}) - -add_library(raylet_client STATIC raylet_client.cc) - -# Encode the fact that some things require some autogenerated flatbuffer files -# to be created first. -add_dependencies(rayletlib gen_gcs_fbs) -add_dependencies(raylet_client gen_gcs_fbs arrow_ep gen_node_manager_fbs) - -add_executable(raylet main.cc) -target_link_libraries(raylet rayletlib ${RAY_SYSTEM_LIBS}) - -add_executable(raylet_monitor monitor_main.cc) -target_link_libraries(raylet_monitor rayletlib ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} pthread) - -install(FILES - raylet - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ray/raylet") - -macro(get_raylet_library LANG VAR) - set(${VAR} "raylet_library_${LANG}") -endmacro() - -macro(set_raylet_library LANG) - get_raylet_library(${LANG} RAYLET_LIBRARY_${LANG}) - set(RAYLET_LIBRARY_LANG ${RAYLET_LIBRARY_${LANG}}) - - file(GLOB RAYLET_LIBRARY_${LANG}_SRC - lib/${LANG}/*.cc) - add_library(${RAYLET_LIBRARY_LANG} SHARED - ${RAYLET_LIBRARY_${LANG}_SRC}) - - if(APPLE) - if ("${LANG}" STREQUAL "python") - SET_TARGET_PROPERTIES(${RAYLET_LIBRARY_LANG} PROPERTIES SUFFIX .so) - endif() - target_link_libraries(${RAYLET_LIBRARY_LANG} "-undefined dynamic_lookup" raylet_client ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY}) - else(APPLE) - target_link_libraries(${RAYLET_LIBRARY_LANG} raylet_client ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY}) - endif(APPLE) - - add_dependencies(${RAYLET_LIBRARY_LANG} gen_node_manager_fbs) - - install(TARGETS ${RAYLET_LIBRARY_LANG} DESTINATION ${CMAKE_SOURCE_DIR}/raylet) -endmacro() - -if ("${CMAKE_RAY_LANG_JAVA}" STREQUAL "YES") - add_compile_options("-I$ENV{JAVA_HOME}/include/") - if(WIN32) - add_compile_options("-I$ENV{JAVA_HOME}/include/win32") - elseif(APPLE) - add_compile_options("-I$ENV{JAVA_HOME}/include/darwin") - else() # linux - add_compile_options("-I$ENV{JAVA_HOME}/include/linux") - endif() - set_raylet_library("java") -endif() diff --git a/src/ray/util/CMakeLists.txt b/src/ray/util/CMakeLists.txt deleted file mode 100644 index 2ce3c63f3c9d..000000000000 --- a/src/ray/util/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -install(FILES - logging.h - macros.h - util.h - visibility.h - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ray/util" -) - -ADD_RAY_TEST(logging_test STATIC_LINK_LIBS ray_static gtest pthread) -ADD_RAY_TEST(signal_test STATIC_LINK_LIBS ray_static gtest pthread ${Boost_SYSTEM_LIBRARY})