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

Implement build.sh #185

Merged
merged 3 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
*.*~
build
python/_skbuild
legate/_skbuild
legate/legate_kvikio/install_info.py
legate/record.txt
python/record.txt
*.so
dask-worker-space
__pycache__
Expand Down
18 changes: 15 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ ARGS=$*
# script, and that this script resides in the repo dir!
REPODIR=$(cd $(dirname $0); pwd)

VALIDARGS="clean libkvikio kvikio -v -g -n -s --ptds -h"
HELP="$0 [clean] [libkvikio] [kvikio] [-v] [-g] [-n] [-s] [--ptds] [--cmake-args=\"<args>\"] [-h]
VALIDARGS="clean libkvikio kvikio legate -v -g -n -s --ptds -h"
HELP="$0 [clean] [libkvikio] [kvikio] [legate] [-v] [-g] [-n] [-s] [--ptds] [--cmake-args=\"<args>\"] [-h]
clean - remove all existing build artifacts and configuration (start over)
libkvikio - build and install the libkvikio C++ code
kvikio - build and install the kvikio Python package
legate - build and install the legate-kvikio Python package
-v - verbose build mode
-g - build for debug
-n - no install step
Expand All @@ -32,7 +33,8 @@ HELP="$0 [clean] [libkvikio] [kvikio] [-v] [-g] [-n] [-s] [--ptds] [--cmake-args
"
LIBKVIKIO_BUILD_DIR=${LIBKVIKIO_BUILD_DIR:=${REPODIR}/cpp/build}
KVIKIO_BUILD_DIR="${REPODIR}/python/build ${REPODIR}/python/_skbuild"
BUILD_DIRS="${LIBKVIKIO_BUILD_DIR} ${KVIKIO_BUILD_DIR}"
LEGATE_BUILD_DIR="${REPODIR}/legate/build ${REPODIR}/legate/_skbuild"
BUILD_DIRS="${LIBKVIKIO_BUILD_DIR} ${KVIKIO_BUILD_DIR} ${LEGATE_BUILD_DIR}"

# Set defaults for vars modified by flags to this script
VERBOSE_FLAG=""
Expand Down Expand Up @@ -129,6 +131,7 @@ if hasArg clean; then
rmdir "${bd}" || true
fi
done
rm -f ${REPODIR}/legate/legate_kvikio/install_info.py
fi

################################################################################
Expand All @@ -151,3 +154,12 @@ if (( NUMARGS == 0 )) || hasArg kvikio; then
python setup.py build_ext --inplace
python setup.py install --single-version-externally-managed --record=record.txt
fi


# Build and install the legate-kvikio Python package
if hasArg legate; then
cd "${REPODIR}/legate"
export INSTALL_PREFIX
echo "building legate..."
python setup.py install --single-version-externally-managed --record=record.txt
fi
7 changes: 4 additions & 3 deletions legate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ endif()
set(BUILD_SHARED_LIBS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Look for an existing C++ editable build Not required. We will build it if not found.
find_package(legate_kvikio QUIET)
# We always want to build our bindings, so we trick the legate wrappers to never search for an
# installed version which is currently deduced by seeing if it is invoked via scikit-build See
# <https://github.com/nv-legate/legate.core/pull/645>
find_package(legate_core REQUIRED)

set(SKBUILD OFF)
legate_add_cpp_subdirectory(cpp TARGET legate_kvikio EXPORT legate_kvikio-export)
legate_default_python_install(legate_kvikio EXPORT legate_kvikio-export)

Expand Down
2 changes: 0 additions & 2 deletions legate/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# the License.
# =============================================================================

# legate_cpp_library_template(legate_kvikio TEMPLATE_SOURCES)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

find_package(CUDAToolkit REQUIRED)
Expand Down