Skip to content

Commit

Permalink
Merge pull request #626 from bdice/branch-25.04-merge-25.02
Browse files Browse the repository at this point in the history
Forward-merge branch-25.02 into branch-25.04
  • Loading branch information
raydouglass authored Feb 10, 2025
2 parents 5a825df + 31f4af8 commit c38038e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.
# Copyright (c) 2024-2025, NVIDIA CORPORATION.

set -euo pipefail

Expand All @@ -16,7 +16,7 @@ cd "${package_dir}"
sccache --zero-stats

rapids-logger "Building '${package_name}' wheel"
python -m pip wheel \
rapids-pip-retry wheel \
-w dist \
-v \
--no-deps \
Expand Down
2 changes: 1 addition & 1 deletion ci/build_wheel_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rapids-dependency-file-generator \
| tee /tmp/requirements-build.txt

rapids-logger "Installing build requirements"
python -m pip install \
rapids-pip-retry install \
-v \
--prefer-binary \
-r /tmp/requirements-build.txt
Expand Down
2 changes: 1 addition & 1 deletion ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
RAPIDS_PY_WHEEL_NAME="libkvikio_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp ./dist
RAPIDS_PY_WHEEL_NAME="kvikio_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist

python -m pip install -v \
rapids-pip-retry install -v \
"$(echo ./dist/libkvikio_"${RAPIDS_PY_CUDA_SUFFIX}"*.whl)" \
"$(echo ./dist/kvikio_"${RAPIDS_PY_CUDA_SUFFIX}"*.whl)[test]"

Expand Down
4 changes: 4 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ rapids_find_package(

if(KvikIO_REMOTE_SUPPORT)
include(cmake/thirdparty/get_libcurl.cmake)
if(TARGET libcurl_static)
set_target_properties(libcurl_static PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
endif()

set(cuFile_FOUND 0)
Expand Down Expand Up @@ -247,6 +250,7 @@ set(final_code_string
"
set(KvikIO_CUDA_SUPPORT [=[${KvikIO_CUDA_SUPPORT}]=])
set(KvikIO_CUFILE_SUPPORT [=[${cuFile_FOUND}]=])
set(KvikIO_REMOTE_SUPPORT [=[${KvikIO_REMOTE_SUPPORT}]=])
"
)
string(
Expand Down
4 changes: 1 addition & 3 deletions cpp/cmake/thirdparty/get_libcurl.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# =============================================================================
# Copyright (c) 2024, NVIDIA CORPORATION.
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand All @@ -24,8 +24,6 @@ function(find_and_configure_libcurl)
rapids_cpm_find(
CURL 8.5.0
GLOBAL_TARGETS libcurl
BUILD_EXPORT_SET kvikio-exports
INSTALL_EXPORT_SET kvikio-exports
CPM_ARGS
GIT_REPOSITORY https://github.com/curl/curl
GIT_TAG curl-8_5_0
Expand Down
9 changes: 5 additions & 4 deletions cpp/include/kvikio/shim/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <dlfcn.h>
#include <sys/utsname.h>
#include <stdexcept>
#include <string>
#include <vector>

namespace kvikio {
Expand Down Expand Up @@ -45,15 +46,15 @@ namespace kvikio {
* @param name Name of the library to load.
* @return The library handle.
*/
void* load_library(char const* name, int mode = RTLD_LAZY | RTLD_LOCAL | RTLD_NODELETE);
void* load_library(std::string const& name, int mode = RTLD_LAZY | RTLD_LOCAL | RTLD_NODELETE);

/**
* @brief Load shared library
*
* @param names Vector of names to try when loading shared library.
* @return The library handle.
*/
void* load_library(std::vector<char const*> const& names,
void* load_library(std::vector<std::string> const& names,
int mode = RTLD_LAZY | RTLD_LOCAL | RTLD_NODELETE);

/**
Expand All @@ -65,11 +66,11 @@ void* load_library(std::vector<char const*> const& names,
* @param name Name of the symbol/function to load.
*/
template <typename T>
void get_symbol(T& handle, void* lib, char const* name)
void get_symbol(T& handle, void* lib, std::string const& name)
{
::dlerror(); // Clear old errors
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
handle = reinterpret_cast<T>(::dlsym(lib, name));
handle = reinterpret_cast<T>(::dlsym(lib, name.c_str()));
char const* err = ::dlerror();
if (err != nullptr) { throw std::runtime_error(err); }
}
Expand Down
8 changes: 4 additions & 4 deletions cpp/src/shim/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@

namespace kvikio {

void* load_library(char const* name, int mode)
void* load_library(std::string const& name, int mode)
{
::dlerror(); // Clear old errors
void* ret = ::dlopen(name, mode);
void* ret = ::dlopen(name.c_str(), mode);
if (ret == nullptr) { throw std::runtime_error(::dlerror()); }
return ret;
}

void* load_library(std::vector<char const*> const& names, int mode)
void* load_library(std::vector<std::string> const& names, int mode)
{
std::stringstream ss;
for (char const* name : names) {
for (auto const& name : names) {
ss << name << " ";
try {
return load_library(name, mode);
Expand Down
4 changes: 2 additions & 2 deletions python/kvikio/kvikio/_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# =============================================================================
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
# Copyright (c) 2022-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand All @@ -17,7 +17,7 @@ set(cython_modules arr.pyx buffer.pyx defaults.pyx cufile_driver.pyx file_handle
libnvcomp.pyx libnvcomp_ll.pyx
)

if(TARGET CURL::libcurl)
if(KvikIO_REMOTE_SUPPORT)
message(STATUS "Building remote_handle.pyx (libcurl found)")
list(APPEND cython_modules remote_handle.pyx)
else()
Expand Down

0 comments on commit c38038e

Please sign in to comment.