Skip to content

Commit

Permalink
ARROW-68: Better error handling for not fully setup systems
Browse files Browse the repository at this point in the history
Author: Micah Kornfield <emkornfield@gmail.com>

Closes #27 from emkornfield/emk_add_nice_errors_PR and squashes the following commits:

c0b9d78 [Micah Kornfield] ARROW-68: Better error handling for systems missing prerequistites
  • Loading branch information
emkornfield authored and wesm committed Mar 17, 2016
1 parent 5881aac commit c996610
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cpp/setup_build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)

./thirdparty/download_thirdparty.sh
./thirdparty/build_thirdparty.sh
./thirdparty/download_thirdparty.sh || { echo "download_thirdparty.sh failed" ; return; }
./thirdparty/build_thirdparty.sh || { echo "build_thirdparty.sh failed" ; return; }
source thirdparty/versions.sh

export GTEST_HOME=$SOURCE_DIR/thirdparty/$GTEST_BASEDIR
Expand Down
9 changes: 6 additions & 3 deletions cpp/thirdparty/build_thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,21 @@ ln -sf lib "$PREFIX/lib64"
# use the compiled tools
export PATH=$PREFIX/bin:$PATH

type cmake >/dev/null 2>&1 || { echo >&2 "cmake not installed. Aborting."; exit 1; }
type make >/dev/null 2>&1 || { echo >&2 "make not installed. Aborting."; exit 1; }

# build googletest
GOOGLETEST_ERROR="failed for googletest!"
if [ -n "$F_ALL" -o -n "$F_GTEST" ]; then
cd $TP_DIR/$GTEST_BASEDIR

if [[ "$OSTYPE" == "darwin"* ]]; then
CXXFLAGS=-fPIC cmake -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-value -Wno-ignored-attributes"
CXXFLAGS=-fPIC cmake -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-value -Wno-ignored-attributes" || { echo "cmake $GOOGLETEST_ERROR" ; exit 1; }
else
CXXFLAGS=-fPIC cmake .
CXXFLAGS=-fPIC cmake . || { echo "cmake $GOOGLETEST_ERROR"; exit 1; }
fi

make VERBOSE=1
make VERBOSE=1 || { echo "Make $GOOGLETEST_ERROR" ; exit 1; }
fi

echo "---------------------"
Expand Down
1 change: 1 addition & 0 deletions cpp/thirdparty/download_thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TP_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
source $TP_DIR/versions.sh

download_extract_and_cleanup() {
type curl >/dev/null 2>&1 || { echo >&2 "curl not installed. Aborting."; exit 1; }
filename=$TP_DIR/$(basename "$1")
curl -#LC - "$1" -o $filename
tar xzf $filename -C $TP_DIR
Expand Down

0 comments on commit c996610

Please sign in to comment.