Skip to content

Commit

Permalink
docs: Document build issues in README
Browse files Browse the repository at this point in the history
  • Loading branch information
danieledler committed May 24, 2021
1 parent d02df79 commit 36d6c33
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
*.tar.gz
inst/doc
.Rbuildignore
tmp
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,23 @@ devtools::install_github("danieledler/swigr")
Binary bundle can be installed from R by running

```R
devtools::install_url("https://github.com/danieledler/swigr/releases/download/v0.0.1/swigr_0.0.1.tgz")
devtools::install_url("https://github.com/danieledler/swigr/releases/download/v0.0.1/swigr_0.0.1b.tgz")
```

## Issues

R packages can be in [five different states](https://r-pkgs.org/package-structure-state.html):
* source
* bundled
* binary
* installed
* in-memory

`devtools::build()` creates a bundled package and can be installed with `devtools::install_github("danieledler/swigr")`. However, the C++ source code is included in a `src` directory and will be compiled on the user's computer, which creates problems for many Windows users.

`devtools::build(binary = T)` creates a binary package that instead of a `src` folder has a `libs` folder with the C++ code compiled to a shared library. This is required for `devtools::install_url("...")` to work, but `install_url` also require a `man` folder which is not present when building a binary package.

CRAN makes binaries available from bundles and includes a man folder.
## TODO

* Add `zzz.R` with `.onUnload()` to clean SWIG?

0 comments on commit 36d6c33

Please sign in to comment.