From a3b3725c0b5953c420dcae394328aca39ce5efab Mon Sep 17 00:00:00 2001 From: dereckmezquita Date: Sun, 7 Jul 2024 22:13:44 -0500 Subject: [PATCH] Debugging Rcpp build 8 revise C++. --- .github/workflows/pkgdown.yml | 4 +++- src/bb-bollinger-bands.cpp | 8 ++++---- src/init.c | 1 + src/sma-simple-moving-average.cpp | 2 ++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index bf58e7a..6e5849f 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -52,6 +52,8 @@ jobs: run: | echo "Contents of src/bb-bollinger-bands.cpp:" cat src/bb-bollinger-bands.cpp + echo "Contents of src/sma-simple-moving-average.cpp:" + cat src/sma-simple-moving-average.cpp echo "Contents of src/init.c:" cat src/init.c echo "Compiling C++ code manually:" @@ -74,4 +76,4 @@ jobs: - name: Deploy to branch if: success() shell: Rscript {0} - run: pkgdown::deploy_to_branch(branch = "bot/github-pages") \ No newline at end of file + run: pkgdown::deploy_to_branch(branch = "bot/github-pages") diff --git a/src/bb-bollinger-bands.cpp b/src/bb-bollinger-bands.cpp index 8bbacc9..1c1d479 100644 --- a/src/bb-bollinger-bands.cpp +++ b/src/bb-bollinger-bands.cpp @@ -1,13 +1,13 @@ #include -#include +// [[Rcpp::interfaces(r, cpp)]] -#include "bb-bollinger-bands.h" +#include #include "sma-simple-moving-average.h" -using namespace Rcpp; - // https://gallery.rcpp.org/articles/creating-a-datatable-in-rcpp/ +using namespace Rcpp; + // [[Rcpp::export]] Rcpp::List bb(std::vector price, int n, int sd = 2) { // calculate the simple moving average diff --git a/src/init.c b/src/init.c index d77eb45..8c86cae 100644 --- a/src/init.c +++ b/src/init.c @@ -28,4 +28,5 @@ static const R_CallMethodDef CallEntries[] = { void R_init_dmplot(DllInfo *dll) { R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); R_useDynamicSymbols(dll, FALSE); + R_forceSymbols(dll, TRUE); } \ No newline at end of file diff --git a/src/sma-simple-moving-average.cpp b/src/sma-simple-moving-average.cpp index 606d425..736cad9 100644 --- a/src/sma-simple-moving-average.cpp +++ b/src/sma-simple-moving-average.cpp @@ -1,4 +1,6 @@ #include +// [[Rcpp::interfaces(r, cpp)]] + #include using namespace Rcpp;