hunk.code_window:    harder to merge in a large change with a lot of disjoint features.
   2. Submit the patch as a GitHub pull request against the master branch.
   3. Make sure that your code passes the unit tests.
   4. Add new unit tests for your code.
   .. _`GitHub issues`: https://github.com/ray-project/ray/issues
   .. _`ray-dev@googlegroups.com`: https://groups.google.com/forum/#!forum/ray-dev
  
hunk.labels: keep keep keep keep keep replace keep
hunk.file_path: CONTRIBUTING.rst
hunk.type: replace
file: 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_PYTHON}" STREQUAL "YES")
    set_raylet_library("python")
    include_directories("${PYTHON_INCLUDE_DIRS}")
    include_directories("${NUMPY_INCLUDE_DIR}")
  endif()
  
  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()
  