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/14 06:10:48 UTC

[GitHub] imay closed pull request #305: Improve build script

imay closed pull request #305: Improve build script
URL: https://github.com/apache/incubator-doris/pull/305
 
 
   

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/be/CMakeLists.txt b/be/CMakeLists.txt
index d6568b57..cef37678 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -23,7 +23,7 @@ if (DEFINED ENV{DORIS_GCC_HOME})
     set(CMAKE_CXX_COMPILER "$ENV{DORIS_GCC_HOME}/bin/g++")
     set(GCC_HOME $ENV{DORIS_GCC_HOME})
 else()
-    set(GCC_HOME "/usr")
+    message(FATAL_ERROR "DORIS_GCC_HOME environment variable is not set")
 endif()
 
 project(doris CXX C)
diff --git a/env.sh b/env.sh
index 7be356c1..9d424cff 100755
--- a/env.sh
+++ b/env.sh
@@ -27,15 +27,26 @@ if [[ -f ${DORIS_HOME}/custom_env.sh ]]; then
     source ${DORIS_HOME}/custom_env.sh
 fi
 
+# set DORIS_THIRDPARTY
+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
+if [[ -z ${JAVA_HOME} ]]; then
     echo "Error: JAVA_HOME is not set, use thirdparty/installed/jdk1.8.0_131"
-    export JAVA_HOME=${DORIS_HOME}/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
+if [[ $JAVA_VER -lt 18 ]]; then
     echo "Error: require JAVA with JDK version at least 1.8"
     exit 1
 fi
@@ -53,12 +64,19 @@ if ! ${PYTHON} --version; then
     export PYTHON=python2.7
     if ! ${PYTHON} --version; then
         echo "Error: python is not found"
-        exit
+        exit 1
     fi
 fi
 
-# set DORIS_THIRDPARTY
-if [ -z ${DORIS_THIRDPARTY} ]; then
-    export DORIS_THIRDPARTY=${DORIS_HOME}/thirdparty
+# set GCC HOME
+if [[ -z ${DORIS_GCC_HOME} ]]; then
+    export DORIS_GCC_HOME=$(dirname `which gcc`)/..
+fi
+
+gcc_ver=`${DORIS_GCC_HOME}/bin/gcc -dumpversion`
+required_ver="5.3.1"
+if [[ ! "$(printf '%s\n' "$required_ver" "$gcc_ver" | sort -V | head -n1)" = "$required_ver" ]]; then 
+    echo "Error: GCC version (${gcc_ver}) must be greater than or equal to ${required_ver}"
+    exit 1
 fi
 


 

----------------------------------------------------------------
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