@@ -55,8 +55,8 @@ if (BUILD_NVJPEG2K_EXT)
5555 include (FetchContent )
5656 FetchContent_Declare (
5757 nvjpeg2k_headers
58- URL https://developer.download.nvidia.com/compute/nvjpeg2000/redist/libnvjpeg_2k/linux -x86_64/libnvjpeg_2k-linux -x86_64-0.9 .0.43 -archive.tar.xz
59- URL_HASH SHA512=22d14a20af67ba414956fd7c4223cf3fd519cec9ccbd0ae27603416ab143eae92457ab0434205fe66617bcc5a54805bfc6183f89205ea2d0068d497321a43783
58+ URL https://developer.download.nvidia.com/compute/nvjpeg2000/redist/libnvjpeg_2k/linux -x86_64/libnvjpeg_2k-linux -x86_64-0.10 .0.49_cuda12 -archive.tar.xz
59+ URL_HASH SHA512=29653927671913bbac8be5dc755c5ca16d63237f96c75a8beb3d05225c1a237f3848af9c3b9b6594970eb7f2f6d405df077aa741dafb4476f64996d7da8dd49d
6060 )
6161 FetchContent_Populate (nvjpeg2k_headers)
6262 set (NVJPEG2K_SEARCH_PATHS "${nvjpeg2k_headers_SOURCE_DIR } /include" )
@@ -93,8 +93,8 @@ if (BUILD_NVTIFF_EXT)
9393 include (FetchContent )
9494 FetchContent_Declare (
9595 nvtiff_headers
96- URL https://developer.download.nvidia.com/compute/nvtiff/redist/libnvtiff/linux -x86_64/libnvtiff-linux -x86_64-0.6 .0.78_cuda12 -archive.tar.xz
97- URL_HASH SHA512=95250f9ee6040adbabf3493a288f4020ce92cb83b33b4163949276bd1fbffbac49e16d39ea38ec8048f792abd64056a76ba62ef4bc84c43487e4f50068df7d1c
96+ URL https://developer.download.nvidia.com/compute/nvtiff/redist/libnvtiff/linux -x86_64/libnvtiff-linux -x86_64-0.7 .0.79_cuda12 -archive.tar.xz
97+ URL_HASH SHA512=7949894d0f0bb5e317c74db7a193a55d7eea492cc629dde5898c83f4077481a225e06d12e5c64f9d566cfc9e2ff3b6ca973d1b80647d6c32223827b06e2b02f4
9898 )
9999 FetchContent_Populate (nvtiff_headers)
100100 set (NVTIFF_SEARCH_PATHS "${nvtiff_headers_SOURCE_DIR } /include" )
@@ -122,6 +122,37 @@ endif()
122122if (BUILD_NVTIFF_EXT)
123123 message (STATUS "Using NVTIFF_INCLUDE=${NVTIFF_INCLUDE} " )
124124 include_directories (BEFORE SYSTEM ${NVTIFF_INCLUDE} )
125+
126+ # When linking statically, detect at configure time which nvtiff "Ex" APIs are available (header + lib).
127+ if (NOT WITH_DYNAMIC_NVTIFF AND NVTIFF_LIB AND NVTIFF_INCLUDE)
128+ set (_nvtiff_check_src "${CMAKE_BINARY_DIR } /nvtiff_check_src" )
129+ file (MAKE_DIRECTORY "${_nvtiff_check_src} " )
130+ macro (_nvtiff_try_symbol _result_var _symbol _name )
131+ file (WRITE "${_nvtiff_check_src} /${_name} .cpp"
132+ "/* Compile+link check for ${_symbol} */\n "
133+ "#include <nvtiff.h>\n "
134+ "int main() { (void)(void *)${_symbol} ; return 0; }\n " )
135+ file (WRITE "${_nvtiff_check_src} /CMakeLists.txt"
136+ "cmake_minimum_required(VERSION 3.18)\n "
137+ "project(${_name} NONE CXX)\n "
138+ "include_directories(\$ {NVTIFF_INCLUDE})\n "
139+ "add_executable(${_name} ${_name} .cpp)\n "
140+ "target_link_libraries(${_name} PRIVATE \$ {NVTIFF_LIB})\n " )
141+ try_compile (${_result_var}
142+ "${CMAKE_BINARY_DIR } /${_name} " "${_nvtiff_check_src} "
143+ ${_name} ${_name}
144+ CMAKE_FLAGS "-DNVTIFF_INCLUDE=${NVTIFF_INCLUDE} " "-DNVTIFF_LIB=${NVTIFF_LIB} " )
145+ if (${_result_var} )
146+ message (STATUS "nvtiff (static): ${_symbol} available" )
147+ else ()
148+ message (STATUS "nvtiff (static): ${_symbol} not available" )
149+ endif ()
150+ endmacro ()
151+ _nvtiff_try_symbol (NVTIFF_HAS_DECODE_IMAGE_EX nvtiffDecodeImageEx check_decode_ex )
152+ _nvtiff_try_symbol (NVTIFF_HAS_STREAM_PARSE_EX nvtiffStreamParseEx check_parse_ex )
153+ _nvtiff_try_symbol (NVTIFF_HAS_STREAM_GET_NUMBER_OF_TAGS nvtiffStreamGetNumberOfTags check_get_num_tags )
154+ _nvtiff_try_symbol (NVTIFF_HAS_STREAM_HAS_TAG nvtiffStreamHasTag check_has_tag )
155+ endif ()
125156else ()
126157 message (STATUS "nvTIFF extension build disabled" )
127158endif ()
0 commit comments