Skip to content

Commit

Permalink
Merge branch 'branch-25.04' into vendored-binary-morphology-update
Browse files Browse the repository at this point in the history
  • Loading branch information
grlee77 authored Feb 26, 2025
2 parents efa10ae + 0717baf commit 2a8b039
Show file tree
Hide file tree
Showing 58 changed files with 526 additions and 406 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
#

cmake_minimum_required(VERSION 3.26.4)
cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR)

################################################################################
# Prerequisite statements
Expand Down Expand Up @@ -209,7 +209,6 @@ install(DIRECTORY
install(DIRECTORY
${deps-fmt_SOURCE_DIR}/include/
${deps-nvtx3_SOURCE_DIR}/c/include/
${deps-nvtx3_SOURCE_DIR}/cpp/include/
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/${CUCIM_PACKAGE_NAME}/3rdparty)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <div align="left"><img src="https://rapids.ai/assets/images/rapids_logo.png" width="90px"/>&nbsp;cuCIM</div>

[RAPIDS](https://rapids.ai) cuCIM is an open-source, accelerated computer vision and image processing software library for multidimensional images used in biomedical, geospatial, material and life science, and remote sensing use cases.
[RAPIDS](https://rapids.ai) cuCIM (pronounced "koo-sim", see [here]( https://ipa-reader.com/?text=ku%CB%90%CB%88s%C9%AAm&voice=Joey )) is an open-source, accelerated computer vision and image processing software library for multidimensional images used in biomedical, geospatial, material and life science, and remote sensing use cases.

cuCIM offers:

Expand Down
2 changes: 1 addition & 1 deletion ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ conda config --set path_conflict warn

sccache --zero-stats

RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/libcucim
RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry build conda/recipes/libcucim

sccache --show-adv-stats

Expand Down
2 changes: 1 addition & 1 deletion ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sccache --zero-stats

# TODO: Remove `--no-test` flag once importing on a CPU
# node works correctly
RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \
RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry build \
--no-test \
--channel "${CPP_CHANNEL}" \
conda/recipes/cucim
Expand Down
3 changes: 3 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ rapids-pip-retry install \

sccache --zero-stats

rapids-logger "pyenv rehash"
pyenv rehash

# First build the C++ lib using CMake via the run script
./run build_local all ${CMAKE_BUILD_TYPE}

Expand Down
4 changes: 2 additions & 2 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ channels:
dependencies:
- c-compiler
- click
- cmake>=3.26.4,!=3.30.0
- cmake>=3.30.4
- cuda-version=11.8
- cudatoolkit
- cupy>=12.0.0
Expand Down Expand Up @@ -42,7 +42,7 @@ dependencies:
- recommonmark
- scikit-image>=0.19.0,<0.26.0a0
- scipy>=1.11.2
- sphinx>=8.0.0
- sphinx>=8.0.0,<8.2.0
- sysroot_linux-64==2.28
- tifffile>=2022.8.12
- yasm
Expand Down
4 changes: 2 additions & 2 deletions conda/environments/all_cuda-128_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ channels:
dependencies:
- c-compiler
- click
- cmake>=3.26.4,!=3.30.0
- cmake>=3.30.4
- cuda-cudart-dev
- cuda-nvcc
- cuda-version=12.8
Expand Down Expand Up @@ -41,7 +41,7 @@ dependencies:
- recommonmark
- scikit-image>=0.19.0,<0.26.0a0
- scipy>=1.11.2
- sphinx>=8.0.0
- sphinx>=8.0.0,<8.2.0
- sysroot_linux-64==2.28
- tifffile>=2022.8.12
- yasm
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/cucim/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ c_stdlib_version:
- "2.28"

cmake_version:
- ">=3.26.4,!=3.30.0"
- ">=3.30.4"
2 changes: 1 addition & 1 deletion conda/recipes/libcucim/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ c_stdlib_version:
- "2.28"

cmake_version:
- ">=3.26.4,!=3.30.0"
- ">=3.30.4"

# The CTK libraries below are missing from the conda-forge::cudatoolkit package
# for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages
Expand Down
16 changes: 7 additions & 9 deletions cpp/cmake/deps/abseil.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, NVIDIA CORPORATION.
# Copyright (c) 2020-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 @@ -19,18 +19,16 @@ if (NOT TARGET deps::abseil)
GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
GIT_TAG 20200225.2
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
FetchContent_GetProperties(deps-abseil)
if (NOT deps-abseil_POPULATED)
message(STATUS "Fetching abseil sources")
FetchContent_Populate(deps-abseil)
message(STATUS "Fetching abseil sources - done")
endif ()

# Create static library
cucim_set_build_shared_libs(OFF)
set(BUILD_TESTING FALSE) # Disable BUILD_TESTING (cmake-build-debug/_deps/deps-abseil-src/CMakeLists.txt:97)
add_subdirectory(${deps-abseil_SOURCE_DIR} ${deps-abseil_BINARY_DIR} EXCLUDE_FROM_ALL)
# Disable BUILD_TESTING (cmake-build-debug/_deps/deps-abseil-src/CMakeLists.txt:97)
set(BUILD_TESTING FALSE)
message(STATUS "Fetching abseil sources")
FetchContent_MakeAvailable(deps-abseil)
message(STATUS "Fetching abseil sources - done")

# Set PIC to prevent the following error message
# : /usr/bin/ld: ../lib/libabsl_strings.a(escaping.cc.o): relocation R_X86_64_PC32 against symbol `_ZN4absl14lts_2020_02_2516numbers_internal8kHexCharE' can not be used when making a shared object; recompile with -fPIC
Expand Down
43 changes: 10 additions & 33 deletions cpp/cmake/deps/boost-header-only.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-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 @@ -14,42 +14,19 @@
#

if (NOT TARGET deps::boost-header-only)
find_package(Git REQUIRED)
set(Boost_VERSION 1.75.0)
set(boost_component_list "interprocess" "config" "intrusive" "move" "assert" "static_assert" "container" "core" "date_time" "smart_ptr" "throw_exception" "utility" "type_traits" "numeric/conversion" "mpl" "preprocessor" "container_hash" "integer" "detail")
FetchContent_Declare(
deps-boost-header-only
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-${Boost_VERSION}
GIT_SHALLOW TRUE
)

FetchContent_GetProperties(deps-boost-header-only)
if (NOT deps-boost-header-only_POPULATED)
message(STATUS "Fetching boost-header-only sources")
FetchContent_Populate(deps-boost-header-only)
message(STATUS "Fetching boost-header-only sources - done")

message(STATUS "Applying patch for boost-header-only")
find_package(Git)
if(Git_FOUND OR GIT_FOUND)
execute_process(
COMMAND bash -c "${GIT_EXECUTABLE} reset HEAD --hard && ${GIT_EXECUTABLE} apply ${CMAKE_CURRENT_LIST_DIR}/boost-header-only.patch"
WORKING_DIRECTORY "${deps-boost-header-only_SOURCE_DIR}/libs/interprocess"
RESULT_VARIABLE exec_result
ERROR_VARIABLE exec_error
ERROR_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE exec_output
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(exec_result EQUAL 0)
message(STATUS "Applying patch for boost-header-only - done")
else()
message(STATUS "Applying patch for boost-header-only - failed")
message(FATAL_ERROR "${exec_output}\n${exec_error}")
endif()
endif ()
endif ()
message(STATUS "Fetching boost-header-only sources")
FetchContent_Populate(deps-boost-header-only
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-${Boost_VERSION}
GIT_SHALLOW TRUE
PATCH_COMMAND ${GIT_EXECUTABLE} apply "${CMAKE_CURRENT_LIST_DIR}/boost-header-only.patch" --directory=libs/interprocess)
message(STATUS "Fetching boost-header-only sources - done")

FetchContent_GetProperties(deps-boost-header-only)
add_library(deps::boost-header-only INTERFACE IMPORTED GLOBAL)

unset(boost_include_string)
Expand Down
7 changes: 6 additions & 1 deletion cpp/cmake/deps/boost.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
# Copyright (c) 2020-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 @@ -14,6 +14,9 @@
#

if (NOT TARGET deps::boost)
cmake_policy(PUSH)
cmake_policy(SET CMP0169 OLD)

set(Boost_VERSION 1.75.0)
set(Boost_BUILD_COMPONENTS container)
set(Boost_BUILD_OPTIONS "threading=multi cxxflags=-fPIC runtime-link=static variant=release link=static address-model=64 --layout=system")
Expand Down Expand Up @@ -72,4 +75,6 @@ if (NOT TARGET deps::boost)

set(deps-boost_SOURCE_DIR ${deps-boost_SOURCE_DIR} CACHE INTERNAL "" FORCE)
mark_as_advanced(deps-boost_SOURCE_DIR)

cmake_policy(POP)
endif ()
13 changes: 5 additions & 8 deletions cpp/cmake/deps/catch2.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, NVIDIA CORPORATION.
# Copyright (c) 2020-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 @@ -19,15 +19,12 @@ if (NOT TARGET deps::catch2)
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.4.0
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
FetchContent_GetProperties(deps-catch2)
if (NOT deps-catch2_POPULATED)
message(STATUS "Fetching catch2 sources")
FetchContent_Populate(deps-catch2)
message(STATUS "Fetching catch2 sources - done")
endif ()

add_subdirectory(${deps-catch2_SOURCE_DIR} ${deps-catch2_BINARY_DIR} EXCLUDE_FROM_ALL)
message(STATUS "Fetching catch2 sources")
FetchContent_MakeAvailable(deps-catch2)
message(STATUS "Fetching catch2 sources - done")

# Include Append catch2's cmake module path so that we can use `include(Catch)`.
# https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake
Expand Down
17 changes: 8 additions & 9 deletions cpp/cmake/deps/cli11.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, NVIDIA CORPORATION.
# Copyright (c) 2020-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 @@ -19,15 +19,14 @@ if (NOT TARGET deps::cli11)
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
GIT_TAG v1.9.1
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
FetchContent_GetProperties(deps-cli11)
if (NOT deps-cli11_POPULATED)
message(STATUS "Fetching cli11 sources")
FetchContent_Populate(deps-cli11)
message(STATUS "Fetching cli11 sources - done")
endif ()

add_subdirectory(${deps-cli11_SOURCE_DIR} ${deps-cli11_BINARY_DIR} EXCLUDE_FROM_ALL)
message(STATUS "Fetching cli11 sources")
set(CLI11_BUILD_DOCS OFF)
set(CLI11_BUILD_EXAMPLES OFF)
set(CLI11_BUILD_TESTS OFF)
FetchContent_MakeAvailable(deps-cli11)
message(STATUS "Fetching cli11 sources - done")

add_library(deps::cli11 INTERFACE IMPORTED GLOBAL)
target_link_libraries(deps::cli11 INTERFACE CLI11::CLI11)
Expand Down
15 changes: 7 additions & 8 deletions cpp/cmake/deps/fmt.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, NVIDIA CORPORATION.
# Copyright (c) 2020-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 @@ -19,17 +19,16 @@ if (NOT TARGET deps::fmt)
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 7.0.1
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
FetchContent_GetProperties(deps-fmt)
if (NOT deps-fmt_POPULATED)
message(STATUS "Fetching fmt sources")
FetchContent_Populate(deps-fmt)
message(STATUS "Fetching fmt sources - done")
endif ()

message(STATUS "Fetching fmt sources")

# Create static library
cucim_set_build_shared_libs(OFF)
add_subdirectory(${deps-fmt_SOURCE_DIR} ${deps-fmt_BINARY_DIR} EXCLUDE_FROM_ALL)

FetchContent_MakeAvailable(deps-fmt)
message(STATUS "Fetching fmt sources - done")

# Set PIC to prevent the following error message
# : /usr/bin/ld: ../lib/libfmtd.a(format.cc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
Expand Down
15 changes: 7 additions & 8 deletions cpp/cmake/deps/googlebenchmark.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, NVIDIA CORPORATION.
# Copyright (c) 2020-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 @@ -19,18 +19,17 @@ if (NOT TARGET deps::googlebenchmark)
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.5.1
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
FetchContent_GetProperties(deps-googlebenchmark)
if (NOT deps-googlebenchmark_POPULATED)
message(STATUS "Fetching googlebenchmark sources")
FetchContent_Populate(deps-googlebenchmark)
message(STATUS "Fetching googlebenchmark sources - done")
endif ()

message(STATUS "Fetching googlebenchmark sources")

# Create static library
cucim_set_build_shared_libs(OFF)
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
add_subdirectory(${deps-googlebenchmark_SOURCE_DIR} ${deps-googlebenchmark_BINARY_DIR} EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(deps-googlebenchmark)
message(STATUS "Fetching googlebenchmark sources - done")

cucim_restore_build_shared_libs()

add_library(deps::googlebenchmark INTERFACE IMPORTED GLOBAL)
Expand Down
14 changes: 5 additions & 9 deletions cpp/cmake/deps/googletest.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020, NVIDIA CORPORATION.
# Copyright (c) 2020-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 @@ -19,17 +19,13 @@ if (NOT TARGET deps::googletest)
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
)
FetchContent_GetProperties(deps-googletest)
if (NOT deps-googletest_POPULATED)
message(STATUS "Fetching googletest sources")
FetchContent_Populate(deps-googletest)
message(STATUS "Fetching googletest sources - done")
endif ()

message(STATUS "Fetching googletest sources")
# Create static library
cucim_set_build_shared_libs(OFF)
add_subdirectory(${deps-googletest_SOURCE_DIR} ${deps-googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(deps-googletest)
message(STATUS "Fetching googletest sources - done")
cucim_restore_build_shared_libs()

add_library(deps::googletest INTERFACE IMPORTED GLOBAL)
Expand Down
Loading

0 comments on commit 2a8b039

Please sign in to comment.