diff --git a/.gitignore b/.gitignore index c60360878f..b8c4a39f8a 100644 --- a/.gitignore +++ b/.gitignore @@ -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__ diff --git a/build.sh b/build.sh index 66a0dbe0da..db6c53a7b5 100755 --- a/build.sh +++ b/build.sh @@ -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=\"\"] [-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=\"\"] [-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 @@ -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="" @@ -129,6 +131,7 @@ if hasArg clean; then rmdir "${bd}" || true fi done + rm -f ${REPODIR}/legate/legate_kvikio/install_info.py fi ################################################################################ @@ -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 diff --git a/legate/CMakeLists.txt b/legate/CMakeLists.txt index 83aef1e23c..519196848a 100644 --- a/legate/CMakeLists.txt +++ b/legate/CMakeLists.txt @@ -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 +# 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) diff --git a/legate/cpp/CMakeLists.txt b/legate/cpp/CMakeLists.txt index 595aefc369..37dc99ae55 100644 --- a/legate/cpp/CMakeLists.txt +++ b/legate/cpp/CMakeLists.txt @@ -12,8 +12,6 @@ # the License. # ============================================================================= -# legate_cpp_library_template(legate_kvikio TEMPLATE_SOURCES) - set(CMAKE_EXPORT_COMPILE_COMMANDS ON) find_package(CUDAToolkit REQUIRED)