Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 'j' option to use multiple cpus to build JNI library. #2244

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ function usage() {
echo -e "-p PLATFORM\t[Optional] Platform, ignored."
echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored."
echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'."
echo -e "-j NPROC_COUNT\t[Optional] Number of CPUs to use when building JNI library. Default is 1."
echo -e "-h help"
}

while getopts ":h:v:q:s:o:p:a:" arg; do
while getopts ":h:v:q:s:o:p:a:j:" arg; do
case $arg in
h)
usage
Expand All @@ -45,6 +46,9 @@ while getopts ":h:v:q:s:o:p:a:" arg; do
a)
ARCHITECTURE=$OPTARG
;;
j)
NPROC_COUNT=$OPTARG
;;
:)
echo "Error: -${OPTARG} requires an argument"
usage
Expand Down Expand Up @@ -118,7 +122,7 @@ fi
# Build k-NN lib and plugin through gradle tasks
cd $work_dir
./gradlew build --no-daemon --refresh-dependencies -x integTest -x test -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER -Dbuild.lib.commit_patches=false
./gradlew :buildJniLib -Davx512.enabled=false -Davx2.enabled=false -Dbuild.lib.commit_patches=false
./gradlew :buildJniLib -Davx512.enabled=false -Davx2.enabled=false -Dbuild.lib.commit_patches=false -Dnproc.count=${NPROC_COUNT:-1}

if [ "$PLATFORM" != "windows" ] && [ "$ARCHITECTURE" = "x64" ]; then
echo "Building k-NN library after enabling AVX2"
Expand Down
Loading