Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
option(PYARROW_BUILD_PARQUET
"Build the PyArrow Parquet integration"
OFF)
option(PYARROW_BUILD_PLASMA
"Build the PyArrow Plasma integration"
OFF)
option(PYARROW_BUNDLE_ARROW_CPP
"Bundle the Arrow C++ libraries"
OFF)
Expand Down Expand Up @@ -157,12 +160,6 @@ include_directories(SYSTEM
find_package(Arrow REQUIRED)
include_directories(SYSTEM ${ARROW_INCLUDE_DIR})

## Plasma
find_package(Plasma)
if (PLASMA_FOUND)
include_directories(SYSTEM ${PLASMA_INCLUDE_DIR})
endif()

function(bundle_arrow_lib library_path)
get_filename_component(LIBRARY_DIR ${${library_path}} DIRECTORY)
get_filename_component(LIBRARY_NAME ${${library_path}} NAME_WE)
Expand Down Expand Up @@ -195,9 +192,6 @@ if (PYARROW_BUNDLE_ARROW_CPP)
file(COPY ${ARROW_INCLUDE_DIR}/arrow DESTINATION ${BUILD_OUTPUT_ROOT_DIRECTORY}/include)
bundle_arrow_lib(ARROW_SHARED_LIB)
bundle_arrow_lib(ARROW_PYTHON_SHARED_LIB)
if (PLASMA_FOUND)
bundle_arrow_lib(PLASMA_SHARED_LIB)
endif()
endif()

if (MSVC)
Expand All @@ -224,14 +218,9 @@ set(CYTHON_EXTENSIONS
lib
)

if (PLASMA_FOUND)
set(CYTHON_EXTENSIONS ${CYTHON_EXTENSIONS} plasma)
endif()

set(LINK_LIBS
arrow_shared
arrow_python_shared
${PLASMA_SHARED_LIB}
)

if (PYARROW_BUILD_PARQUET)
Expand Down Expand Up @@ -284,6 +273,29 @@ if (PYARROW_BUILD_PARQUET)
_parquet)
endif()

## Plasma
if (PYARROW_BUILD_PLASMA)
find_package(Plasma)

if(NOT PLASMA_FOUND)
message(FATAL_ERROR "Unable to locate Plasma libraries")
endif()

include_directories(SYSTEM ${PLASMA_INCLUDE_DIR})
ADD_THIRDPARTY_LIB(libplasma
SHARED_LIB ${PLASMA_SHARED_LIB})

if (PYARROW_BUNDLE_ARROW_CPP)
bundle_arrow_lib(PLASMA_SHARED_LIB)
endif()
set(LINK_LIBS
${LINK_LIBS}
libplasma_shared)

set(CYTHON_EXTENSIONS ${CYTHON_EXTENSIONS} plasma)
file(COPY ${PLASMA_EXECUTABLE} DESTINATION ${BUILD_OUTPUT_ROOT_DIRECTORY})
endif()

############################################################
# Setup and build Cython modules
############################################################
Expand Down Expand Up @@ -330,7 +342,3 @@ foreach(module ${CYTHON_EXTENSIONS})

target_link_libraries(${module_name} ${LINK_LIBS})
endforeach(module)

if (PLASMA_FOUND)
file(COPY ${PLASMA_EXECUTABLE} DESTINATION ${BUILD_OUTPUT_ROOT_DIRECTORY})
endif()
2 changes: 2 additions & 0 deletions python/cmake_modules/FindParquet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ if(PARQUET_HOME)
PATHS ${PARQUET_HOME} NO_DEFAULT_PATH
PATH_SUFFIXES "lib")
get_filename_component(PARQUET_LIBS ${PARQUET_LIBRARIES} PATH )
set(PARQUET_ABI_VERSION "1.0.0")
set(PARQUET_SO_VERSION "1")
else()
pkg_check_modules(PARQUET parquet)
if (PARQUET_FOUND)
Expand Down
16 changes: 12 additions & 4 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,18 @@ def _run_cmake(self):
if self.with_parquet:
cmake_options.append('-DPYARROW_BUILD_PARQUET=on')

if self.with_plasma:
cmake_options.append('-DPYARROW_BUILD_PLASMA=on')

if self.bundle_arrow_cpp:
cmake_options.append('-DPYARROW_BUNDLE_ARROW_CPP=ON')
# ARROW-1090: work around CMake rough edges
if 'ARROW_HOME' in os.environ and sys.platform != 'win32':
os.environ['PKG_CONFIG_PATH'] = pjoin(os.environ['ARROW_HOME'], 'lib', 'pkgconfig')
pkg_config = pjoin(os.environ['ARROW_HOME'], 'lib',
'pkgconfig')
os.environ['PKG_CONFIG_PATH'] = pkg_config
del os.environ['ARROW_HOME']


cmake_options.append('-DCMAKE_BUILD_TYPE={0}'
.format(self.build_type.lower()))

Expand Down Expand Up @@ -243,7 +247,8 @@ def move_lib(lib_name):
print(pjoin(build_prefix, 'include'), pjoin(build_lib, 'pyarrow'))
if os.path.exists(pjoin(build_lib, 'pyarrow', 'include')):
shutil.rmtree(pjoin(build_lib, 'pyarrow', 'include'))
shutil.move(pjoin(build_prefix, 'include'), pjoin(build_lib, 'pyarrow'))
shutil.move(pjoin(build_prefix, 'include'),
pjoin(build_lib, 'pyarrow'))
move_lib("arrow")
move_lib("arrow_python")
if self.with_plasma:
Expand Down Expand Up @@ -280,7 +285,9 @@ def move_lib(lib_name):
if self.with_plasma:
build_py = self.get_finalized_command('build_py')
source = os.path.join(self.build_type, "plasma_store")
target = os.path.join(build_lib, build_py.get_package_dir('pyarrow'), "plasma_store")
target = os.path.join(build_lib,
build_py.get_package_dir('pyarrow'),
"plasma_store")
shutil.move(source, target)

os.chdir(saved_cwd)
Expand Down Expand Up @@ -350,6 +357,7 @@ def get_outputs(self):
language-bindings for structure manipulation. It also provides IPC
and common algorithm implementations."""


class BinaryDistribution(Distribution):
def has_ext_modules(foo):
return True
Expand Down