diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 12b2242..8470463 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -44,7 +44,7 @@ jobs: TZ: 'Etc/UTC' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 - uses: mlverse/torch/.github/actions/setup-r@main with: @@ -54,7 +54,8 @@ jobs: if: matrix.container != '' run: | apt-get update - apt-get install -y curl sudo libxml2-dev wget chrpath rsync git libjpeg-dev + apt-get install -y curl sudo libxml2-dev wget chrpath rsync git libjpeg-dev libpng-dev \ + libcurl4-openssl-dev pkg-config patchelf libuv1-dev curl -fsSL https://get.docker.com -o get-docker.sh DRY_RUN=1 sh ./get-docker.sh @@ -64,7 +65,7 @@ jobs: cmake-version: '3.31' - if: ${{matrix.config.cuda != ''}} - uses: Jimver/cuda-toolkit@v0.2.23 + uses: Jimver/cuda-toolkit@v0.2.35 id: cuda-toolkit with: cuda: '${{matrix.config.cuda}}.${{matrix.config.cuda_patch}}' @@ -91,7 +92,6 @@ jobs: mkdir build && cd build cmake .. ${{ matrix.config.cmake_args }} cmake --build . --target package --config Release --parallel 4 - - id: version shell: bash run: | @@ -109,7 +109,7 @@ jobs: file_glob: true tag: v${{ steps.version.outputs.version }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: ${{ steps.version.outputs.fname }} path: csrc/build/*.zip @@ -139,7 +139,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 if: ${{ !contains(matrix.config.os, 'm1') }} - uses: r-lib/actions/setup-r@v2 @@ -173,7 +173,7 @@ jobs: version=$(Rscript -e "cat(as.character(desc::desc_get_version()))") echo "version=$version" >> $GITHUB_OUTPUT - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: name: 'torchvisionlib-${{ steps.version.outputs.version }}${{ matrix.config.artifact }}' path: build/ diff --git a/DESCRIPTION b/DESCRIPTION index aa0619e..2d8f39f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,28 +4,33 @@ Version: 0.8.0.9000 Authors@R: c( person("Daniel", "Falbel", , "daniel@rstudio.com", role = "aut"), person("Tomasz", "Kalinowski", , "tomasz@posit.co", role = c("ctb", "cre")), - person(family = "RStudio", role = "cph") - ) -Description: Implements additional operators for computer vision models, including - operators necessary for image segmentation and object detection deep learning - models. + person(, "RStudio", role = "cph") + ) +Description: Implements additional operators for computer vision models, + including operators necessary for image segmentation and object + detection deep learning models. License: MIT + file LICENSE -Encoding: UTF-8 -Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +URL: https://github.com/mlverse/torchvisionlib +BugReports: https://github.com/mlverse/torchvisionlib/issues Depends: R (>= 3.6) -LinkingTo: - Rcpp, - torch Imports: + glue, Rcpp, - torch (>= 0.17.0), rlang, - glue, + torch (>= 0.17.0), withr Suggests: testthat (>= 3.0.0) +LinkingTo: + Rcpp, + torch +Config/Needs/development: Rcpp, torch, torchexport, testthat, roxygen2 +Config/roxygen2/version: 8.0.0 Config/testthat/edition: 3 -URL: https://github.com/mlverse/torchvisionlib -BugReports: https://github.com/mlverse/torchvisionlib/issues +Config/torchvisionlib/binaries: Set TORCHVISIONLIB_URL to a URL, local + ZIP, or directory containing pre-built torchvisionlib binaries. If + unset, defaults to inst/libs/ (installed) or src/ (development). +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +SystemRequirements: C++17, CMake (>= 3.21), libtorch, libtorchvision diff --git a/csrc/CMakeLists.txt b/csrc/CMakeLists.txt index f950d6a..a6209ee 100644 --- a/csrc/CMakeLists.txt +++ b/csrc/CMakeLists.txt @@ -1,5 +1,5 @@ -project(torchvisionlib) cmake_minimum_required(VERSION 3.21) +project(torchvisionlib) # accommodate differing conventions include(GNUInstallDirs) @@ -27,7 +27,7 @@ else() SET(TORCH_INSTALL_SCRIPT "https://raw.githubusercontent.com/mlverse/torch/main/R/install.R") SET(TORCH_DESCRIPTION "https://raw.githubusercontent.com/mlverse/torch/main/DESCRIPTION") execute_process ( - COMMAND Rscript -e "cat(desc::desc(text=readLines('${TORCH_DESCRIPTION}'))$get('Version'))" + COMMAND Rscript -e "cat(desc::desc(text=readLines('${TORCH_DESCRIPTION}'))\$get('Version'))" OUTPUT_VARIABLE TORCH_R_VERSION ) message(STATUS "TORCH_R_VERSION: ${TORCH_R_VERSION}") @@ -58,20 +58,20 @@ if(WIN32) SET(COMMON_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}) ExternalProject_Add(zlib GIT_REPOSITORY https://github.com/madler/zlib.git - GIT_TAG v1.2.12 + GIT_TAG v1.3.2 PREFIX "${CMAKE_CURRENT_BINARY_DIR}/zlib" CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DCMAKE_ASM_COMPILER=MSVC -DCMAKE_ASM_NASM_COMPILER=MSVC ) ExternalProject_Add(libpng GIT_REPOSITORY https://github.com/glennrp/libpng - GIT_TAG v1.6.37 + GIT_TAG v1.6.55 DEPENDS zlib PREFIX "${CMAKE_CURRENT_BINARY_DIR}/libpng" CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DCMAKE_IGNORE_PATH=C:/rtools44/x86_64-w64-mingw32.static.posix/include -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH};${CURRENT_BINARY_DIR}/lib ) ExternalProject_Add(libjpeg GIT_REPOSITORY https://github.com/libjpeg-turbo/libjpeg-turbo - GIT_TAG 2.1.2 + GIT_TAG 3.1.3 PREFIX "${CMAKE_CURRENT_BINARY_DIR}/libjpeg" CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DWITH_JPEG8=0 -DWITH_JPEG7=0 -DENABLE_SHARED=0 -DWITH_TURBOJPEG=0 -DCMAKE_IGNORE_PATH=C:/rtools44/x86_64-w64-mingw32.static.posix/include ) @@ -184,7 +184,7 @@ add_custom_command(TARGET torchvisionlib POST_BUILD # binaries bundles and upload them to the GitHub Releases page. set(CPACK_GENERATOR ZIP) execute_process ( - COMMAND Rscript -e "cat(desc::description$new(file = '../../DESCRIPTION')$get('Version'))" + COMMAND Rscript -e "cat(desc::description\$new(file = '../../DESCRIPTION')\$get('Version'))" OUTPUT_VARIABLE CPACK_PACKAGE_VERSION )