diff --git a/CMakeLists.txt b/CMakeLists.txt index c3c98ab9a56b1..6b81f911d9d52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,24 +168,19 @@ if(${VELOX_ENABLE_EXAMPLES}) endif() if(${VELOX_BUILD_PYTHON_PACKAGE}) - set(VELOX_BUILD_TESTING OFF) + # set(VELOX_BUILD_TESTING OFF) set(VELOX_ENABLE_PRESTO_FUNCTIONS ON) set(VELOX_ENABLE_DUCKDB ON) set(VELOX_ENABLE_EXPRESSION ON) set(VELOX_ENABLE_PARSE ON) set(VELOX_ENABLE_EXEC ON) - set(VELOX_ENABLE_AGGREGATES OFF) - set(VELOX_ENABLE_HIVE_CONNECTOR OFF) - set(VELOX_ENABLE_TPCH_CONNECTOR OFF) + # set(VELOX_ENABLE_AGGREGATES OFF) set(VELOX_ENABLE_HIVE_CONNECTOR OFF) + # set(VELOX_ENABLE_TPCH_CONNECTOR OFF) set(VELOX_ENABLE_SPARK_FUNCTIONS ON) - set(VELOX_ENABLE_EXAMPLES OFF) - set(VELOX_ENABLE_S3 OFF) - set(VELOX_ENABLE_GCS OFF) - set(VELOX_ENABLE_ABFS OFF) - set(VELOX_ENABLE_SUBSTRAIT OFF) - set(VELOX_ENABLE_CODEGEN_SUPPORT OFF) - set(VELOX_ENABLE_BENCHMARKS_BASIC OFF) - set(VELOX_ENABLE_BENCHMARKS OFF) + # set(VELOX_ENABLE_EXAMPLES OFF) set(VELOX_ENABLE_S3 OFF) set(VELOX_ENABLE_GCS + # OFF) set(VELOX_ENABLE_ABFS OFF) set(VELOX_ENABLE_SUBSTRAIT OFF) + # set(VELOX_ENABLE_CODEGEN_SUPPORT OFF) set(VELOX_ENABLE_BENCHMARKS_BASIC OFF) + # set(VELOX_ENABLE_BENCHMARKS OFF) endif() # We look for OpenSSL here to cache the result enforce the version across our diff --git a/Makefile b/Makefile index 02f385b6eb71e..b3f65bd10f94b 100644 --- a/Makefile +++ b/Makefile @@ -183,7 +183,7 @@ python-clean: DEBUG=1 ${PYTHON_EXECUTABLE} setup.py clean python-build: - DEBUG=1 CMAKE_BUILD_PARALLEL_LEVEL=4 ${PYTHON_EXECUTABLE} -m pip install -e .$(extras) --verbose + DEBUG=1 CMAKE_BUILD_PARALLEL_LEVEL=${NUM_THREADS} ${PYTHON_EXECUTABLE} -m pip install -e .$(extras) --verbose python-test: $(MAKE) python-build extras="[tests]" diff --git a/setup.py b/setup.py index 465e511bb5190..e29a18a7865a2 100644 --- a/setup.py +++ b/setup.py @@ -109,6 +109,14 @@ def run(self): def build_extension(self, ext): extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name))) + # Allow using a pre-built Velox library (for CI and development) + if "VELOX_BUILD_DIR" in os.environ: + velox_dir = os.path.abspath(os.environ["VELOX_BUILD_DIR"]) + + if not os.path.isdir(extdir): + os.symlink(velox_dir, os.path.dirname(extdir), target_is_directory=True) + + return # required for auto-detection of auxiliary "native" libs if not extdir.endswith(os.path.sep): @@ -126,7 +134,6 @@ def build_extension(self, ext): f"-DCMAKE_BUILD_TYPE={cfg}", f"-DCMAKE_INSTALL_PREFIX={extdir}", "-DCMAKE_VERBOSE_MAKEFILE=ON", - "-DVELOX_BUILD_PYTHON_PACKAGE=ON", f"-DPYTHON_EXECUTABLE={exec_path} ", ] build_args = [] @@ -148,9 +155,9 @@ def build_extension(self, ext): os.makedirs(self.build_temp) subprocess.check_call( - ["cmake", str(ROOT_DIR)] + cmake_args, cwd=self.build_temp + ["cmake", str(os.path.join(ROOT_DIR, "pyvelox"))] + cmake_args, + cwd=self.build_temp, ) - print(self.build_temp) subprocess.check_call( ["cmake", "--build", "."] + build_args, cwd=self.build_temp )