Skip to content

Commit

Permalink
Various fixes for build.sh (#771)
Browse files Browse the repository at this point in the history
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: #771
  • Loading branch information
vyasr authored Aug 2, 2022
1 parent cb471de commit b0fdebb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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..."
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b0fdebb

Please sign in to comment.