-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Build Ray with setup.py. * Building photon extensions with cmake. * Fix formatting in photon_extension.c * Pip install with sudo in Travis. * Fix plasma __init__.py. * Rename and remove some files.
- Loading branch information
1 parent
695f23b
commit 47851ee
Showing
18 changed files
with
291 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from libphoton import * |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from lib.python.plasma import * |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Ray version string | ||
__version__ = "0.1" | ||
__version__ = "0.01" | ||
|
||
import ctypes | ||
# Windows only | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
import sys | ||
import subprocess | ||
|
||
from setuptools import setup, Extension, find_packages | ||
import setuptools | ||
from setuptools import setup, find_packages | ||
import setuptools.command.install as _install | ||
|
||
# because of relative paths, this must be run from inside ray/lib/python/ | ||
class install(_install.install): | ||
def run(self): | ||
subprocess.check_call(["../../build.sh"]) | ||
# Calling _install.install.run(self) does not fetch required packages and | ||
# instead performs an old-style install. See command/install.py in | ||
# setuptools. So, calling do_egg_install() manually here. | ||
self.do_egg_install() | ||
|
||
setup( | ||
name = "ray", | ||
version = "0.1.dev0", | ||
use_2to3=True, | ||
packages=find_packages(), | ||
package_data = { | ||
"ray": ["libraylib.so", "scheduler", "objstore"] | ||
}, | ||
zip_safe=False | ||
) | ||
setup(name="ray", | ||
version="0.0.1", | ||
packages=find_packages(), | ||
package_data={"common": ["thirdparty/redis-3.2.3/src/redis-server"], | ||
"plasma": ["build/plasma_store", | ||
"build/plasma_manager", | ||
"build/plasma_client.so"], | ||
"photon": ["build/photon_scheduler", | ||
"libphoton.so"]}, | ||
cmdclass={"install": install}, | ||
include_package_data=True, | ||
zip_safe=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project(photon) | ||
|
||
if(NOT APPLE) | ||
find_package(PythonInterp REQUIRED) | ||
find_package(PythonLibs REQUIRED) | ||
set(CUSTOM_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) | ||
else() | ||
find_program(CUSTOM_PYTHON_EXECUTABLE python) | ||
message("-- Found Python program: ${CUSTOM_PYTHON_EXECUTABLE}") | ||
execute_process(COMMAND ${CUSTOM_PYTHON_EXECUTABLE} -c | ||
"import sys; print 'python' + sys.version[0:3]" | ||
OUTPUT_VARIABLE PYTHON_LIBRARY_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
execute_process(COMMAND ${CUSTOM_PYTHON_EXECUTABLE} -c | ||
"import sys; print sys.exec_prefix" | ||
OUTPUT_VARIABLE PYTHON_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
FIND_LIBRARY(PYTHON_LIBRARIES | ||
NAMES ${PYTHON_LIBRARY_NAME} | ||
HINTS "${PYTHON_PREFIX}" | ||
PATH_SUFFIXES "lib" "libs" | ||
NO_DEFAULT_PATH) | ||
execute_process(COMMAND ${CUSTOM_PYTHON_EXECUTABLE} -c | ||
"from distutils.sysconfig import *; print get_python_inc()" | ||
OUTPUT_VARIABLE PYTHON_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
if(PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS) | ||
SET(PYTHONLIBS_FOUND TRUE) | ||
message("-- Found PythonLibs: " ${PYTHON_LIBRARIES}) | ||
message("-- -- Used custom search path") | ||
else() | ||
find_package(PythonLibs REQUIRED) | ||
message("-- -- Used find_package(PythonLibs)") | ||
endif() | ||
endif() | ||
|
||
if(APPLE) | ||
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") | ||
endif(APPLE) | ||
|
||
include_directories("${PYTHON_INCLUDE_DIRS}") | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} --std=c99 -Werror") | ||
|
||
if (UNIX AND NOT APPLE) | ||
link_libraries(rt) | ||
endif() | ||
|
||
set(PHOTON_CLIENT_LIB "${CMAKE_SOURCE_DIR}/build/photon_client.a" CACHE STRING | ||
"Path to photon_client.a") | ||
|
||
set(COMMON_LIB "${CMAKE_SOURCE_DIR}/../common/build/libcommon.a" CACHE STRING | ||
"Path to libcommon.a") | ||
|
||
include_directories("${CMAKE_SOURCE_DIR}/") | ||
include_directories("${CMAKE_SOURCE_DIR}/../") | ||
include_directories("${CMAKE_SOURCE_DIR}/../common/") | ||
include_directories("${CMAKE_SOURCE_DIR}/../common/thirdparty/") | ||
include_directories("${CMAKE_SOURCE_DIR}/../common/lib/python/") | ||
|
||
add_library(photon SHARED | ||
photon_extension.c | ||
../common/lib/python/common_extension.c) | ||
|
||
get_filename_component(PYTHON_SHARED_LIBRARY ${PYTHON_LIBRARIES} NAME) | ||
if(APPLE) | ||
add_custom_command(TARGET photon | ||
POST_BUILD COMMAND | ||
${CMAKE_INSTALL_NAME_TOOL} -change ${PYTHON_SHARED_LIBRARY} ${PYTHON_LIBRARIES} libphoton.so) | ||
endif(APPLE) | ||
|
||
target_link_libraries(photon ${PHOTON_CLIENT_LIB} ${COMMON_LIB} ${PYTHON_LIBRARIES}) | ||
|
||
install(TARGETS photon DESTINATION ${CMAKE_SOURCE_DIR}/photon) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from libphoton import * |
Oops, something went wrong.