Skip to content

Commit

Permalink
ARROW-4933: [R] Autodetect Parquet support using pkg-config
Browse files Browse the repository at this point in the history
Kudos go to @kou for this.

Author: Uwe L. Korn <[email protected]>

Closes apache#3946 from xhochy/ARROW-4933 and squashes the following commits:

abc7d40 <Uwe L. Korn> ARROW-4933:  Autodetect Parquet support using pkg-config
  • Loading branch information
xhochy authored and wesm committed Mar 17, 2019
1 parent 79c93c7 commit 974b723
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,26 @@ PKG_RPM_NAME="arrow"
PKG_CSW_NAME="arrow"
PKG_BREW_NAME="apache-arrow"
PKG_TEST_HEADER="<arrow/api.h>"
PKG_LIBS="-larrow -lparquet"
PKG_LIBS=""

# Use pkg-config if available
pkg-config --version >/dev/null 2>&1
if [ $? -eq 0 ]; then
PKGCONFIG_CFLAGS=`pkg-config --cflags --silence-errors ${PKG_CONFIG_NAME}`
PKGCONFIG_LIBS=`pkg-config --libs ${PKG_CONFIG_NAME}`
PKGCONFIG_CFLAGS=$(pkg-config --cflags arrow)
if [ $? -ne 0 ]; then
echo "Apache Arrow C++ was not found using pkg-config"
exit 1
fi
PKGCONFIG_LIBS=$(pkg-config --libs arrow)
PKGCONFIG_CFLAGS_PARQUET=$(pkg-config --cflags parquet)
if [ $? -eq 0 ]; then
PKGCONFIG_CFLAGS="${PKGCONFIG_CFLAGS} ${PKGCONFIG_CFLAGS_PARQUET} -DARROW_R_WITH_PARQUET"
PKGCONFIG_LIBS="${PKGCONFIG_LIBS} $(pkg-config --libs parquet)"
fi
else
PKG_LIBS="-larrow -lparquet"
fi

# Note that cflags may be empty in case of success
Expand Down

0 comments on commit 974b723

Please sign in to comment.