From b0fdebb0b324732b9f0a309f5defcadc3103fee4 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 2 Aug 2022 13:38:03 -0700 Subject: [PATCH] Various fixes for build.sh (#771) This PR includes the following fixes for build.sh: - The parallel argument is for the build tool (make/ninja) and not CMake or setup.py, so it needs to be passed after a second `--`. - pylibraft requires the distances component of libraft to be compiled. If pylibraft is passed to build.sh, we need to force building libraft with the distance component - build.sh doesn't install by default, so the `CMAKE_PREFIX_PATH` that the Python build points to needs to also include the build directory in addition to the install directory. I think giving the build directory precedence makes more sense, but that could be changed if necessary. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Thejaswi. N. S (https://github.com/teju85) URL: https://github.com/rapidsai/raft/pull/771 --- build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 8b00fa69dd..9eebdafe5c 100755 --- a/build.sh +++ b/build.sh @@ -182,7 +182,7 @@ if hasArg --compile-nn || hasArg --compile-libs || (( ${NUMARGS} == 0 )); then CMAKE_TARGET="${CMAKE_TARGET};raft_nn_lib" fi -if hasArg --compile-dist || hasArg --compile-libs || (( ${NUMARGS} == 0 )); then +if hasArg --compile-dist || hasArg --compile-libs || hasArg pylibraft || (( ${NUMARGS} == 0 )); then COMPILE_DIST_LIBRARY=ON CMAKE_TARGET="${CMAKE_TARGET};raft_distance_lib" fi @@ -250,7 +250,7 @@ fi ################################################################################ # Configure for building all C++ targets -if (( ${NUMARGS} == 0 )) || hasArg libraft || hasArg docs || hasArg tests || hasArg bench; then +if (( ${NUMARGS} == 0 )) || hasArg libraft || hasArg pylibraft || hasArg docs || hasArg tests || hasArg bench; then if (( ${BUILD_ALL_GPU_ARCH} == 0 )); then RAFT_CMAKE_CUDA_ARCHITECTURES="NATIVE" echo "Building for the architecture of the GPU in the system..." @@ -292,7 +292,7 @@ fi if (( ${NUMARGS} == 0 )) || hasArg pyraft || hasArg docs; then cd ${REPODIR}/python/raft - python setup.py build_ext -j${PARALLEL_LEVEL:-1} --inplace -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_LIBRARY_PATH=${LIBRAFT_BUILD_DIR} ${EXTRA_CMAKE_ARGS} + python setup.py build_ext --inplace -- -DCMAKE_PREFIX_PATH="${LIBRAFT_BUILD_DIR};${INSTALL_PREFIX}" -DCMAKE_LIBRARY_PATH=${LIBRAFT_BUILD_DIR} ${EXTRA_CMAKE_ARGS} -- -j${PARALLEL_LEVEL:-1} if [[ ${INSTALL_TARGET} != "" ]]; then python setup.py install --single-version-externally-managed --record=record.txt -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} ${EXTRA_CMAKE_ARGS} fi @@ -302,7 +302,7 @@ fi if (( ${NUMARGS} == 0 )) || hasArg pylibraft; then cd ${REPODIR}/python/pylibraft - python setup.py build_ext -j${PARALLEL_LEVEL:-1} --inplace -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_LIBRARY_PATH=${LIBRAFT_BUILD_DIR} ${EXTRA_CMAKE_ARGS} + python setup.py build_ext --inplace -- -DCMAKE_PREFIX_PATH="${LIBRAFT_BUILD_DIR};${INSTALL_PREFIX}" -DCMAKE_LIBRARY_PATH=${LIBRAFT_BUILD_DIR} ${EXTRA_CMAKE_ARGS} -- -j${PARALLEL_LEVEL:-1} if [[ ${INSTALL_TARGET} != "" ]]; then python setup.py install --single-version-externally-managed --record=record.txt -- -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} ${EXTRA_CMAKE_ARGS} fi