You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2018/11/22 03:15:44 UTC

[GitHub] imay closed pull request #338: Fix compile issue of thirdparty library

imay closed pull request #338: Fix compile issue of thirdparty library
URL: https://github.com/apache/incubator-doris/pull/338
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/build.sh b/build.sh
index da44d1bb..1c1a168b 100755
--- a/build.sh
+++ b/build.sh
@@ -35,6 +35,18 @@ export DORIS_HOME=${ROOT}
 
 . ${DORIS_HOME}/env.sh
 
+# build thirdparty libraries if necessary
+if [[ ! -f ${DORIS_THIRDPARTY}/installed/lib/librdkafka.a ]]; then
+    echo "Thirdparty libraries need to be build ..."
+    ${DORIS_THIRDPARTY}/build-thirdparty.sh
+fi
+
+# check java home
+if [[ -z ${JAVA_HOME} ]]; then
+    echo "Warning: JAVA_HOME is not set, use thirdparty/installed/jdk1.8.0_131"
+    export JAVA_HOME=${DORIS_THIRDPARTY}/installed/jdk1.8.0_131
+fi
+
 PARALLEL=$[$(nproc)/4+1]
 
 # Check args
diff --git a/env.sh b/env.sh
index 6c817685..060a1071 100755
--- a/env.sh
+++ b/env.sh
@@ -1,4 +1,3 @@
-#!/usr/bin/env 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
@@ -32,23 +31,14 @@ if [[ -z ${DORIS_THIRDPARTY} ]]; then
     export DORIS_THIRDPARTY=${DORIS_HOME}/thirdparty
 fi
 
-# build thirdparty libraries if necessary
-if [[ ! -d ${DORIS_THIRDPARTY}/installed ]]; then
-    echo "Thirdparty libraries need to be build ..."
-    ${DORIS_THIRDPARTY}/build-thirdparty.sh
-fi
-
 # check java version
-if [[ -z ${JAVA_HOME} ]]; then
-    echo "Error: JAVA_HOME is not set, use thirdparty/installed/jdk1.8.0_131"
-    export JAVA_HOME=${DORIS_THIRDPARTY}/installed/jdk1.8.0_131
-fi
-
-export JAVA=${JAVA_HOME}/bin/java
-JAVA_VER=$(${JAVA} -version 2>&1 | sed 's/.* version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q' | cut -f1 -d " ")
-if [[ $JAVA_VER -lt 18 ]]; then
-    echo "Error: require JAVA with JDK version at least 1.8"
-    exit 1
+if [[ ! -z ${JAVA_HOME} ]]; then
+    export JAVA=${JAVA_HOME}/bin/java
+    JAVA_VER=$(${JAVA} -version 2>&1 | sed 's/.* version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q' | cut -f1 -d " ")
+    if [[ $JAVA_VER -lt 18 ]]; then
+        echo "Error: require JAVA with JDK version at least 1.8"
+        return 1
+    fi
 fi
 
 # check maven
diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index ce56e5ac..ba09b5e5 100755
--- a/thirdparty/build-thirdparty.sh
+++ b/thirdparty/build-thirdparty.sh
@@ -35,8 +35,8 @@ export DORIS_HOME=$curdir/..
 export TP_DIR=$curdir
 
 # include custom environment variables
-if [[ -f ${DORIS_HOME}/custom_env.sh ]]; then
-    . ${DORIS_HOME}/custom_env.sh
+if [[ -f ${DORIS_HOME}/env.sh ]]; then
+    . ${DORIS_HOME}/env.sh
 fi
 
 if [[ ! -f ${TP_DIR}/download-thirdparty.sh ]]; then
@@ -57,17 +57,19 @@ ${TP_DIR}/download-thirdparty.sh
 
 export LD_LIBRARY_PATH=$TP_DIR/installed/lib:$LD_LIBRARY_PATH
 
-if [ -f ${DORIS_TOOLCHAIN}/gcc730/bin/gcc ]; then
-    GCC_HOME=${DORIS_TOOLCHAIN}/gcc730
-    export CC=${GCC_HOME}/bin/gcc
-    export CPP=${GCC_HOME}/bin/cpp
-    export CXX=${GCC_HOME}/bin/g++
+# set COMPILER
+if [[ -z ${DORIS_GCC_HOME} ]]; then
+    export CC=${DORIS_GCC_HOME}/bin/gcc
+    export CPP=${DORIS_GCC_HOME}/bin/cpp
+    export CXX=${DORIS_GCC_HOME}/bin/g++
 else
-    export CC=gcc
-    export CPP=cpp
-    export CXX=g++
+    echo "DORIS_GCC_HOME environment variable is not set"
+    exit 1
 fi
 
+# prepare installed prefix
+mkdir -p ${TP_DIR}/installed
+
 check_prerequest() {
     local CMD=$1
     local NAME=$2
@@ -119,7 +121,6 @@ check_prerequest "libtoolize --version" "libtool"
 #########################
 # build all thirdparties
 #########################
-GCC_VERSION="$($CC -dumpversion)"
 
 CMAKE_CMD=`which cmake`
 
diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh
index 772dfb48..8a8e436a 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -47,7 +47,6 @@ fi
 . ${TP_DIR}/vars.sh
 
 mkdir -p ${TP_DIR}/src
-mkdir -p ${TP_DIR}/installed
 
 download() {
     local FILENAME=$1


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org