[R-pkg-devel] Creating and hosting static libraries for package installation on Windows

Uwe Ligges ||gge@ @end|ng |rom @t@t|@t|k@tu-dortmund@de
Wed Dec 11 10:23:08 CET 2024


We really want to get rid of having compiled code imported during the 
installation process. Ideally talk to Tomas Kalibera to get the 
libraries you need included in to the next Rtools update.

Best,
Uwe Ligges


On 11.12.2024 05:23, Satyaprakash Nayak wrote:
> Hi r-package-devel
> 
> I am working on updating my package `sundialr` (
> https://cran.r-project.org/web/packages/sundialr/index.html), wherein I was
> earlier bundling the C source files with the package, but now I am using
> `cmake` to create static libraries for the upstream C library SUNDIALS
> which the package provides an interface for. In brief, the previous
> approach can be found at:
> 
> https://github.com/sn248/sundialr/blob/master/src/Makevars
> 
> And the new approach can be seen below (heavily borrowed from nloptr
> package installation approach):
> 
> https://github.com/sn248/sundialr/blob/cmake-install/tools/cmake_call.sh
> 
> The second approach works successfully on linux and macOS platforms
> (checked by rhub).
> 
> I am struggling to get this working on a Windows platform, and have looked
> at a few packages (e.g., nloptr, rcppredis, openssl) which have solved this
> issue. As I understand the following steps are required to get the static
> libraries in correct locations for package installation on the Windows
> 
> 1) Host the .tar.gz files or .zip files on https://github.com/rwinlib/
> (deprecated now) or https://github.com/r-windows/bundles/releases/download/
> which should contain the static libraries (*.a files) in separate folders
> for i386, x64-ucrt and x-64 platforms and required header files in the
> `include` folder.
> 
> 2) Use a winlibs.R file within the `tools` sub-directory in the package
> file structure to download the .zip or .tar.gz file and extract them to a
> `windows` directory.
> 
> 3) Set PKG_CPPFLAGS and PKG_LIBS via Makewars.win file in src sub-directory
> in the package files.
> 
> Currently, I am struggling with Step #1, i.e., how to create the required
> .zip or .tar.gz files and host them on
> https://github.com/r-windows/bundles/releases for download. I will be
> thankful if any one can provide some guidance in this regard.
> 
> Sincerely
> Satya
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel


More information about the R-package-devel mailing list