@@ -26,6 +26,9 @@ VALIDARGS="
2626 uninstall
2727 cugraph-pyg
2828 cugraph-dgl
29+ pylibwholegraph
30+ libwholegraph
31+ tests
2932 docs
3033 all
3134 -v
@@ -44,6 +47,9 @@ HELP="$0 [<target> ...] [<flag> ...]
4447 uninstall - uninstall libcugraph and cugraph from a prior build/install (see also -n)
4548 cugraph-pyg - build the cugraph-pyg Python package
4649 cugraph-dgl - build the cugraph-dgl extensions for DGL
50+ pylibwholegraph - build the pylibwholegraph Python package
51+ libwholegraph - build the libwholegraph library
52+ tests - build the C++ tests
4753 docs - build the docs
4854 all - build everything
4955 and <flag> is:
@@ -55,23 +61,27 @@ HELP="$0 [<target> ...] [<flag> ...]
5561 --clean - clean an individual target (note: to do a complete rebuild, use the clean target described above)
5662 -h - print this text
5763
58- default action (no args) is to build and install 'cugraph-pyg ' then 'cugraph-dgl ' then 'wholegraph' targets
64+ default action (no args) is to build and install 'libwholegraph ' then 'pylibwholegraph' then ' cugraph-pyg ' then 'cugraph-dgl'
5965
6066"
6167
6268CUGRAPH_PYG_BUILD_DIR=${REPODIR} /python/cugraph-pyg/build
6369CUGRAPH_DGL_BUILD_DIR=${REPODIR} /python/cugraph-dgl/build
70+ PYLIBWHOLEGRAPH_BUILD_DIR=${REPODIR} /python/pylibwholegraph/build
71+ LIBWHOLEGRAPH_BUILD_DIR=${REPODIR} /cpp/build
6472
6573BUILD_DIRS=" ${CUGRAPH_PYG_BUILD_DIR}
6674 ${CUGRAPH_DGL_BUILD_DIR}
75+ ${PYLIBWHOLEGRAPH_BUILD_DIR}
76+ ${LIBWHOLEGRAPH_BUILD_DIR}
6777"
6878
6979# Set defaults for vars modified by flags to this script
7080VERBOSE_FLAG=" "
7181BUILD_TYPE=Release
7282INSTALL_TARGET=" --target install"
7383BUILD_ALL_GPU_ARCH=0
74- PYTHON_ARGS_FOR_INSTALL=" -m pip install --no-build-isolation --no-deps"
84+ PYTHON_ARGS_FOR_INSTALL=" -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true "
7585
7686# Set defaults for vars that may not have been defined externally
7787# FIXME: if PREFIX is not set, check CONDA_PREFIX, but there is no fallback
@@ -132,13 +142,30 @@ if hasArg --pydevelop; then
132142 PYTHON_ARGS_FOR_INSTALL=" ${PYTHON_ARGS_FOR_INSTALL} -e"
133143fi
134144
145+ if hasArg tests; then
146+ BUILD_TESTS=ON
147+ else
148+ BUILD_TESTS=OFF
149+ fi
150+
135151# If clean or uninstall targets given, run them prior to any other steps
136152if hasArg uninstall; then
137- # uninstall cugraph and pylibcugraph installed from a prior install
153+ if [[ " $INSTALL_PREFIX " != " " ]]; then
154+ rm -rf ${INSTALL_PREFIX} /include/wholememory
155+ rm -f ${INSTALL_PREFIX} /lib/libwholegraph.so
156+ rm -rf ${INSTALL_PREFIX} /lib/cmake/wholegraph
157+ fi
158+ # This may be redundant given the above, but can also be used in case
159+ # there are other installed files outside of the locations above.
160+ if [ -e ${LIBWHOLEGRAPH_BUILD_DIR} /install_manifest.txt ]; then
161+ xargs rm -f < ${LIBWHOLEGRAPH_BUILD_DIR} /install_manifest.txt > /dev/null 2>&1
162+ fi
163+
164+ # uninstall cugraph-dgl/cugraph-pyg/wholegraph installed from a prior install
138165 # FIXME: if multiple versions of these packages are installed, this only
139166 # removes the latest one and leaves the others installed. build.sh uninstall
140167 # can be run multiple times to remove all of them, but that is not obvious.
141- pip uninstall -y cugraph-dgl cugraph-pyg
168+ pip uninstall -y cugraph-dgl cugraph-pyg pylibwholegraph libwholegraph
142169fi
143170
144171if hasArg clean; then
@@ -164,6 +191,58 @@ if hasArg clean; then
164191fi
165192
166193# ###############################################################################
194+ # Build and install the libwholegraph library
195+ if hasArg libwholegraph || buildDefault || hasArg all ; then
196+
197+ # set values based on flags
198+ if (( ${BUILD_ALL_GPU_ARCH} == 0 )) ; then
199+ WHOLEGRAPH_CMAKE_CUDA_ARCHITECTURES=" ${WHOLEGRAPH_CMAKE_CUDA_ARCHITECTURES:= NATIVE} "
200+ echo " Building for the architecture of the GPU in the system..."
201+ else
202+ WHOLEGRAPH_CMAKE_CUDA_ARCHITECTURES=" 70-real;75-real;80-real;86-real;90"
203+ echo " Building for *ALL* supported GPU architectures..."
204+ fi
205+
206+ cmake -S ${REPODIR} /cpp -B ${LIBWHOLEGRAPH_BUILD_DIR} \
207+ -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
208+ -DCMAKE_CUDA_ARCHITECTURES=${WHOLEGRAPH_CMAKE_CUDA_ARCHITECTURES} \
209+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
210+ -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} \
211+ -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE \
212+ -DBUILD_TESTS=${BUILD_TESTS} \
213+ -DBUILD_WITH_NVSHMEM=${BUILD_WITH_NVSHMEM}
214+
215+ cd ${LIBWHOLEGRAPH_BUILD_DIR}
216+
217+ if ! hasArg --compile-cmd; then
218+ # # Build and (optionally) install library + tests
219+ cmake --build . -j${PARALLEL_LEVEL} ${INSTALL_TARGET} ${VERBOSE_FLAG}
220+ fi
221+ fi
222+
223+ # Build and install the pylibwholegraph Python package
224+ if hasArg pylibwholegraph || buildDefault || hasArg all; then
225+ if hasArg --clean; then
226+ cleanPythonDir ${REPODIR} /python/pylibwholegraph
227+ fi
228+
229+ # setup.py and cmake reference an env var LIBWHOLEGRAPH_DIR to find the
230+ # libwholegraph package (cmake).
231+ # If not set by the user, set it to LIBWHOLEGRAPH_BUILD_DIR
232+ LIBWHOLEGRAPH_DIR=${LIBWHOLEGRAPH_DIR:= ${LIBWHOLEGRAPH_BUILD_DIR} }
233+ if ! hasArg --compile-cmd; then
234+ cd ${REPODIR} /python/pylibwholegraph
235+ env LIBWHOLEGRAPH_DIR=${LIBWHOLEGRAPH_DIR} \
236+ SKBUILD_CMAKE_ARGS=" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} " python ${PYTHON_ARGS_FOR_INSTALL} \
237+ .
238+ else
239+ # just invoke cmake without going through scikit-build-core
240+ env LIBWHOLEGRAPH_DIR=${LIBWHOLEGRAPH_DIR} \
241+ cmake -S ${REPODIR} /python/pylibwholegraph -B ${REPODIR} /python/pylibwholegraph/build \
242+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
243+ fi
244+ fi
245+
167246# Build and install the cugraph-pyg Python package
168247if hasArg cugraph-pyg || buildDefault || hasArg all; then
169248 if hasArg --clean; then
0 commit comments