Skip to content

Commit 95dd518

Browse files
committed
configurable dependency build thread count
1 parent 9697b0c commit 95dd518

File tree

6 files changed

+25
-20
lines changed

6 files changed

+25
-20
lines changed

CMakeLists.txt

+6-5
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,12 @@ pkg_search_module(PCRE REQUIRED libpcre)
225225
set(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}")
226226

227227
# Download and build all non-system dependencies
228-
set(DEP_DOWNLOAD_PREFIX "${CMAKE_SOURCE_DIR}/contrib/deps" CACHE PATH "Location of dependency sources")
229-
set(DEP_BUILD_PREFIX "${CMAKE_BINARY_DIR}/builds" CACHE PATH "Location of dependency builds")
230-
set(DEP_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/deps" CACHE PATH "Location of dependency binaries")
231-
set(CLIENT OFF CACHE BOOL "Whether or not to build and install client")
232-
set(DEP_OPTIONS "")
228+
set(DEP_DOWNLOAD_PREFIX "${CMAKE_SOURCE_DIR}/contrib/deps" CACHE PATH "Location of dependency sources")
229+
set(DEP_BUILD_PREFIX "${CMAKE_BINARY_DIR}/builds" CACHE PATH "Location of dependency builds")
230+
set(DEP_BUILD_THREADS "1" CACHE STRING "Number of build threads")
231+
set(DEP_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/deps" CACHE PATH "Location of dependency binaries")
232+
set(CLIENT OFF CACHE BOOL "Whether or not to build and install client")
233+
set(DEP_OPTIONS --threads "${DEP_BUILD_THREADS}")
233234
if (CMAKE_CXX_COMPILER)
234235
set(DEP_OPTIONS ${DEP_OPTIONS} --cxx)
235236
endif()

contrib/deps/googletest.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -e
88
googletest_name="googletest"
99
googletest_prefix="${INSTALL_DIR}/${googletest_name}"
1010
if [[ ! -d "${googletest_prefix}" ]]; then
11-
googletest_build="${BUILD_DIR}/googletest-master"
11+
googletest_build="${BUILD_DIR}/googletest-main"
1212
if [[ ! -d "${googletest_build}" ]]; then
1313
googletest_tarball="${DOWNLOAD_DIR}/googletest.tar.gz"
1414
if [[ ! -f "${googletest_tarball}" ]]; then
@@ -24,6 +24,6 @@ if [[ ! -d "${googletest_prefix}" ]]; then
2424
if [[ ! -f Makefile ]]; then
2525
$CMAKE .. -DCMAKE_INSTALL_PREFIX="${googletest_prefix}" -DBUILD_GMOCK=OFF
2626
fi
27-
make
27+
make -j "${THREADS}"
2828
make install
2929
fi

contrib/deps/install_deps.sh

+13-9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ else
1717
exit 1
1818
fi
1919

20+
THREADS="1"
2021
BUILD_CXX="false"
2122
PARAMIKO="false"
2223

@@ -28,19 +29,21 @@ do
2829
key="$1"
2930

3031
case $key in
32+
--threads)
33+
THREADS="$2"
34+
shift # past count
35+
;;
3136
--cxx)
32-
BUILD_CXX="true"
33-
shift # past argument
34-
;;
37+
BUILD_CXX="true"
38+
;;
3539
--paramiko)
36-
PARAMIKO="true"
37-
shift # past argument
38-
;;
40+
PARAMIKO="true"
41+
;;
3942
*) # unknown option
40-
POSITIONAL+=("$1") # save it in an array for later
41-
shift # past argument
42-
;;
43+
POSITIONAL+=("$1") # save it in an array for later
44+
;;
4345
esac
46+
shift # past flag
4447
done
4548
set -- "${POSITIONAL[@]}" # restore positional parameters
4649

@@ -65,6 +68,7 @@ export DOWNLOAD_DIR
6568
export BUILD_DIR
6669
export INSTALL_DIR
6770
export CMAKE
71+
export THREADS
6872

6973
echo "Installing SQLite3"
7074
. ${SCRIPT_PATH}/sqlite3.sh

contrib/deps/jemalloc.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ if [[ ! -d "${jemalloc_prefix}" ]]; then
2525
if [[ ! -f Makefile ]]; then
2626
../configure --prefix="${jemalloc_prefix}"
2727
fi
28-
make
28+
make -j "${THREADS}"
2929
make -i install
3030
fi

contrib/deps/sqlite3.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ if [[ ! -d "${sqlite3_prefix}" ]]; then
2525
if [[ ! -f Makefile ]]; then
2626
CFLAGS="-USQLITE_TEMP_STORE -DSQLITE_TEMP_STORE=3 -USQLITE_THREADSAFE -DSQLITE_THREADSAFE=0 -USQLITE_MAX_EXPR_DEPTH -DSQLITE_MAX_EXPR_DEPTH=0 -USQLITE_DEFAULT_MEMSTATUS -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DECLTYPE -USQLITE_ENABLE_DBSTAT_VTAB -USQLITE_ENABLE_RTREE -USQLITE_ENABLE_FTS4 -USQLITE_ENABLE_JSON1 -USQLITE_OMIT_PROGRESS_CALLBACK -USQLITE_MAX_ATTACHED -DSQLITE_MAX_ATTACHED=125 -O3" ../configure --prefix="${sqlite3_prefix}"
2727
fi
28-
make
28+
make -j "${THREADS}"
2929
make install
3030
fi

contrib/deps/sqlite3_pcre.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ if [[ ! -d "${pcre_prefix}" ]]; then
2626
cd build
2727
if [[ ! -f Makefile ]]; then
2828
export PKG_CONFIG_PATH="${INSTALL_DIR}/sqlite3/lib/pkgconfig:${PKG_CONFIG_PATH}"
29-
$CMAKE .. -DCMAKE_INSTALL_PREFIX="${pcre_prefix}"
29+
${CMAKE} .. -DCMAKE_INSTALL_PREFIX="${pcre_prefix}"
3030
fi
31-
make
31+
make -j "${THREADS}"
3232
make install
3333
fi

0 commit comments

Comments
 (0)