This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support R-package with cmake build and fix installation instructions (#…
…17228) * Support R-package with cmake build and fix installation instructions * Fix typo * Fix callback.R * Clarify creation of personal R library * Fix generation of R-package documentation * Remove unused USE_BLAS variable on CI for make rpkg * Add cmake build command for get_started/linux/r/*.md pages * Fix zzz.R swallowing error messages * Fix R-package/src/Makevars for OpenCV dependency See #17282
- Loading branch information
Showing
12 changed files
with
82 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
rcpplint: | ||
3rdparty/dmlc-core/scripts/lint.py mxnet-rcpp ${LINT_LANG} R-package/src | ||
|
||
rpkg: | ||
mkdir -p R-package/inst/libs | ||
cp src/io/image_recordio.h R-package/src | ||
if [ -d "lib" ]; then \ | ||
cp -rf lib/libmxnet.so R-package/inst/libs; \ | ||
if [ -e "lib/libtvm_runtime.so" ]; then \ | ||
cp -rf lib/libtvm_runtime.so R-package/inst/libs; \ | ||
fi; \ | ||
else \ | ||
cp -rf build/libmxnet.so R-package/inst/libs; \ | ||
if [ -e "build/libtvm_runtime.so" ]; then \ | ||
cp -rf build/libtvm_runtime.so R-package/inst/libs; \ | ||
fi; \ | ||
fi | ||
|
||
mkdir -p R-package/inst/include | ||
cp -rl include/* R-package/inst/include | ||
Rscript -e "if(!require(devtools)){install.packages('devtools', repo = 'https://cloud.r-project.org/')}" | ||
Rscript -e "if(!require(roxygen2)||packageVersion('roxygen2') < '6.1.1'){install.packages('roxygen2', repo = 'https://cloud.r-project.org/')}" | ||
Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='https://cloud.r-project.org/')); install_deps(pkg='R-package', dependencies = TRUE)" | ||
cp R-package/dummy.NAMESPACE R-package/NAMESPACE # NAMESPACE will be replaced by devtools::document later | ||
echo "import(Rcpp)" >> R-package/NAMESPACE | ||
R CMD INSTALL R-package | ||
Rscript -e "require(mxnet); mxnet:::mxnet.export('R-package'); warnings()" | ||
Rscript -e "devtools::document('R-package');warnings()" | ||
R CMD INSTALL R-package | ||
|
||
rpkgtest: | ||
Rscript -e 'require(testthat);res<-test_dir("R-package/tests/testthat");if(!testthat:::all_passed(res)){stop("Test failures", call. = FALSE)}' | ||
Rscript -e 'res<-covr:::package_coverage("R-package");fileConn<-file(paste("r-package_coverage_",toString(runif(1)),".json"));writeLines(covr:::to_codecov(res), fileConn);close(fileConn)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
CXX_STD = CXX11 | ||
PKG_CPPFLAGS = -I../inst/include | ||
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) | ||
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) `pkg-config --libs opencv` | ||
PKG_CFLAGS = `pkg-config --cflags opencv` | ||
PKG_CPPFLAGS = -I../inst/include `pkg-config --cflags opencv` `Rscript -e 'Rcpp:::CxxFlags()'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
|
||
PKG_CPPFLAGS = -I../inst/include | ||
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) -L../inst/libs/x64/ -llibmxnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters