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 uninstall target which uninstalls libcugraph and cugraph from a prior build/install step #1601

Merged
merged 2 commits into from
May 13, 2021
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
39 changes: 32 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ ARGS=$*
REPODIR=$(cd $(dirname $0); pwd)
LIBCUGRAPH_BUILD_DIR=${LIBCUGRAPH_BUILD_DIR:=${REPODIR}/cpp/build}

VALIDARGS="clean libcugraph cugraph docs -v -g -n --allgpuarch --buildfaiss --show_depr_warn -h --help"
VALIDARGS="clean uninstall libcugraph cugraph docs -v -g -n --allgpuarch --buildfaiss --show_depr_warn -h --help"
HELP="$0 [<target> ...] [<flag> ...]
where <target> is:
clean - remove all existing build artifacts and configuration (start over)
uninstall - uninstall libcugraph and cugraph from a prior build/install (see also -n)
libcugraph - build the cugraph C++ code
cugraph - build the cugraph Python package
cpp-mgtests - build libcugraph mnmg tests. Builds MPI communicator, adding MPI as a dependency.
docs - build the docs
and <flag> is:
-v - verbose build mode
-g - build for debug
-n - no install step
-n - do not install after a successful build
--allgpuarch - build for all supported GPU architectures
--buildfaiss - build faiss statically into cugraph
--show_depr_warn - show cmake deprecation warnings
Expand Down Expand Up @@ -107,12 +108,36 @@ if hasArg cpp-mgtests; then
BUILD_CPP_MG_TESTS=ON
fi

# If clean given, run it prior to any other steps
# If clean or uninstall given, run them prior to any other steps
if hasArg uninstall; then
# uninstall libcugraph
if [[ "$INSTALL_PREFIX" != "" ]]; then
rm -rf ${INSTALL_PREFIX}/include/cugraph
rm -f ${INSTALL_PREFIX}/lib/libcugraph.so
fi
# This may be redundant given the above, but can also be used in case
# there are other installed files outside of the locations above.
if [ -e ${LIBCUGRAPH_BUILD_DIR}/install_manifest.txt ]; then
xargs rm -f < ${LIBCUGRAPH_BUILD_DIR}/install_manifest.txt > /dev/null 2>&1
fi
# uninstall cugraph installed from a prior "setup.py install"
pip uninstall -y cugraph
fi

if hasArg clean; then
# FIXME: ideally the "setup.py clean" command below would also be run to
# remove all the "inplace" python build artifacts, but currently, running
# any setup.py command has side effects (eg. cloning repos).
#(cd ${REPODIR}/python && python setup.py clean)
# remove artifacts generated inplace
# FIXME: ideally the "setup.py clean" command would be used for this, but
# currently running any setup.py command has side effects (eg. cloning
# repos).
# (cd ${REPODIR}/python && python setup.py clean)
if [[ -d ${REPODIR}/python ]]; then
pushd ${REPODIR}/python > /dev/null
rm -rf dist dask-worker-space cugraph/raft *.egg-info
find . -name "__pycache__" -type d -exec rm -rf {} \; > /dev/null 2>&1
find . -name "*.cpp" -type f -delete
find . -name "*.cpython*.so" -type f -delete
popd > /dev/null
fi

# If the dirs to clean are mounted dirs in a container, the contents should
# be removed but the mounted dirs will remain. The find removes all
Expand Down