Skip to content
Permalink
Browse files

added Makevars files

  • Loading branch information...
Michael Kuehn
Michael Kuehn committed Aug 21, 2019
1 parent ff61a2b commit b5683f457fa514e458a40932f3c3becb901528d8
Showing with 12 additions and 1 deletion.
  1. +1 −0 DESCRIPTION
  2. +1 −0 NAMESPACE
  3. +1 −0 R/geodistpar.R
  4. +2 −0 src/Makevars
  5. +5 −0 src/Makevars.win
  6. +2 −1 src/geodistpar.cpp
@@ -22,3 +22,4 @@ Imports:
RcppParallel
URL: https://github.com/mkuehn10/geodistpar
BugReports: https://github.com/mkuehn10/geodistpar/issues
SystemRequiresments: GNU make
@@ -2,4 +2,5 @@

export(geodistpar)
importFrom(Rcpp,sourceCpp)
importFrom(RcppParallel,RcppParallelLibs)
useDynLib(geodistpar)
@@ -1,5 +1,6 @@
#' @useDynLib geodistpar
#' @importFrom Rcpp sourceCpp
#' @importFrom RcppParallel RcppParallelLibs
NULL

#' geodistpar
@@ -0,0 +1,2 @@
CXX_STD = CXX11
PKG_LIBS += $(shell ${R_HOME}/bin/Rscript -e "RcppParallel::RcppParallelLibs()")
@@ -0,0 +1,5 @@
CXX_STD = CXX11
PKG_CXXFLAGS += -DRCPP_PARALLEL_USE_TBB=1

PKG_LIBS += $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" \
-e "RcppParallel::RcppParallelLibs()")
@@ -69,7 +69,8 @@ NumericMatrix geodistpar_cpp(NumericMatrix x, NumericMatrix y, int measure) {

myDistanceMatrix my_distance_matrix(x, y, rmat, measure);

parallelFor(0, rmat.nrow(), my_distance_matrix, 1);
parallelFor(0, rmat.nrow(), my_distance_matrix);

return rmat;
}

0 comments on commit b5683f4

Please sign in to comment.
You can’t perform that action at this time.