baibaichen commented on code in PR #11595:
URL: 
https://github.com/apache/incubator-gluten/pull/11595#discussion_r2850986909


##########
dev/inc-build-cpp.sh:
##########
@@ -0,0 +1,196 @@
+#!/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 regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Incremental C++ build for Gluten + Velox (no source reset, no Maven, no OS 
setup)
+# Usage: ./dev/inc-build-cpp.sh [--build_type=Debug|Release] [--update_vcpkg]
+
+set -eu
+
+CURRENT_DIR=$(cd "$(dirname "$BASH_SOURCE")"; pwd)
+GLUTEN_DIR="$CURRENT_DIR/.."
+
+# Helper functions
+num_threads() {
+  [[ -n "${NUM_THREADS:-}" ]] && echo "$NUM_THREADS" && return
+  if [[ "$(uname)" == "Darwin" ]]; then
+    local cores=$(sysctl -n hw.physicalcpu)
+    echo $(( cores > 2 ? cores - 2 : cores ))
+  else
+    echo $(nproc --ignore=2)
+  fi
+}
+
+platform() {
+  [[ "$(uname -s)" == "Linux" ]] && echo "linux" || echo "darwin"
+}
+
+arch() {
+  case "$(uname -m)" in
+    x86_64|amd64) echo "amd64" ;;
+    *) echo "aarch64" ;;
+  esac
+}
+
+step() { echo -e "\n[Step $1/4] $2..."; }
+
+extract_opt() {
+  grep "^$1:" "$GLUTEN_BUILD_DIR/CMakeCache.txt" 2>/dev/null | \
+    cut -d= -f2 || echo "${2:-ON}"
+}
+
+# Defaults
+VELOX_HOME="$GLUTEN_DIR/ep/build-velox/build/velox_ep"
+UPDATE_VCPKG=OFF
+NUM_THREADS=${NUM_THREADS:-$(num_threads)}
+
+# Parse arguments
+for arg in "$@"; do
+    case $arg in
+        --build_type=*)    BUILD_TYPE="${arg#*=}" ;;
+        --scala_version=*) SCALA_VERSION="${arg#*=}" ;;

Review Comment:
   `scala_version` is not for C++ compilation. It is used to determine the 
target directory when copying native libraries, since the output path differs 
between Scala 2.12 and 2.13. We assume 2.12 and 2.13 outputs are mutually 
exclusive, and a full build has already been done, so we can auto-detect it by 
checking whether scala-2.12 or scala-2.13 exists under the target directory.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to