mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
More build fixes. Can now import pyarrow
This commit is contained in:
1 parent
5162203de7
commit
8f4928e694
2 files changed
+24
-13
No files matched your search
@@ -164,9 +164,6 @@ endif()
|
||||
# act on its value.
|
||||
if ("${PYARROW_LINK}" STREQUAL "d")
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
|
||||
# Position independent code is only necessary when producing shared objects.
|
||||
add_definitions(-fPIC)
|
||||
endif()
|
||||
|
||||
# set compile output directory
|
||||
@@ -186,9 +183,16 @@ if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
|
||||
EXECUTE_PROCESS(COMMAND ln ${MORE_ARGS} -sf ${BUILD_OUTPUT_ROOT_DIRECTORY}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/build/latest)
|
||||
else()
|
||||
set(BUILD_OUTPUT_ROOT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${BUILD_SUBDIR_NAME}/")
|
||||
if (MSVC)
|
||||
# MSVC makes its own output directories based on the build configuration
|
||||
set(BUILD_OUTPUT_ROOT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/")
|
||||
else()
|
||||
set(BUILD_OUTPUT_ROOT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${BUILD_SUBDIR_NAME}/")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "Build output directory: ${BUILD_OUTPUT_ROOT_DIRECTORY}")
|
||||
|
||||
# where to put generated archives (.a files)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}")
|
||||
set(ARCHIVE_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}")
|
||||
|
||||
+16
-9
@@ -91,6 +91,13 @@ class build_ext(_build_ext):
|
||||
_build_ext.initialize_options(self)
|
||||
self.extra_cmake_args = os.environ.get('PYARROW_CMAKE_OPTIONS', '')
|
||||
self.build_type = os.environ.get('PYARROW_BUILD_TYPE', 'debug').lower()
|
||||
|
||||
if sys.platform == 'win32':
|
||||
# Cannot do debug builds in Windows unless Python itself is a debug
|
||||
# build
|
||||
if not hasattr(sys, 'gettotalrefcount'):
|
||||
self.build_type = 'release'
|
||||
|
||||
self.with_parquet = strtobool(
|
||||
os.environ.get('PYARROW_WITH_PARQUET', '0'))
|
||||
self.with_jemalloc = strtobool(
|
||||
@@ -147,10 +154,10 @@ class build_ext(_build_ext):
|
||||
if self.bundle_arrow_cpp:
|
||||
cmake_options.append('-DPYARROW_BUNDLE_ARROW_CPP=ON')
|
||||
|
||||
if sys.platform != 'win32':
|
||||
cmake_options.append('-DCMAKE_BUILD_TYPE={0}'
|
||||
.format(self.build_type))
|
||||
cmake_options.append('-DCMAKE_BUILD_TYPE={0}'
|
||||
.format(self.build_type))
|
||||
|
||||
if sys.platform != 'win32':
|
||||
cmake_command = (['cmake', self.extra_cmake_args] +
|
||||
cmake_options + [source])
|
||||
|
||||
@@ -164,15 +171,15 @@ class build_ext(_build_ext):
|
||||
self.spawn(args)
|
||||
else:
|
||||
import shlex
|
||||
cmake_generator = 'Visual Studio 14 2015'
|
||||
if is_64_bit:
|
||||
cmake_generator += ' Win64'
|
||||
cmake_generator = 'Visual Studio 14 2015 Win64'
|
||||
if not is_64_bit:
|
||||
raise RuntimeError('Not supported on 32-bit Windows')
|
||||
|
||||
# Generate the build files
|
||||
extra_cmake_args = shlex.split(self.extra_cmake_args)
|
||||
cmake_command = (['cmake'] + extra_cmake_args +
|
||||
cmake_options +
|
||||
[source,
|
||||
'-G', cmake_generator])
|
||||
[source, '-G', cmake_generator])
|
||||
if "-G" in self.extra_cmake_args:
|
||||
cmake_command = cmake_command[:-2]
|
||||
|
||||
@@ -333,7 +340,7 @@ setup(
|
||||
use_scm_version={"root": "..", "relative_to": __file__},
|
||||
setup_requires=['setuptools_scm', 'cython >= 0.23'],
|
||||
install_requires=['numpy >= 1.9', 'six >= 1.0.0'],
|
||||
test_requires=['pytest'],
|
||||
tests_require=['pytest'],
|
||||
description="Python library for Apache Arrow",
|
||||
long_description=long_description,
|
||||
classifiers=[
|
||||
|
||||
Reference in new issue
Block a user