You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2023/01/11 04:51:19 UTC

[GitHub] [doris] adonis0147 commented on a diff in pull request #15807: [Update](deps) add clucene deps for doris inverted index

adonis0147 commented on code in PR #15807:
URL: https://github.com/apache/doris/pull/15807#discussion_r1066568186


##########
thirdparty/build-thirdparty.sh:
##########
@@ -1545,12 +1545,43 @@ build_concurrentqueue() {
     cp ./*.h "${TP_INSTALL_DIR}/include/"
 }
 
+#clucene
+build_clucene() {
+    if [[ -z ${USE_AVX2} ]]; then
+        USE_AVX2=1
+    fi
+    if [[ -z ${BUILD_TYPE} ]]; then
+        BUILD_TYPE=Release
+    fi

Review Comment:
   This block can be omitted. Just pass `-DCMAKE_BUILD_TYPE=RelWithDebInfo` to CMake.



##########
thirdparty/build-thirdparty.sh:
##########
@@ -1545,12 +1545,43 @@ build_concurrentqueue() {
     cp ./*.h "${TP_INSTALL_DIR}/include/"
 }
 
+#clucene
+build_clucene() {
+    if [[ -z ${USE_AVX2} ]]; then
+        USE_AVX2=1
+    fi
+    if [[ -z ${BUILD_TYPE} ]]; then
+        BUILD_TYPE=Release
+    fi
+    check_if_source_exist "${CLUCENE_SOURCE}"
+    cd "${TP_SOURCE_DIR}/${CLUCENE_SOURCE}"
+    mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}"
+    rm -rf CMakeCache.txt CMakeFiles/
+
+    if [[ "${CC}" == *gcc ]]; then
+        CPPFLAGS="-fno-omit-frame-pointer -g -Wno-narrowing" \
+            CXXFLAGS="-fno-omit-frame-pointer -g -Wno-narrowing" \
+            ${CMAKE_CMD} -G "${GENERATOR}" -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" -DBUILD_STATIC_LIBRARIES=ON \
+            -DUSE_AVX2="${USE_AVX2}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DBUILD_CONTRIBS_LIB=ON ..
+        ${BUILD_SYSTEM} -j "${PARALLEL}" && ${BUILD_SYSTEM} install
+    elif [[ "${CC}" == *clang ]]; then
+        CPPFLAGS="-fno-omit-frame-pointer -g -Wno-c++11-narrowing" \
+            CXXFLAGS="-fno-omit-frame-pointer -g -Wno-c++11-narrowing" \
+            ${CMAKE_CMD} -G "${GENERATOR}" -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" -DBUILD_STATIC_LIBRARIES=ON \
+            -DUSE_AVX2="${USE_AVX2}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DBUILD_CONTRIBS_LIB=ON ..

Review Comment:
   Looks verbose. The following common part can be separated like
   
   ```shell
   ${CMAKE_CMD} -G "${GENERATOR}" -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" -DBUILD_STATIC_LIBRARIES=ON \
               -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer ${warning_narrowing}"
               -DUSE_AVX2="${USE_AVX2}" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DBUILD_CONTRIBS_LIB=ON ..
   ${BUILD_SYSTEM} -j "${PARALLEL}"
   ${BUILD_SYSTEM} install
   ```



##########
thirdparty/build-thirdparty.sh:
##########
@@ -1545,12 +1545,43 @@ build_concurrentqueue() {
     cp ./*.h "${TP_INSTALL_DIR}/include/"
 }
 
+#clucene
+build_clucene() {
+    if [[ -z ${USE_AVX2} ]]; then
+        USE_AVX2=1
+    fi
+    if [[ -z ${BUILD_TYPE} ]]; then
+        BUILD_TYPE=Release
+    fi
+    check_if_source_exist "${CLUCENE_SOURCE}"
+    cd "${TP_SOURCE_DIR}/${CLUCENE_SOURCE}"
+    mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}"
+    rm -rf CMakeCache.txt CMakeFiles/
+
+    if [[ "${CC}" == *gcc ]]; then
+        CPPFLAGS="-fno-omit-frame-pointer -g -Wno-narrowing" \
+            CXXFLAGS="-fno-omit-frame-pointer -g -Wno-narrowing" \

Review Comment:
   It is better to use a variable like `warning_narrowing`. See [L144](https://github.com/apache/doris/blob/master/thirdparty/build-thirdparty.sh#L144)



##########
thirdparty/build-thirdparty.sh:
##########
@@ -1545,12 +1545,43 @@ build_concurrentqueue() {
     cp ./*.h "${TP_INSTALL_DIR}/include/"
 }
 
+#clucene
+build_clucene() {
+    if [[ -z ${USE_AVX2} ]]; then
+        USE_AVX2=1
+    fi
+    if [[ -z ${BUILD_TYPE} ]]; then
+        BUILD_TYPE=Release
+    fi
+    check_if_source_exist "${CLUCENE_SOURCE}"
+    cd "${TP_SOURCE_DIR}/${CLUCENE_SOURCE}"
+    mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}"
+    rm -rf CMakeCache.txt CMakeFiles/
+
+    if [[ "${CC}" == *gcc ]]; then
+        CPPFLAGS="-fno-omit-frame-pointer -g -Wno-narrowing" \
+            CXXFLAGS="-fno-omit-frame-pointer -g -Wno-narrowing" \

Review Comment:
   Using `CXX_FLAGS` is enough.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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