Skip to content

Commit

Permalink
ORC-418. Fix broken centos6 compilation.
Browse files Browse the repository at this point in the history
Fixes apache#328

Signed-off-by: Owen O'Malley <omalley@apache.org>
  • Loading branch information
omalley committed Dec 17, 2018
1 parent fd6e832 commit 55a0b76
Show file tree
Hide file tree
Showing 21 changed files with 201 additions and 59 deletions.
6 changes: 3 additions & 3 deletions c++/include/orc/Exceptions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace orc {
public:
explicit NotImplementedYet(const std::string& what_arg);
explicit NotImplementedYet(const char* what_arg);
virtual ~NotImplementedYet() noexcept;
virtual ~NotImplementedYet() ORC_NOEXCEPT;
NotImplementedYet(const NotImplementedYet&);
private:
NotImplementedYet& operator=(const NotImplementedYet&);
Expand All @@ -40,7 +40,7 @@ namespace orc {
public:
explicit ParseError(const std::string& what_arg);
explicit ParseError(const char* what_arg);
virtual ~ParseError() noexcept;
virtual ~ParseError() ORC_NOEXCEPT;
ParseError(const ParseError&);
private:
ParseError& operator=(const ParseError&);
Expand All @@ -50,7 +50,7 @@ namespace orc {
public:
explicit InvalidArgument(const std::string& what_arg);
explicit InvalidArgument(const char* what_arg);
virtual ~InvalidArgument() noexcept;
virtual ~InvalidArgument() ORC_NOEXCEPT;
InvalidArgument(const InvalidArgument&);
private:
InvalidArgument& operator=(const InvalidArgument&);
Expand Down
2 changes: 2 additions & 0 deletions c++/src/Adaptor.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#cmakedefine HAS_STRPTIME
#cmakedefine HAS_STOLL
#cmakedefine HAS_DIAGNOSTIC_PUSH
#cmakedefine HAS_DOUBLE_TO_STRING
#cmakedefine HAS_INT64_TO_STRING
#cmakedefine HAS_PRE_1970
#cmakedefine HAS_POST_2038
#cmakedefine HAS_STD_ISNAN
Expand Down
19 changes: 19 additions & 0 deletions c++/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,25 @@ CHECK_CXX_SOURCE_COMPILES("
NEEDS_REDUNDANT_MOVE
)

CHECK_CXX_SOURCE_COMPILES("
#include<string>
int main(int, char *[]) {
double d = 5;
std::to_string(d);
}"
HAS_DOUBLE_TO_STRING
)

CHECK_CXX_SOURCE_COMPILES("
#include<cstdint>
#include<string>
int main(int, char *[]) {
int64_t d = 5;
std::to_string(d);
}"
HAS_INT64_TO_STRING
)

INCLUDE(CheckCXXSourceRuns)

CHECK_CXX_SOURCE_RUNS("
Expand Down
6 changes: 3 additions & 3 deletions c++/src/Exceptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace orc {
// PASS
}

NotImplementedYet::~NotImplementedYet() noexcept {
NotImplementedYet::~NotImplementedYet() ORC_NOEXCEPT {
// PASS
}

Expand All @@ -53,7 +53,7 @@ namespace orc {
// PASS
}

ParseError::~ParseError() noexcept {
ParseError::~ParseError() ORC_NOEXCEPT {
// PASS
}

Expand All @@ -72,7 +72,7 @@ namespace orc {
// PASS
}

InvalidArgument::~InvalidArgument() noexcept {
InvalidArgument::~InvalidArgument() ORC_NOEXCEPT {
// PASS
}
}
10 changes: 5 additions & 5 deletions c++/src/RLEv1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

namespace orc {

const int MINIMUM_REPEAT = 3;
const int MAXIMUM_REPEAT = 127 + MINIMUM_REPEAT;
const uint64_t MINIMUM_REPEAT = 3;
const uint64_t MAXIMUM_REPEAT = 127 + MINIMUM_REPEAT;

const int64_t BASE_128_MASK = 0x7f;

const int MAX_DELTA = 127;
const int MIN_DELTA = -128;
const int MAX_LITERAL_SIZE = 128;
const int64_t MAX_DELTA = 127;
const int64_t MIN_DELTA = -128;
const uint64_t MAX_LITERAL_SIZE = 128;

RleEncoderV1::RleEncoderV1(
std::unique_ptr<BufferedOutputStream> outStream,
Expand Down
2 changes: 1 addition & 1 deletion c++/src/RLEv1.hh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private:
int numLiterals;
int64_t delta;
bool repeat;
int tailRunLength;
uint64_t tailRunLength;
int bufferPosition;
int bufferLength;
char* buffer;
Expand Down
2 changes: 2 additions & 0 deletions cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ else ()
set(LZ4_INCLUDE_DIR "${LZ4_PREFIX}/include")
set(LZ4_STATIC_LIB "${LZ4_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lz4${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(LZ4_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LZ4_PREFIX}
-DCMAKE_INSTALL_LIBDIR=lib
-DBUILD_SHARED_LIBS=OFF)

if (CMAKE_VERSION VERSION_GREATER "3.7")
Expand Down Expand Up @@ -223,6 +224,7 @@ else ()
set(PROTOBUF_PREFIX "${THIRDPARTY_DIR}/protobuf_ep-install")
set(PROTOBUF_INCLUDE_DIR "${PROTOBUF_PREFIX}/include")
set(PROTOBUF_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROTOBUF_PREFIX}
-DCMAKE_INSTALL_LIBDIR=lib
-DBUILD_SHARED_LIBS=OFF
-Dprotobuf_BUILD_TESTS=OFF)
if (MSVC)
Expand Down
1 change: 1 addition & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
logs
4 changes: 4 additions & 0 deletions docker/README
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ To run the docker scripts:
1. cd $os
2. docker build -t orc-$os .
3. docker run orc-$os

To clean up docker:
1. docker container prune
2. docker image prune
21 changes: 19 additions & 2 deletions docker/centos6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ RUN yum install -y \
gcc-c++ \
gettext-devel \
git \
java-1.7.0-openjdk \
java-1.7.0-openjdk-devel \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel \
libtool \
make \
openssl-devel \
tar \
Expand All @@ -42,6 +43,22 @@ WORKDIR /root
RUN wget "https://www.apache.org/dyn/closer.lua?action=download&filename=/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz" -O maven.tgz
RUN tar xzf maven.tgz
RUN ln -s /root/apache-maven-3.3.9/bin/mvn /usr/bin/mvn
# install a local build of protobuf
RUN wget "https://github.com/protocolbuffers/protobuf/archive/v2.5.0.tar.gz" \
-O protobuf.tgz
RUN tar xzf protobuf.tgz
RUN cd protobuf-2.5.0 && \
autoreconf -f -i -Wall,no-obsolete && \
./configure && \
make install
# install a local build of snappy
RUN wget "https://github.com/google/snappy/archive/1.1.3.tar.gz" \
-O snappy.tgz
RUN tar xzf snappy.tgz
RUN cd snappy-1.1.3 && \
./autogen.sh && \
./configure && \
make install
CMD git clone https://github.com/apache/orc.git -b master && \
mkdir orc/build && \
Expand Down
15 changes: 13 additions & 2 deletions docker/centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,27 @@ RUN yum install -y \
gcc-c++ \
gettext-devel \
git \
java-1.7.0-openjdk \
java-1.7.0-openjdk-devel \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel \
libtool \
make \
maven \
openssl-devel \
tar \
wget \
which \
zlib-devel
ENV TZ=America/Los_Angeles
WORKDIR /root
# install a local build of snappy
RUN wget "https://github.com/google/snappy/archive/1.1.3.tar.gz" \
-O snappy.tgz
RUN tar xzf snappy.tgz
RUN cd snappy-1.1.3 && \
./autogen.sh && \
./configure && \
make install
CMD git clone https://github.com/apache/orc.git -b master && \
mkdir orc/build && \
Expand Down
19 changes: 18 additions & 1 deletion docker/debian8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,36 @@
FROM debian:8
MAINTAINER Owen O'Malley <owen@hortonworks.com>
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" \
>> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y \
autoconf \
cmake \
gcc \
g++ \
git \
libsasl2-dev \
libssl-dev \
libtool \
make \
maven \
openjdk-7-jdk
pkg-config \
wget
RUN apt-get -t jessie-backports install -y openjdk-8-jdk
RUN update-alternatives --set java \
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
WORKDIR /root
# install a local build of snappy
RUN wget "https://github.com/google/snappy/archive/1.1.3.tar.gz" \
-O snappy.tgz
RUN tar xzf snappy.tgz
RUN cd snappy-1.1.3 && \
./autogen.sh && \
./configure && \
make install
CMD git clone https://github.com/apache/orc.git -b master && \
mkdir orc/build && \
Expand Down
6 changes: 6 additions & 0 deletions docker/os-list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
centos6
centos7
debian8
ubuntu12
ubuntu14
ubuntu16
31 changes: 8 additions & 23 deletions docker/debian7/Dockerfile → docker/reinit.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -14,26 +15,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# ORC compile for Debian 7
#

FROM debian:7
MAINTAINER Owen O'Malley <owen@hortonworks.com>
RUN apt-get update
RUN apt-get install -y \
cmake \
gcc \
g++ \
git \
make \
maven \
openjdk-7-jdk
WORKDIR /root
CMD git clone https://github.com/apache/orc.git -b master && \
mkdir orc/build && \
cd orc/build && \
cmake .. && \
make package test-out
start=`date`
for os in `cat os-list.txt`; do
echo "Re-initialize $os"
( cd $os && docker build --no-cache -t "orc-$os" . )
done
echo "Start: $start"
echo "End:" `date`
32 changes: 28 additions & 4 deletions docker/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,35 @@ GITHUB_USER=$1
URL=https://github.com/$GITHUB_USER/orc.git
BRANCH=$2

CLONE="git clone $URL -b $BRANCH"
MAKEDIR="mkdir orc/build && cd orc/build"
mkdir -p logs

start=`date`
for os in centos6 centos7 debian7 debian8 ubuntu12 ubuntu14 ubuntu16; do
for os in `cat os-list.txt`; do
echo "Building $os"
( cd $os && docker build -t "orc-$os" . ) > logs/$os-build.log 2>&1 || exit 1
done
testStart=`date`

for os in `cat os-list.txt`; do
echo "Testing $os"
( cd $os && docker build -t "orc-$os" . )
docker run "orc-$os" /bin/bash -c "git clone $URL -b $BRANCH && mkdir orc/build && cd orc/build && cmake .. && make package test-out" || exit 1
case $os in
centos6|ubuntu12)
OPTS="-DSNAPPY_HOME=/usr/local -DPROTOBUF_HOME=/usr/local"
;;
centos7|debian8|ubuntu14)
OPTS="-DSNAPPY_HOME=/usr/local"
;;
*)
OPTS=""
;;
esac
docker run "orc-$os" /bin/bash -c \
"$CLONE && $MAKEDIR && cmake $OPTS .. && make package test-out" \
> logs/$os-test.log 2>&1 || exit 1
done
echo "Start: $start"

echo "Build start: $start"
echo "Test start: $testStart"
echo "End:" `date`
26 changes: 25 additions & 1 deletion docker/ubuntu12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,41 @@
FROM ubuntu:12.04
MAINTAINER Owen O'Malley <owen@hortonworks.com>
RUN apt-get update
RUN apt-get install -y python-software-properties
RUN add-apt-repository -y ppa:openjdk-r/ppa
RUN apt-get update
RUN apt-get install -y \
autoconf \
cmake \
gcc \
g++ \
git \
libtool \
make \
maven \
openjdk-7-jdk
openjdk-8-jdk \
pkg-config \
tar \
wget
WORKDIR /root
# install a local build of protobuf
RUN wget "https://github.com/protocolbuffers/protobuf/archive/v2.5.0.tar.gz" \
-O protobuf.tgz
RUN tar xzf protobuf.tgz
RUN cd protobuf-2.5.0 && \
autoreconf -f -i -Wall,no-obsolete && \
./configure --enable-shared=no&& \
make install
# install a local build of snappy
RUN wget "https://github.com/google/snappy/archive/1.1.3.tar.gz" \
-O snappy.tgz
RUN tar xzf snappy.tgz
RUN cd snappy-1.1.3 && \
./autogen.sh && \
./configure && \
make install
CMD git clone https://github.com/apache/orc.git -b master && \
mkdir orc/build && \
Expand Down
Loading

0 comments on commit 55a0b76

Please sign in to comment.