Skip to content

Commit

Permalink
arrow 14.0.0 with new setup (more granular libraries; no more legacy …
Browse files Browse the repository at this point in the history
…outputs) (#1201)

automerged PR by conda-forge/automerge-action
  • Loading branch information
github-actions[bot] authored Nov 7, 2023
2 parents ebafe76 + a19a47b commit 3eaea8a
Show file tree
Hide file tree
Showing 23 changed files with 930 additions and 315 deletions.
24 changes: 12 additions & 12 deletions .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .azure-pipelines/azure-pipelines-win.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

120 changes: 99 additions & 21 deletions README.md

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions recipe/build-arrow.bat → recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ cmake -G "Ninja" ^
..
if %ERRORLEVEL% neq 0 exit 1

cmake --build . --target install --config Release
cmake --build . --config Release
if %ERRORLEVEL% neq 0 exit 1

popd

:: clean up between builds (and to save space)
rmdir /s /q cpp\build
4 changes: 4 additions & 0 deletions recipe/build-pyarrow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ BUILD_EXT_FLAGS=""
# Enable CUDA support
if [[ ! -z "${cuda_compiler_version+x}" && "${cuda_compiler_version}" != "None" ]]; then
export PYARROW_WITH_CUDA=1
if [[ "${build_platform}" != "${target_platform}" ]]; then
export CUDAToolkit_ROOT=${CUDA_HOME}
export CMAKE_LIBRARY_PATH=${CONDA_BUILD_SYSROOT}/lib
fi
else
export PYARROW_WITH_CUDA=0
fi
Expand Down
18 changes: 4 additions & 14 deletions recipe/build-arrow.sh → recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
#!/bin/bash
set -ex

# Copy the [de]activate scripts to $PREFIX/etc/conda/[de]activate.d, see
# https://conda-forge.org/docs/maintainer/adding_pkgs.html#activate-scripts
for CHANGE in "activate"
do
mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
cp "${RECIPE_DIR}/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
done

mkdir cpp/build
mkdir -p cpp/build
pushd cpp/build

EXTRA_CMAKE_ARGS=""
Expand All @@ -30,7 +22,7 @@ fi
# Enable CUDA support
if [[ ! -z "${cuda_compiler_version+x}" && "${cuda_compiler_version}" != "None" ]]
then
EXTRA_CMAKE_ARGS=" ${EXTRA_CMAKE_ARGS} -DARROW_CUDA=ON -DCUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME} -DCMAKE_LIBRARY_PATH=${CONDA_BUILD_SYSROOT}/lib"
EXTRA_CMAKE_ARGS=" ${EXTRA_CMAKE_ARGS} -DARROW_CUDA=ON -DCUDAToolkit_ROOT=${CUDA_HOME} -DCMAKE_LIBRARY_PATH=${CONDA_BUILD_SYSROOT}/lib"
else
EXTRA_CMAKE_ARGS=" ${EXTRA_CMAKE_ARGS} -DARROW_CUDA=OFF"
fi
Expand Down Expand Up @@ -116,9 +108,7 @@ cmake -GNinja \
${EXTRA_CMAKE_ARGS} \
..

cmake --build . --target install --config Release
# Do not install arrow, only build.
cmake --build . --config Release

popd

# clean up between builds (and to save space)
rm -rf cpp/build
85 changes: 85 additions & 0 deletions recipe/install-libarrow.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
@echo on

:: Create temporary prefix to be able to install files more granularly
mkdir temp_prefix

cmake --install .\cpp\build --prefix=.\temp_prefix

if [%PKG_NAME%] == [libarrow] (
move .\temp_prefix\lib\arrow.lib %LIBRARY_LIB%
move .\temp_prefix\bin\arrow.dll %LIBRARY_BIN%
move .\temp_prefix\lib\arrow_cuda.lib %LIBRARY_LIB% || true
move .\temp_prefix\bin\arrow_cuda.dll %LIBRARY_BIN% || true
copy .\temp_prefix\lib\pkgconfig\arrow.pc %LIBRARY_LIB%\pkgconfig
copy .\temp_prefix\lib\pkgconfig\arrow-compute.pc %LIBRARY_LIB%\pkgconfig
copy .\temp_prefix\lib\pkgconfig\arrow-cuda.pc %LIBRARY_LIB%\pkgconfig || true
copy .\temp_prefix\lib\pkgconfig\arrow-filesystem.pc %LIBRARY_LIB%\pkgconfig
copy .\temp_prefix\lib\pkgconfig\arrow-json.pc %LIBRARY_LIB%\pkgconfig
copy .\temp_prefix\lib\pkgconfig\arrow-orc.pc %LIBRARY_LIB%\pkgconfig
mkdir %LIBRARY_LIB%\cmake\Arrow
move .\temp_prefix\lib\cmake\Arrow\* %LIBRARY_LIB%\cmake\Arrow
mkdir %LIBRARY_LIB%\cmake\ArrowCUDA
move .\temp_prefix\lib\cmake\ArrowCUDA\* %LIBRARY_LIB%\cmake\ArrowCUDA || true
mkdir %LIBRARY_PREFIX%\share\doc\arrow
move .\temp_prefix\share\doc\arrow\* %LIBRARY_PREFIX%\share\doc\arrow
mkdir %LIBRARY_PREFIX%\share\arrow
xcopy /s /y .\temp_prefix\share\arrow %LIBRARY_PREFIX%\share\arrow
mkdir %LIBRARY_PREFIX%\include\arrow
xcopy /s /y .\temp_prefix\include\arrow %LIBRARY_PREFIX%\include\arrow
) else if [%PKG_NAME%] == [libarrow-acero] (
move .\temp_prefix\lib\arrow_acero.lib %LIBRARY_LIB%
move .\temp_prefix\bin\arrow_acero.dll %LIBRARY_BIN%
copy .\temp_prefix\lib\pkgconfig\arrow-acero.pc %LIBRARY_LIB%\pkgconfig
mkdir %LIBRARY_LIB%\cmake\ArrowAcero
move .\temp_prefix\lib\cmake\ArrowAcero\* %LIBRARY_LIB%\cmake\ArrowAcero
) else if [%PKG_NAME%] == [libarrow-dataset] (
move .\temp_prefix\lib\arrow_dataset.lib %LIBRARY_LIB%
move .\temp_prefix\bin\arrow_dataset.dll %LIBRARY_BIN%
copy .\temp_prefix\lib\pkgconfig\arrow-dataset.pc %LIBRARY_LIB%\pkgconfig
mkdir %LIBRARY_LIB%\cmake\ArrowDataset
move .\temp_prefix\lib\cmake\ArrowDataset\* %LIBRARY_LIB%\cmake\ArrowDataset
) else if [%PKG_NAME%] == [libarrow-flight] (
move .\temp_prefix\lib\arrow_flight.lib %LIBRARY_LIB%
move .\temp_prefix\bin\arrow_flight.dll %LIBRARY_BIN%
copy .\temp_prefix\lib\pkgconfig\arrow-flight.pc %LIBRARY_LIB%\pkgconfig
mkdir %LIBRARY_LIB%\cmake\ArrowFlight
move .\temp_prefix\lib\cmake\ArrowFlight\* %LIBRARY_LIB%\cmake\ArrowFlight
) else if [%PKG_NAME%] == [libarrow-flight-sql] (
move .\temp_prefix\lib\arrow_flight_sql.lib %LIBRARY_LIB%
move .\temp_prefix\bin\arrow_flight_sql.dll %LIBRARY_BIN%
copy .\temp_prefix\lib\pkgconfig\arrow-flight-sql.pc %LIBRARY_LIB%\pkgconfig
mkdir %LIBRARY_LIB%\cmake\ArrowFlightSql
move .\temp_prefix\lib\cmake\ArrowFlightSql\* %LIBRARY_LIB%\cmake\ArrowFlightSql
) else if [%PKG_NAME%] == [libarrow-gandiva] (
move .\temp_prefix\lib\gandiva.lib %LIBRARY_LIB%
move .\temp_prefix\bin\gandiva.dll %LIBRARY_BIN%
copy .\temp_prefix\lib\pkgconfig\gandiva.pc %LIBRARY_LIB%\pkgconfig
mkdir %LIBRARY_LIB%\cmake\Gandiva
move .\temp_prefix\lib\cmake\Gandiva\* %LIBRARY_LIB%\cmake\Gandiva
mkdir %LIBRARY_PREFIX%\include\gandiva
xcopy /s /y .\temp_prefix\include\gandiva %LIBRARY_PREFIX%\include\gandiva
) else if [%PKG_NAME%] == [libarrow-substrait] (
move .\temp_prefix\lib\arrow_substrait.lib %LIBRARY_LIB%
move .\temp_prefix\bin\arrow_substrait.dll %LIBRARY_BIN%
copy .\temp_prefix\lib\pkgconfig\arrow-substrait.pc %LIBRARY_LIB%\pkgconfig
mkdir %LIBRARY_LIB%\cmake\ArrowSubstrait
move .\temp_prefix\lib\cmake\ArrowSubstrait\* %LIBRARY_LIB%\cmake\ArrowSubstrait
) else if [%PKG_NAME%] == [libparquet] (
move .\temp_prefix\lib\parquet.lib %LIBRARY_LIB%
move .\temp_prefix\bin\parquet.dll %LIBRARY_BIN%
copy .\temp_prefix\lib\pkgconfig\parquet.pc %LIBRARY_LIB%\pkgconfig
mkdir %LIBRARY_LIB%\cmake\Parquet
move .\temp_prefix\lib\cmake\Parquet\* %LIBRARY_LIB%\cmake\Parquet
mkdir %LIBRARY_PREFIX%\include\parquet
xcopy /s /y .\temp_prefix\include\parquet %LIBRARY_PREFIX%\include\parquet
) else if [%PKG_NAME%] == [libarrow-all] (
REM libarrow-all: install everything else (whatever ends up in this output
REM should generally be installed into the appropriate libarrow-<flavour>).
cmake --install .\cpp\build --prefix=%LIBRARY_PREFIX%
) else (
REM shouldn't happen
exit 1
)

:: clean up temp_prefix between builds
rmdir /s /q temp_prefix
87 changes: 87 additions & 0 deletions recipe/install-libarrow.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/bin/bash
set -ex

# temporary prefix to be able to install files more granularly
mkdir temp_prefix

cmake --install ./cpp/build --prefix=./temp_prefix

if [[ "${PKG_NAME}" == "libarrow" ]]; then
# only libarrow (+ activation scripts)
cp ./temp_prefix/lib/libarrow.* $PREFIX/lib
cp ./temp_prefix/lib/libarrow_cuda.* $PREFIX/lib || true
cp ./temp_prefix/lib/pkgconfig/arrow.pc $PREFIX/lib/pkgconfig
cp ./temp_prefix/lib/pkgconfig/arrow-compute.pc $PREFIX/lib/pkgconfig
cp ./temp_prefix/lib/pkgconfig/arrow-cuda.pc $PREFIX/lib/pkgconfig || true
cp ./temp_prefix/lib/pkgconfig/arrow-filesystem.pc $PREFIX/lib/pkgconfig
cp ./temp_prefix/lib/pkgconfig/arrow-json.pc $PREFIX/lib/pkgconfig
cp ./temp_prefix/lib/pkgconfig/arrow-orc.pc $PREFIX/lib/pkgconfig
cp -R ./temp_prefix/lib/cmake/Arrow/. $PREFIX/lib/cmake/Arrow
cp -R ./temp_prefix/lib/cmake/ArrowCUDA/. $PREFIX/lib/cmake/ArrowCUDA || true
cp -R ./temp_prefix/share/arrow/. $PREFIX/share/arrow
cp -R ./temp_prefix/share/doc/. $PREFIX/share/doc
cp -R ./temp_prefix/share/gdb/. $PREFIX/share/gdb
cp -R ./temp_prefix/include/arrow/. $PREFIX/include/arrow

# Copy the [de]activate scripts to $PREFIX/etc/conda/[de]activate.d, see
# https://conda-forge.org/docs/maintainer/adding_pkgs.html#activate-scripts
for CHANGE in "activate"
do
mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
cp "${RECIPE_DIR}/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
done
elif [[ "${PKG_NAME}" == "libarrow-acero" ]]; then
# only libarrow-acero
cp ./temp_prefix/lib/libarrow_acero.* $PREFIX/lib
cp ./temp_prefix/lib/pkgconfig/arrow-acero.pc $PREFIX/lib/pkgconfig
cp -R ./temp_prefix/lib/cmake/ArrowAcero/. $PREFIX/lib/cmake/ArrowAcero
elif [[ "${PKG_NAME}" == "libarrow-dataset" ]]; then
# only libarrow-dataset
cp ./temp_prefix/lib/libarrow_dataset.* $PREFIX/lib
cp ./temp_prefix/lib/pkgconfig/arrow-dataset.pc $PREFIX/lib/pkgconfig
cp -R ./temp_prefix/lib/cmake/ArrowDataset/. $PREFIX/lib/cmake/ArrowDataset
elif [[ "${PKG_NAME}" == "libarrow-flight" ]]; then
# only libarrow-flight
cp ./temp_prefix/lib/libarrow_flight.* $PREFIX/lib
cp ./temp_prefix/lib/libarrow_flight_transport_ucx.* $PREFIX/lib || true
cp ./temp_prefix/lib/pkgconfig/arrow-flight.pc $PREFIX/lib/pkgconfig
cp -R ./temp_prefix/lib/cmake/ArrowFlight/. $PREFIX/lib/cmake/ArrowFlight
elif [[ "${PKG_NAME}" == "libarrow-flight-sql" ]]; then
# only libarrow-flight-sql
cp ./temp_prefix/lib/libarrow_flight_sql.* $PREFIX/lib
cp ./temp_prefix/lib/pkgconfig/arrow-flight-sql.pc $PREFIX/lib/pkgconfig
cp -R ./temp_prefix/lib/cmake/ArrowFlightSql/. $PREFIX/lib/cmake/ArrowFlightSql
elif [[ "${PKG_NAME}" == "libarrow-gandiva" ]]; then
# only libarrow-gandiva
cp ./temp_prefix/lib/libgandiva.* $PREFIX/lib
cp ./temp_prefix/lib/pkgconfig/gandiva.pc $PREFIX/lib/pkgconfig
cp -R ./temp_prefix/lib/cmake/Gandiva/. $PREFIX/lib/cmake/Gandiva
cp -R ./temp_prefix/include/gandiva/. $PREFIX/include/gandiva
elif [[ "${PKG_NAME}" == "libarrow-substrait" ]]; then
# only libarrow-substrait
cp ./temp_prefix/lib/libarrow_substrait.* $PREFIX/lib
cp ./temp_prefix/lib/pkgconfig/arrow-substrait.pc $PREFIX/lib/pkgconfig
cp -R ./temp_prefix/lib/cmake/ArrowSubstrait/. $PREFIX/lib/cmake/ArrowSubstrait
elif [[ "${PKG_NAME}" == "libparquet" ]]; then
# only parquet
cp ./temp_prefix/lib/libparquet.* $PREFIX/lib
cp ./temp_prefix/lib/pkgconfig/parquet.pc $PREFIX/lib/pkgconfig
cp -R ./temp_prefix/lib/cmake/Parquet/. $PREFIX/lib/cmake/Parquet
cp -R ./temp_prefix/include/parquet/. $PREFIX/include/parquet
elif [[ "${PKG_NAME}" == "libarrow-all" ]]; then
# libarrow-all: install everything else (whatever ends up in this output
# should generally be installed into the appropriate libarrow-<flavour>).
cmake --install ./cpp/build --prefix=$PREFIX
else
# shouldn't happen
exit 1
fi

if [[ "${PKG_NAME}" != "libarrow" ]]; then
# delete symlink that's created by libarrow's activation script,
# to avoid that it gets wrongly detected as content of libarrow-*.
rm $PREFIX/share/gdb/auto-load/$PREFIX/lib/libarrow.*-gdb.py || true
fi

# Clean up temp_prefix
rm -rf temp_prefix
Loading

0 comments on commit 3eaea8a

Please sign in to comment.