Powered by CMake
, the R package cmaker
setups C/C++ develop environment for R package, to enjoy auto-complete, code navigation, parallel compiling and other features of IDE. Not convinced? Watch Xcode in action and give it a try. All the generated files are stored in sub-directory proj/
and cmake/
besides CMakeList.txt
in package root directory, so it can be cleaned easily if not satisfied. Testing, suggestion, and pull request are welcome.
The IDE project generated by cmaker
is for development of R package only. Always check and build R package following CRAN document before release.
You may copy the example from cmaker
to set a playground with the following R command
file.copy(from = system.file("examples/rcppexample", package = "cmaker"),
to = ".", recursive = TRUE)
cmaker
only take care of the C/C++ source files, and R files should be edited in other editors, such as RStudio or Emacs/ESS.
ls_IDEs()
to get recommend IDEs for your system.add_cmake("pkg_dir", language = "CXX", cxx_standard = "98", compileAttributes = TRUE)
to generate cmake files for the R package.generate_project("pkg_dir", "IDE_name")
to generate project for your preferred IDE.load_asis("pkg_dir")
to load the package. load_asis
works the same way as devtools::load_all
, but assuming the dynamic library has been built properly.Windows is not supported yet due to complexity of compiling R packages in Windows. Will be supported soon. Please stay tuned.
cmaker
require devtools (>= 1.7.0.9000)
, which is not on CRAN yet. Install newest devtools
from github, and then install cmaker
from github. The following R script installs them automatically.
Mac and Linux
if (! "devtools" %in% installed.packages())
install.packages("devtools")
if (packageVersion("devtools") < "1.7.0.9000") {
## The head of master branch is borken at time of writting.
## Install devtools 1.7.0.9000
devtools::install_github("hadley/devtools", ref = "4d0964a1")
}
devtools::install_github("luckyrandom/cmaker")