File tree Expand file tree Collapse file tree 7 files changed +68
-6
lines changed
Expand file tree Collapse file tree 7 files changed +68
-6
lines changed Original file line number Diff line number Diff line change 1+ ^.*\.Rproj$
2+ ^\.Rproj\.user$
Original file line number Diff line number Diff line change 11* .o
22* .so
33.Rhistory
4+ * .Rcheck
5+ .Rproj.user
6+ * .tgz
7+ * .tar.gz
Original file line number Diff line number Diff line change 11Package: swigr
2- Title: What the Package Does (One Line, Title Case)
2+ Title: An example R package using SWIG to wrap C++
33Version: 0.0.1
44Authors@R:
55 person(given = "First",
66 family = "Last",
77 role = c("aut", "cre"),
8899 comment = c(ORCID = "YOUR-ORCID-ID"))
10- Description: What the package does (one paragraph).
11- License: What license it uses
10+ Description: A simple example repo to test making an R package
11+ from C++ code using SWIG to generate wrapper code. The goal is
12+ to make it easy to install for both Linux, MacOS and Windows
13+ users. Windows users should be able to install a binary package
14+ to not require tools to compile the C++ code.
15+ License: AGPL (>= 3)
1216Encoding: UTF-8
1317LazyData: true
1418RoxygenNote: 7.1.0
Original file line number Diff line number Diff line change 1- # swigr
2- An example project to test building an R package from C++ code using SWIG
1+ # SwigR - An example R package using SWIG to wrap C++
2+
3+ A simple example repo to test making an R package
4+ from C++ code using SWIG to generate wrapper code. The goal is
5+ to make it easy to install for both Linux, MacOS and Windows
6+ users. Windows users should be able to install a binary package
7+ to not require tools to compile the C++ code.
8+
9+ ## Install
10+
11+ Swigr can be installed as a source package from R by running
12+
13+ ``` R
14+ devtools :: install_github(" danieledler/swigr" )
15+ ```
16+
17+ Binary bundle can be installed from R by running
18+
19+ ``` R
20+ devtools :: install_url(" https://github.com/danieledler/swigr/releases/download/v0.0.1/swigr_0.0.1.tgz" )
21+ ```
22+
323
424## TODO
525
6- Add ` zzz.R ` with ` .onUnload() ` to clean SWIG?
26+ * Add ` zzz.R ` with ` .onUnload() ` to clean SWIG?
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ setwd("~/dev/R/swig")
2020devtools :: install(" swigr" )
2121setwd(" ~/dev/R/swig/swigr" )
2222
23+ # Install local binary bundle
24+ devtools :: install_url(" file:///Users/Daniel/dev/R/swig/swigr_bin_man.tgz" )
25+
2326# Test package
2427swigr :: test_r()
2528swigr :: test_example()
Original file line number Diff line number Diff line change 55# source("example.R")
66# cacheMetaData(1)
77
8+ search()
9+ # detach(package:swig, unload = TRUE)
10+
811install.packages(" devtools" )
12+
13+ # Install from github
914devtools :: install_github(" danieledler/swigr" )
1015
16+ # Install source bundle from URL
17+ devtools :: install_url(" https://github.com/danieledler/swigr/releases/download/v0.0.1/swigr_0.0.1.tar.gz" )
18+
19+ # Install binary bundle from URL
20+ devtools :: install_url(" https://github.com/danieledler/swigr/releases/download/v0.0.1/swigr_0.0.1.tgz" )
21+
22+
1123swigr :: test_example()
1224
1325# ----- Object creation -----
Original file line number Diff line number Diff line change 1+ Version: 1.0
2+
3+ RestoreWorkspace: Default
4+ SaveWorkspace: Default
5+ AlwaysSaveHistory: Default
6+
7+ EnableCodeIndexing: Yes
8+ UseSpacesForTab: Yes
9+ NumSpacesForTab: 2
10+ Encoding: UTF-8
11+
12+ RnwWeave: Sweave
13+ LaTeX: pdfLaTeX
14+
15+ BuildType: Package
16+ PackageUseDevtools: Yes
17+ PackageInstallArgs: --no-multiarch --with-keep.source
You can’t perform that action at this time.
0 commit comments