Commit 3300bed 1 parent 5e238f4 commit 3300bed Copy full SHA for 3300bed
File tree 5 files changed +11
-4
lines changed
5 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,12 @@ subsequent Velox builds can use the installed packages.
131
131
* You can reuse ` DEPENDENCY_INSTALL ` and ` INSTALL_PREFIX ` for Velox clients such as Prestissimo
132
132
by specifying a common shared directory.`*
133
133
134
+ The build parallelism for dependencies can be controlled by the ` BUILD_THREADS ` environment
135
+ variable and overrides the default number of parallel processes used for compiling and linking.
136
+ The default value is the number of cores on your machine.
137
+ This is useful if your machine has lots of cores but no matching memory to process all
138
+ compile and link processes in parallel resulting in OOM kills by the kernel.
139
+
134
140
### Setting up on macOS
135
141
136
142
On a macOS machine (either Intel or Apple silicon) you can setup and then build like so:
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ set -efx -o pipefail
30
30
# so that some low level types are the same size. Also, disable warnings.
31
31
SCRIPTDIR=$( dirname " ${BASH_SOURCE[0]} " )
32
32
source $SCRIPTDIR /setup-helper-functions.sh
33
- NPROC=$( getconf _NPROCESSORS_ONLN)
33
+ NPROC=${BUILD_THREADS :- $ (getconf _NPROCESSORS_ONLN)}
34
34
export CXXFLAGS=$( get_cxx_flags) # Used by boost.
35
35
export CFLAGS=${CXXFLAGS// " -std=c++17" / } # Used by LZO.
36
36
CMAKE_BUILD_TYPE=" ${BUILD_TYPE:- Release} "
Original file line number Diff line number Diff line change 18
18
19
19
DEPENDENCY_DIR=${DEPENDENCY_DIR:- $(pwd)/ deps-download}
20
20
OS_CXXFLAGS=" "
21
+ NPROC=${BUILD_THREADS:- $(getconf _NPROCESSORS_ONLN)}
21
22
22
23
function run_and_time {
23
24
time " $@ " || (echo " Failed to run $* ." ; exit 1 )
@@ -214,7 +215,7 @@ function cmake_install {
214
215
-DBUILD_TESTING=OFF \
215
216
" $@ "
216
217
# Exit if the build fails.
217
- cmake --build " ${BINARY_DIR} " || { echo ' build failed' ; exit 1; }
218
+ cmake --build " ${BINARY_DIR} " " -j ${NPROC} " || { echo ' build failed' ; exit 1; }
218
219
${SUDO} cmake --install " ${BINARY_DIR} "
219
220
}
220
221
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ PYTHON_VENV=${PYTHON_VENV:-"${SCRIPTDIR}/../.venv"}
36
36
# by tagging the brew packages to be system packages.
37
37
# This is used during package builds.
38
38
export OS_CXXFLAGS=" -isystem $( brew --prefix) /include "
39
- NPROC=$( getconf _NPROCESSORS_ONLN)
39
+ NPROC=${BUILD_THREADS :- $ (getconf _NPROCESSORS_ONLN)}
40
40
41
41
BUILD_DUCKDB=" ${BUILD_DUCKDB:- true} "
42
42
VELOX_BUILD_SHARED=${VELOX_BUILD_SHARED:- " OFF" } # Build folly shared for use in libvelox.so.
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ source $SCRIPTDIR/setup-helper-functions.sh
34
34
# are the same size.
35
35
COMPILER_FLAGS=$( get_cxx_flags)
36
36
export COMPILER_FLAGS
37
- NPROC=$( getconf _NPROCESSORS_ONLN)
37
+ NPROC=${BUILD_THREADS :- $ (getconf _NPROCESSORS_ONLN)}
38
38
BUILD_DUCKDB=" ${BUILD_DUCKDB:- true} "
39
39
export CMAKE_BUILD_TYPE=Release
40
40
VELOX_BUILD_SHARED=${VELOX_BUILD_SHARED:- " OFF" } # Build folly shared for use in libvelox.so.
You can’t perform that action at this time.
0 commit comments