Skip to content
Open
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
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,7 @@ repos:
(
?^c_glib/.*\.sh$|
?^ci/.*\.sh$|
?^cpp/build-support/.*\.sh$|
?^cpp/examples/minimal_build/run\.sh$|
?^cpp/examples/tutorial_examples/.*\.sh$|
?^cpp/src/.*\.sh$|
?^cpp/thirdparty/download_dependencies\.sh$|
?^cpp/.*\.sh$|
?^dev/release/05-binary-upload\.sh$|
?^dev/release/07-flightsqlodbc-upload\.sh$|
?^dev/release/08-publish-gh-release\.sh$|
Expand Down
12 changes: 8 additions & 4 deletions cpp/examples/minimal_build/build_arrow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ set -ex

NPROC=$(nproc)

mkdir -p $ARROW_BUILD_DIR
pushd $ARROW_BUILD_DIR
mkdir -p "$ARROW_BUILD_DIR"
pushd "$ARROW_BUILD_DIR"

# Convert the space-separated CMake options into a Bash array.
# This avoids ShellCheck SC2086 and preserves argument boundaries.
read -r -a ARROW_CMAKE_OPTIONS_ARRAY <<< "$ARROW_CMAKE_OPTIONS"

# Enable the CSV reader as it's used by the example third-party build
cmake /arrow/cpp \
-DARROW_CSV=ON \
-DARROW_MIMALLOC=OFF \
$ARROW_CMAKE_OPTIONS
"${ARROW_CMAKE_OPTIONS_ARRAY[@]}"

make -j$NPROC
make -j"$NPROC"
make install

popd
4 changes: 2 additions & 2 deletions cpp/examples/minimal_build/build_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

set -ex

mkdir -p $EXAMPLE_BUILD_DIR
pushd $EXAMPLE_BUILD_DIR
mkdir -p "$EXAMPLE_BUILD_DIR"
pushd "$EXAMPLE_BUILD_DIR"

cmake /io
make
Expand Down
58 changes: 33 additions & 25 deletions cpp/examples/minimal_build/run_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,38 @@

set -e

: ${ARROW_DIR:=/arrow}
: ${EXAMPLE_DIR:=/io}
: ${ARROW_BUILD_DIR:=/build/arrow}
: ${EXAMPLE_BUILD_DIR:=/build/example}
: "${ARROW_DIR:=/arrow}"
: "${EXAMPLE_DIR:=/io}"
: "${ARROW_BUILD_DIR:=/build/arrow}"
: "${EXAMPLE_BUILD_DIR:=/build/example}"

: ${ARROW_DEPENDENCY_SOURCE:=BUNDLED}
: "${ARROW_DEPENDENCY_SOURCE:=BUNDLED}"

echo
echo "=="
echo "== Building Arrow C++ library"
echo "=="
echo

mkdir -p $ARROW_BUILD_DIR
pushd $ARROW_BUILD_DIR
mkdir -p "$ARROW_BUILD_DIR"
pushd "$ARROW_BUILD_DIR"

NPROC=$(nproc)

cmake $ARROW_DIR/cpp \
# Convert the space-separated CMake options into a Bash array.
# This avoids ShellCheck SC2086 and preserves argument boundaries.
read -r -a ARROW_CMAKE_OPTIONS_ARRAY <<< "$ARROW_CMAKE_OPTIONS"

cmake "$ARROW_DIR"/cpp \
-DARROW_BUILD_SHARED=OFF \
-DARROW_BUILD_STATIC=ON \
-DARROW_CSV=ON \
-DARROW_DEPENDENCY_SOURCE=${ARROW_DEPENDENCY_SOURCE} \
-DARROW_DEPENDENCY_SOURCE="${ARROW_DEPENDENCY_SOURCE}" \
-DARROW_DEPENDENCY_USE_SHARED=OFF \
-Dxsimd_SOURCE=BUNDLED \
$ARROW_CMAKE_OPTIONS
"${ARROW_CMAKE_OPTIONS_ARRAY[@]}"

make -j$NPROC
make -j"$NPROC"
make install

popd
Expand All @@ -57,11 +61,11 @@ echo "== Building example project using Arrow C++ library"
echo "=="
echo

rm -rf $EXAMPLE_BUILD_DIR
mkdir -p $EXAMPLE_BUILD_DIR
pushd $EXAMPLE_BUILD_DIR
rm -rf "$EXAMPLE_BUILD_DIR"
mkdir -p "$EXAMPLE_BUILD_DIR"
pushd "$EXAMPLE_BUILD_DIR"

cmake $EXAMPLE_DIR -DARROW_LINK_SHARED=OFF
cmake "$EXAMPLE_DIR" -DARROW_LINK_SHARED=OFF
make

popd
Expand All @@ -73,9 +77,9 @@ echo "== Running example project"
echo "=="
echo

pushd $EXAMPLE_DIR
pushd "$EXAMPLE_DIR"

$EXAMPLE_BUILD_DIR/arrow-example
"${EXAMPLE_BUILD_DIR}/arrow-example"

echo
echo "=="
Expand All @@ -84,13 +88,17 @@ echo "== Building example project using Arrow C++ library"
echo "=="
echo

rm -rf $EXAMPLE_BUILD_DIR
mkdir -p $EXAMPLE_BUILD_DIR
read -ra ARROW_BUILD_FLAGS <<< "$(
PKG_CONFIG_PATH="$ARROW_BUILD_DIR/lib/pkgconfig" \
pkg-config --cflags --libs --static arrow
)"

rm -rf "$EXAMPLE_BUILD_DIR"
mkdir -p "$EXAMPLE_BUILD_DIR"
${CXX:-c++} -std=c++20 \
-o $EXAMPLE_BUILD_DIR/arrow-example \
$EXAMPLE_DIR/example.cc \
$(PKG_CONFIG_PATH=$ARROW_BUILD_DIR/lib/pkgconfig \
pkg-config --cflags --libs --static arrow)
-o "${EXAMPLE_BUILD_DIR}/arrow-example" \
"${EXAMPLE_DIR}/example.cc" \
"${ARROW_BUILD_FLAGS[@]}"

popd

Expand All @@ -101,6 +109,6 @@ echo "== Running example project"
echo "=="
echo

pushd $EXAMPLE_DIR
pushd "$EXAMPLE_DIR"

$EXAMPLE_BUILD_DIR/arrow-example
"${EXAMPLE_BUILD_DIR}/arrow-example"
Loading