Changelog
Source:NEWS.md
rvtk 0.1.3
CRAN release: 2026-05-11
New features
-
Windows VTK discovery (
configure.winrewritten). The package now searches for a system VTK installation on Windows before falling back to the pre-built libraries. Detection order:-
VTK_DIRenvironment variable. - Rtools45
pacman(queries installed packages; never installs automatically). - Common Rtools45 / MSYS2 prefixes (
/x86_64-w64-mingw32.static.posix,/ucrt64,/mingw64, …). - Automatic download of pre-built libraries (fallback — see below). Both static (
.a) and shared (.dll.aimport libs + DLLs) system installations are accepted.
-
-
Windows shared-DLL support (
configure.win,tools/winlibs.R,R/vtk.R,R/zzz.R). Windows now fully supports shared VTK libraries:- System or pacman/MSYS2 installations that provide
.dll.aimport libs are accepted and used directly. - A pre-built shared-DLL build (
vtk-X.Y.Z-shared-posix-x64.zip) is available as an alternative to the existing static build. Select it by settingVTK_LINK_TYPE=sharedbefore installing rvtk (default isstatic). - VTK DLLs are staged in rvtk’s own
inst/vtk-dlls/. An.onLoadhook prepends that directory toPATHviaSys.setenv()when rvtk is loaded, making the DLLs visible to all downstream packages that declareImports: rvtkwithout any manual PATH manipulation. The originalPATHis restored in.onUnload(). Downstream packages do not receive a copy of the DLLs — they piggyback on rvtk’s staged directory at run time.
- System or pacman/MSYS2 installations that provide
-
build-vtk-libs.yml: newbuild-windows-sharedCI job producesvtk-X.Y.Z-shared-posix-x64.zipalongside the existing static archive.
Bug fixes
-
Unix pre-built static libraries survive
R CMD build(configure,R/vtk.R,cleanup). The pre-built archive is now extracted toinst/prebuilt/so that headers and static libraries ship inside the installed package.read_vtk_conf()resolves the actual paths at run time viasystem.file("prebuilt", package = "rvtk"), mirroring the Windows approach and survivingR CMD buildtemp-dir cycles.
Internal
- Removed dead variable
lib_rootfromtools/winlibs.R(assigned but never read). - Removed dead variable
all_libs_fullfrom the Windows static branch ofread_vtk_conf()inR/vtk.R(assigned but never read;lib_flagsis built entirely from-lshort names). - New CI workflow (
.github/workflows/downstream-check.yaml) builds and checks a minimal downstream package against rvtk across all supported platform × VTK-strategy combinations (system, pre-built static, pre-built shared).
rvtk 0.1.2
Re-submission addressing CRAN reviewer feedback on v0.1.1.
Changes
-
DESCRIPTION: Software names (
'VTK','Homebrew','pkg-config','Rtools45') are now consistently quoted with single quotes in the Title, Description, and SystemRequirements fields, per CRAN policy. Function calls such asrvtk::CppFlags()are no longer wrapped in single quotes. -
CppFlags(),LdFlags(),LdFlagsFile(): Replacedcat()withwriteLines()and addedinvisible()returns so functions behave in a more idiomatic R style while still allowing shell command-substitution capture. -
tools/winlibs.R: The Windows VTK zip is now extracted to a temporary directory (tempfile()) before being copied intoinst/windows/. This avoids writing intermediate files to the package source tree (home filespace) during installation. -
Examples: All exported functions now have small, executable
@examplesentries.LdFlagsFile()writes totempdir()in its example. -
Tests: Test suite expanded to 100% line coverage of the non-platform- specific code paths on all platforms; Windows-specific branches (
LdFlagsFile()response-file path,read_vtk_conf()Windows resolver) are exercised by the existing R-hub Windows CI jobs.
rvtk 0.1.1
The planned CRAN submission of v0.1.0 was cancelled after downstream package developers reported linker errors when building against the pre-built Windows VTK libraries. Two root causes were identified and fixed:
Wrong toolchain. The Windows VTK zip was compiled with the Rtools45 UCRT64 toolchain (
/ucrt64/bin/gcc), which uses a dynamic C runtime and emits DLL-import symbols (__imp_fseeko64,__imp_ftello64, …). However,R CMD INSTALLlinks R packages with thex86_64-w64-mingw32.static.posixtoolchain, which is fully static. The mismatch caused undefined references tonanosleep64,ftime64,__imp_fseeko64, and__imp_ftello64. The GitHub Actions workflow now builds the Windows VTK zip with thex86_64-w64-mingw32.static.posixcompiler, matching the toolchain that downstream packages use.Command-line length overflow. The full set of VTK
-llinker flags exceeds the 8 191-character Windows command-line limit, causing the linker to silently drop flags at the end of the list. A new functionLdFlagsFile(path)writes all flags to a response file and returns the short@pathtoken that both GNU ld and LLVM lld support. Downstream packages should callLdFlagsFile('src/vtk_libs.rsp')from theirconfigure/configure.winscript instead ofLdFlags().
Changes
-
New function
LdFlagsFile(path): writes VTK linker flags to a response file and returns@pathfor use inMakevars. Preferred overLdFlags()on all platforms to avoid the Windows command-line length limit. - Windows pre-built VTK libraries are now compiled with the
x86_64-w64-mingw32.static.posixtoolchain (Rtools45), matching the toolchain used byR CMD INSTALLfor CRAN packages. - Windows system libraries appended to
PKG_LIBSreduced to-lgdi32only; the UCRT64-specific-lwinpthread -lmingwex -lucrtbaseflags are no longer needed because the static.posix sysroot resolves POSIX symbols internally. - README updated to document
LdFlagsFile(), explain the rationale, provide a unifiedconfigureexample valid on all platforms, and correct the Windows toolchain description.
rvtk 0.1.0
- Initial CRAN submission.
- Bundles VTK 9.5.2 pre-built static libraries (
.a) for Windows (Rtools45 UCRT x64), macOS arm64, macOS x86_64, and Linux x86_64, distributed via GitHub Releases and built with GitHub Actions. - VTK discovery strategy on macOS and Linux (in priority order):
- User-supplied
VTK_DIRenvironment variable. - Homebrew (macOS only).
-
pkg-config. - Well-known system prefixes (
/usr,/usr/local) (Linux only). - Automatic download of pre-built static libraries from https://github.com/astamm/rvtk/releases as a fallback.
- User-supplied
- On Windows, pre-built UCRT64 static libraries are always downloaded automatically from https://github.com/astamm/rvtk/releases.
-
Windows limitation:
netcdfandlibprojare not available in the Rtools45 UCRT64 environment. The following VTK modules are therefore disabled in the Windows pre-built libraries:VTK_IONetCDF,VTK_IOHDF,VTK_GeovisCore,VTK_RenderingCore. Downstream packages requiring these modules cannot be built on Windows with rvtk’s pre-built libraries. - Downstream packages can retrieve compiler and linker flags via
rvtk::CppFlags()andrvtk::LdFlags().