Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 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
2 changes: 1 addition & 1 deletion cpp/cmake/deps/cli11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::cli11)
FetchContent_Declare(
deps-cli11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
GIT_TAG v1.9.1
GIT_TAG v2.5.0
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmake/deps/fmt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::fmt)
FetchContent_Declare(
deps-fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 7.0.1
GIT_TAG 10.1.1
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmake/deps/googletest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::googletest)
FetchContent_Declare(
deps-googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
GIT_TAG v1.16.0
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmake/deps/json.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::json)
FetchContent_Declare(
deps-json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.9.1
GIT_TAG v3.11.3
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
11 changes: 11 additions & 0 deletions cpp/cmake/deps/libcuckoo.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 787def5..db8dfc1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,5 @@
-cmake_minimum_required(VERSION 3.1.0)
+# [cuCIM patch] Set minimum CMake version to 3.30.0
+cmake_minimum_required(VERSION 3.30.0)
project(libcuckoo LANGUAGES C CXX)

set(libcuckoo_VERSION_MAJOR 0)
diff --git a/libcuckoo/cuckoohash_map.hh b/libcuckoo/cuckoohash_map.hh
index 88f1f43..a36c273 100644
--- a/libcuckoo/cuckoohash_map.hh
Expand Down
8 changes: 4 additions & 4 deletions cpp/include/cucim/util/cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
if (cudaSuccess != cuda_status) \
{ \
fmt::print(stderr, "[Error] CUDA Runtime call {} in line {} of file {} failed with '{}' ({}).\n", #stmt, \
__LINE__, __FILE__, cudaGetErrorString(cuda_status), cuda_status); \
__LINE__, __FILE__, cudaGetErrorString(cuda_status), static_cast<int>(cuda_status)); \
} \
}

Expand All @@ -39,7 +39,7 @@
{ \
throw std::runtime_error( \
fmt::format("[Error] CUDA Runtime call {} in line {} of file {} failed with '{}' ({}).\n", #stmt, \
__LINE__, __FILE__, cudaGetErrorString(cuda_status), cuda_status)); \
__LINE__, __FILE__, cudaGetErrorString(cuda_status), static_cast<int>(cuda_status))); \
} \
}

Expand All @@ -49,7 +49,7 @@
if (_nvjpeg_status != NVJPEG_STATUS_SUCCESS) \
{ \
fmt::print("[Error] NVJPEG call {} in line {} of file {} failed with the error code {}.\n", #stmt, \
__LINE__, __FILE__, _nvjpeg_status)); \
__LINE__, __FILE__, static_cast<int>(_nvjpeg_status)); \
} \
}

Expand All @@ -60,7 +60,7 @@
{ \
throw std::runtime_error( \
fmt::format("[Error] NVJPEG call {} in line {} of file {} failed with the error code {}.\n", #stmt, \
__LINE__, __FILE__, _nvjpeg_status)); \
__LINE__, __FILE__, static_cast<int>(_nvjpeg_status))); \
} \
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cumed/cmake/deps/cli11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::cli11)
FetchContent_Declare(
deps-cli11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
GIT_TAG v1.9.1
GIT_TAG v2.5.0
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cumed/cmake/deps/fmt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::fmt)
FetchContent_Declare(
deps-fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 7.0.1
GIT_TAG 10.1.1
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cumed/cmake/deps/googletest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::googletest)
FetchContent_Declare(
deps-googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
GIT_TAG v1.16.0
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
4 changes: 3 additions & 1 deletion cpp/plugins/cucim.kit.cumed/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ target_include_directories(cumed_tests

include(Catch)
# See https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake for other options
catch_discover_tests(cumed_tests)
# Do not use catch_discover_tests() since it causes a test to be run at build time
# and somehow it causes a deadlock during the build.
# catch_discover_tests(cumed_tests)
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cuslide/cmake/deps/cli11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::cli11)
FetchContent_Declare(
deps-cli11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
GIT_TAG v1.9.1
GIT_TAG v2.5.0
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cuslide/cmake/deps/fmt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::fmt)
FetchContent_Declare(
deps-fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 7.0.1
GIT_TAG 10.1.1
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::googletest)
FetchContent_Declare(
deps-googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
GIT_TAG v1.16.0
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cuslide/cmake/deps/json.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::json)
FetchContent_Declare(
deps-json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.9.1
GIT_TAG v3.11.3
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if (NOT TARGET deps::libjpeg-turbo)
GIT_REPOSITORY https://github.com/libjpeg-turbo/libjpeg-turbo.git
GIT_TAG 2.0.6
GIT_SHALLOW TRUE
PATCH_COMMAND ${GIT_EXECUTABLE} apply "${CMAKE_CURRENT_LIST_DIR}/libjpeg-turbo.patch"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be generating this with rapids_cpm_generate_patch_command()?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cuCIM doesn't really use rapids-cmake today. I think that is the right idea, but there's a lot of effort needed to get cuCIM onto rapids-cmake.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KyleFromNVIDIA and @bdice!
Yes, currently cuCIM doesn't follow the standard RAPIDS build setup, but I’m planning to transition to a rapids-cmake and conda-package-based build setup in the near future.

EXCLUDE_FROM_ALL
)

Expand Down
11 changes: 11 additions & 0 deletions cpp/plugins/cucim.kit.cuslide/cmake/deps/libjpeg-turbo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8329097..f906d926 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,5 @@
-cmake_minimum_required(VERSION 2.8.12)
+# [cuCIM patch] Set minimum CMake version to 3.30.0
+cmake_minimum_required(VERSION 3.30.0)

if(CMAKE_EXECUTABLE_SUFFIX)
set(CMAKE_EXECUTABLE_SUFFIX_TMP ${CMAKE_EXECUTABLE_SUFFIX})
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ if (NOT TARGET deps::libopenjpeg)
FetchContent_Declare(
deps-libopenjpeg
GIT_REPOSITORY https://github.com/uclouvain/openjpeg.git
GIT_TAG v2.5.0
GIT_TAG v2.5.3
PATCH_COMMAND ${GIT_EXECUTABLE} apply "${CMAKE_CURRENT_LIST_DIR}/libopenjpeg.patch"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be generating this with rapids_cpm_generate_patch_command()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GIT_SHALLOW TRUE
)

Expand Down
14 changes: 14 additions & 0 deletions cpp/plugins/cucim.kit.cuslide/cmake/deps/libopenjpeg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b04561f4..2392c14d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,8 @@
# For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like
# e.g.:
# set(OPENJPEG_NAMESPACE "GDCMOPENJPEG")
-cmake_minimum_required(VERSION 3.5)
+# [cuCIM patch] Set minimum CMake version to 3.30.0
+cmake_minimum_required(VERSION 3.30.0)

if(NOT OPENJPEG_NAMESPACE)
set(OPENJPEG_NAMESPACE "OPENJPEG")
1 change: 1 addition & 0 deletions cpp/plugins/cucim.kit.cuslide/cmake/deps/libtiff.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if (NOT TARGET deps::libtiff)
GIT_REPOSITORY https://gitlab.com/libtiff/libtiff.git
GIT_TAG v4.1.0
GIT_SHALLOW TRUE
PATCH_COMMAND ${GIT_EXECUTABLE} apply "${CMAKE_CURRENT_LIST_DIR}/libtiff.patch"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be generating this with rapids_cpm_generate_patch_command()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXCLUDE_FROM_ALL
)

Expand Down
20 changes: 20 additions & 0 deletions cpp/plugins/cucim.kit.cuslide/cmake/deps/libtiff.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35b48770..7955fe73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,10 +23,12 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

-cmake_minimum_required(VERSION 2.8.11) # b/c of use of BUILD_INTERFACE generator expression
+# [cuCIM patch] Set minimum CMake version to 3.30.0
+cmake_minimum_required(VERSION 3.30.0)

-# Default policy is from 2.8.9
-cmake_policy(VERSION 2.8.9)
+# [cuCIM patch] Set default policy to 3.30.0
+# Default policy is from 3.30.0
+cmake_policy(VERSION 3.30.0)

@grlee77 grlee77 Apr 1, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems since CMake 3.12 it has been possible to specify a range of versions for cmake_minimum_required and cmake_policy (docs page). Not sure if that is a better approach, but what I didn't understand is:

1.) Why does having a lower minimum for cmake_minimum_required cause the build problems? 3.30 is greater than 2.8.9 so it seems like it wouldn't cause a conflict.

2.) For set_policy, another option mentioned on that page is environment variable CMAKE_POLICY_VERSION_MINIMUM could override the policy.

I was wondering if we set that environment variable during the build if some of the patches could be removed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see in that same docs page that it states:

Changed in version 3.27: Compatibility with versions of CMake older than 3.5 is deprecated. Calls to cmake_minimum_required(VERSION) or cmake_policy(VERSION) that do not specify at least 3.5 as their policy version (optionally via ...) will produce a deprecation warning in CMake 3.27 and above.

So it seems ideally upstream projects would add some maximum version like

cmake_minimum_required(2.8.9...3.30.0)

but unless that is implemented upstream we will still need some patch.

Maybe just check whether setting CMAKE_POLICY_VERSION_MINIMUM allows removing some of the patches?

@gigony gigony Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @grlee77 for the investigation and suggestion!

Maybe just check whether setting CMAKE_POLICY_VERSION_MINIMUM allows removing some of the patches?

Indeed, setting it could eliminate the need for some of the patches.
According to the manual (https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_VERSION_MINIMUM.html),

This variable should not be set by a project in CMake code as a way to set its own policy version. Use cmake_minimum_required(VERSION) and/or cmake_policy(VERSION) for that. This variable is meant to externally set policies for which a project has not itself been updated:

This variable needs to be set by an external command, and something like the following could bypass the error:

--- a/run
+++ b/run
@@ -281,7 +281,8 @@ build_local_libcucim_() {
         -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \
         -DCMAKE_PREFIX_PATH=${prefix} \
         -DCMAKE_BUILD_TYPE=${build_type_str} \
-        -DCMAKE_INSTALL_PREFIX=${source_folder}/install
+        -DCMAKE_INSTALL_PREFIX=${source_folder}/install \
+        -DCMAKE_POLICY_VERSION_MINIMUM=3.30.0
     ${CMAKE_CMD} --build ${build_folder} --config ${build_type_str} --target cucim -- -j $(nproc)
     ${CMAKE_CMD} --build ${build_folder} --config ${build_type_str} --target install -- -j $(nproc)

Projects may set this variable before a call to add_subdirectory() that adds a third-party project in order to set its policy version without modifying third-party code.

I couldn't find a proper way to set the variable for FetchContent_MakeAvailable() method (in such as 'cpp/cmake/deps/libcuckoo.cmake').

I am afraid that setting CMAKE_POLICY_VERSION_MINIMUM in the build command could make the following change meaningless:

Unless the API is broken or the update requires significant code changes, I believe updating libraries is beneficial from a security standpoint and for future work. I think resolving the minimum requirement issue by upgrading the versions is a reasonable approach, and I'd prefer to keep the current PR as is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake_policy() is also redundant, because cmake_minimum_required() already set it above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KyleFromNVIDIA !
Updated.

# Set MacOSX @rpath usage globally.
if (POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By setting cmake_minimum_required() to 3.30.0, all of this is redundant. It sets the policy level to 3.30.0, which includes setting CMP0020 to NEW.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank

By setting cmake_minimum_required() to 3.30.0, all of this is redundant. It sets the policy level to 3.30.0, which includes setting CMP0020 to NEW.

Thanks @KyleFromNVIDIA for the information and feedback!

Let me also patch those redundant lines.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just updated. Thank you!

2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cuslide/cmake/deps/pugixml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::pugixml)
FetchContent_Declare(
deps-pugixml
GIT_REPOSITORY https://github.com/zeux/pugixml.git
GIT_TAG v1.11.1
GIT_TAG v1.15
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,18 @@ int jpeg_decode_buffer(const void* handle,
THROW("tjDecompress2(): Invalid argument");

#ifndef NO_PUTENV
if (flags & TJFLAG_FORCEMMX)
putenv("JSIMD_FORCEMMX=1");
else if (flags & TJFLAG_FORCESSE)
putenv("JSIMD_FORCESSE=1");
else if (flags & TJFLAG_FORCESSE2)
putenv("JSIMD_FORCESSE2=1");
if (flags & TJFLAG_FORCEMMX) {
static char mmx[] = "JSIMD_FORCEMMX=1";
putenv(mmx);
}
else if (flags & TJFLAG_FORCESSE) {
static char sse[] = "JSIMD_FORCESSE=1";
putenv(sse);
}
else if (flags & TJFLAG_FORCESSE2) {
static char sse2[] = "JSIMD_FORCESSE2=1";
putenv(sse2);
}
#endif

if (setjmp(instance->jerr.setjmp_buffer))
Expand Down Expand Up @@ -350,9 +356,9 @@ int jpeg_decode_buffer(const void* handle,
for (i = 0; i < (int)dinfo->output_height; i++)
{
if (flags & TJFLAG_BOTTOMUP)
row_pointer[i] = &dstBuf[(dinfo->output_height - i - 1) * (size_t)pitch];
row_pointer[i] = (JSAMPROW)(&dstBuf[(dinfo->output_height - i - 1) * (size_t)pitch]);
else
row_pointer[i] = &dstBuf[i * (size_t)pitch];
row_pointer[i] = (JSAMPROW)(&dstBuf[i * (size_t)pitch]);
}
while (dinfo->output_scanline < dinfo->output_height)
jpeg_read_scanlines(dinfo, &row_pointer[dinfo->output_scanline], dinfo->output_height - dinfo->output_scanline);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ struct TIFF;
#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */

/* Signed size type */
#define TIFF_SSIZE_T signed long
// Check if TIFF_SSIZE_T is already defined before defining it
#ifndef TIFF_SSIZE_T
#define TIFF_SSIZE_T int64_t
#endif
typedef TIFF_SSIZE_T tmsize_t;
typedef tmsize_t tsize_t; /* i/o size in bytes */

Expand Down
4 changes: 2 additions & 2 deletions cpp/plugins/cucim.kit.cuslide/src/cuslide/tiff/ifd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ IFD::IFD(TIFF* tiff, uint16_t index, ifd_offset_t offset) : tiff_(tiff), ifd_ind
image_piece_count_ = tif_dir.td_stripoffset_entry.tdir_count;

image_piece_offsets_.reserve(image_piece_count_);
uint64* td_stripoffset_p = tif_dir.td_stripoffset_p;
uint64* td_stripbytecount_p = tif_dir.td_stripbytecount_p;
uint64_t* td_stripoffset_p = tif_dir.td_stripoffset_p;
uint64_t* td_stripbytecount_p = tif_dir.td_stripbytecount_p;

// Copy data to vector
image_piece_offsets_.insert(image_piece_offsets_.end(), &td_stripoffset_p[0], &td_stripoffset_p[image_piece_count_]);
Expand Down
4 changes: 3 additions & 1 deletion cpp/plugins/cucim.kit.cuslide/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@ target_include_directories(cuslide_tests

include(Catch)
# See https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake for other options
catch_discover_tests(cuslide_tests)
# Do not use catch_discover_tests() since it causes a test to be run at build time
# and somehow it causes a deadlock during the build.
# catch_discover_tests(cuslide_tests)
4 changes: 2 additions & 2 deletions cpp/src/cache/image_cache_per_process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ PerProcessImageCacheValue::~PerProcessImageCacheValue()
case io::DeviceType::kCUDAManaged:
case io::DeviceType::kCPUShared:
case io::DeviceType::kCUDAShared:
fmt::print(stderr, "Device type {} is not supported!\n", device_type);
fmt::print(stderr, "Device type {} is not supported!\n", static_cast<int>(device_type));
break;
}
data = nullptr;
Expand Down Expand Up @@ -134,7 +134,7 @@ void* PerProcessImageCache::allocate(std::size_t n)
case io::DeviceType::kCUDAManaged:
case io::DeviceType::kCPUShared:
case io::DeviceType::kCUDAShared:
fmt::print(stderr, "Device type {} is not supported!\n", device_type_);
fmt::print(stderr, "Device type {} is not supported!\n", static_cast<int>(device_type_));
break;
}
return nullptr;
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/cuimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ CuImage::~CuImage()
case io::DeviceType::kCUDAManaged:
case io::DeviceType::kCPUShared:
case io::DeviceType::kCUDAShared:
fmt::print(stderr, "Device type {} is not supported!\n", device_type);
fmt::print(stderr, "Device type {} is not supported!\n", static_cast<int>(device_type));
break;
}
}
Expand Down Expand Up @@ -1231,7 +1231,7 @@ bool CuImage::crop_image(const io::format::ImageReaderRegionRequestDesc& request
case cucim::io::DeviceType::kCUDAManaged:
case cucim::io::DeviceType::kCPUShared:
case cucim::io::DeviceType::kCUDAShared:
throw std::runtime_error(fmt::format("Device type {} not supported!", in_device.type()));
throw std::runtime_error(fmt::format("Device type {} not supported!", static_cast<int>(in_device.type())));
break;
}

Expand Down Expand Up @@ -1443,7 +1443,7 @@ void CuImageIterator<DataType>::increase_index_()
case io::DeviceType::kCUDAManaged:
case io::DeviceType::kCPUShared:
case io::DeviceType::kCUDAShared:
fmt::print(stderr, "Device type {} is not supported!\n", device_type);
fmt::print(stderr, "Device type {} is not supported!\n", static_cast<int>(device_type));
break;
}

Expand Down
6 changes: 3 additions & 3 deletions cpp/src/loader/thread_batch_data_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ThreadBatchDataLoader::ThreadBatchDataLoader(LoadFunc load_func,
case io::DeviceType::kCUDAManaged:
case io::DeviceType::kCPUShared:
case io::DeviceType::kCUDAShared:
fmt::print(stderr, "Device type {} is not supported!\n", device_type);
fmt::print(stderr, "Device type {} is not supported!\n", static_cast<int>(device_type));
break;
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@ ThreadBatchDataLoader::~ThreadBatchDataLoader()
case io::DeviceType::kCUDAManaged:
case io::DeviceType::kCPUShared:
case io::DeviceType::kCUDAShared:
fmt::print(stderr, "Device type {} is not supported!", device_type);
fmt::print(stderr, "Device type {} is not supported!", static_cast<int>(device_type));
break;
}
raster_ptr = nullptr;
Expand Down Expand Up @@ -243,7 +243,7 @@ uint8_t* ThreadBatchDataLoader::next_data()
case io::DeviceType::kCUDAManaged:
case io::DeviceType::kCPUShared:
case io::DeviceType::kCUDAShared:
fmt::print(stderr, "Device type {} is not supported!\n", device_type);
fmt::print(stderr, "Device type {} is not supported!\n", static_cast<int>(device_type));
break;
}

Expand Down
4 changes: 3 additions & 1 deletion cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@ target_link_libraries(cucim_tests

include(Catch)
# See https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake for other options
catch_discover_tests(cucim_tests)
# Do not use catch_discover_tests() since it causes a test to be run at build time
# and somehow it causes a deadlock during the build.
# catch_discover_tests(cucim_tests)
2 changes: 1 addition & 1 deletion python/cmake/deps/fmt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::fmt)
FetchContent_Declare(
deps-fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 7.0.1
GIT_TAG 10.1.1
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
Expand Down
Loading