rcpp

Error in dyn.load(dllfile) : unable to load shared object | Expected in: flat namespace

試著忘記壹切 提交于 2021-01-27 05:47:31
问题 I am new to R package development. I am developing a package (bartpkg) that has in its src/ folder one (prime) cpp file and some helper cpp ( X.Cpp , Y.Cpp ) and one c file ( Z.C ) and their header files ( X.h , Y.h and Z.h ) I am getting the following error when I do 'Build & Reload' in Rstudio. Error in dyn.load(dllfile) : unable to load shared object '/Users/abcd/BART/bart_pkg1/src/bartpkg.so': dlopen(/Users/abcd/BART/bart_pkg1/src/bartpkg.so, 6): Symbol not found: __ZN3RNG4nfixElm

Cannot compile R packages with c++ code after updating to macOS Catalina

你说的曾经没有我的故事 提交于 2021-01-24 09:42:06
问题 I just updated to macOS Catalina and tried to compile an R package I am developing. However, now it does not work. I am not sure it is because of the OS or because of the Rcpp package. Any help would be appreciated! > devtools::load_all(".") Loading phyr Re-compiling phyr ─ installing *source* package ‘phyr’ ... ** using staged installation ** libs /usr/local/clang4/bin/clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Users/dli/R/Rcpp/include" -I"/Users/dli/R

Iterate over vectors from an imported dataframe row-wise

跟風遠走 提交于 2021-01-05 07:47:10
问题 Im trying to make the switch from R to c++ coding. If you choose to down vote this question, at the very least patronize me with an answer so I can learn something. My question is how am I supposed to approach row-wise calculations in c++ once I have passed c++ a dataframe? Conceptually, I understand that once I pass c++ a dataframe, c++ will treat each column as its own vector that I have to explicitly name. Where I am having trouble is setting up a for loop to iterate through the same

Cannot compile RcppArmadillo

帅比萌擦擦* 提交于 2020-12-31 14:56:40
问题 RcppArmadillo is a dependency of a few packages I'm trying to install. I get this error on compilation of RcppArmadillo version 0.10.1.0.0 (which is what R automatically pulls from CRAN when it finds that RcppArmadillo is a dep): RcppArmadillo.cpp:26:40: error: redeclaration 'arma::arma_version::major' differs in 'constexpr' const unsigned int arma::arma_version::major; ^ In file included from ../inst/include/armadillo:91:0, from ../inst/include/RcppArmadilloForward.h:49, from ../inst/include

Cannot compile RcppArmadillo

时光毁灭记忆、已成空白 提交于 2020-12-31 14:55:31
问题 RcppArmadillo is a dependency of a few packages I'm trying to install. I get this error on compilation of RcppArmadillo version 0.10.1.0.0 (which is what R automatically pulls from CRAN when it finds that RcppArmadillo is a dep): RcppArmadillo.cpp:26:40: error: redeclaration 'arma::arma_version::major' differs in 'constexpr' const unsigned int arma::arma_version::major; ^ In file included from ../inst/include/armadillo:91:0, from ../inst/include/RcppArmadilloForward.h:49, from ../inst/include

Speed up RcppArmadillo: How to link to OpenBlas in an R package

▼魔方 西西 提交于 2020-12-30 08:36:24
问题 I am working on an R package which uses RcppArmadillo. I am trying to take advantage of faster matrix multiplication found in OpenBLAS. In the documentation of the C++ armadillo library, it says if we have OpenBLAS on our machine then Armadillo would use OpenBLAS instead of BLAS. However, when I compile my R package, I get something like this: g++ -m64 -std=c++11 -shared -L/usr/lib64/R/lib -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o PackageTest.so class1.o class2.o class3.o

Speed up RcppArmadillo: How to link to OpenBlas in an R package

为君一笑 提交于 2020-12-30 08:34:50
问题 I am working on an R package which uses RcppArmadillo. I am trying to take advantage of faster matrix multiplication found in OpenBLAS. In the documentation of the C++ armadillo library, it says if we have OpenBLAS on our machine then Armadillo would use OpenBLAS instead of BLAS. However, when I compile my R package, I get something like this: g++ -m64 -std=c++11 -shared -L/usr/lib64/R/lib -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o PackageTest.so class1.o class2.o class3.o

Speed up RcppArmadillo: How to link to OpenBlas in an R package

不羁的心 提交于 2020-12-30 08:34:31
问题 I am working on an R package which uses RcppArmadillo. I am trying to take advantage of faster matrix multiplication found in OpenBLAS. In the documentation of the C++ armadillo library, it says if we have OpenBLAS on our machine then Armadillo would use OpenBLAS instead of BLAS. However, when I compile my R package, I get something like this: g++ -m64 -std=c++11 -shared -L/usr/lib64/R/lib -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o PackageTest.so class1.o class2.o class3.o

Speed up RcppArmadillo: How to link to OpenBlas in an R package

元气小坏坏 提交于 2020-12-30 08:34:05
问题 I am working on an R package which uses RcppArmadillo. I am trying to take advantage of faster matrix multiplication found in OpenBLAS. In the documentation of the C++ armadillo library, it says if we have OpenBLAS on our machine then Armadillo would use OpenBLAS instead of BLAS. However, when I compile my R package, I get something like this: g++ -m64 -std=c++11 -shared -L/usr/lib64/R/lib -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o PackageTest.so class1.o class2.o class3.o

Calling a Rcpp function from another Rcpp function while building an R package

自作多情 提交于 2020-12-29 03:05:31
问题 I took this example from a different question. I am building an R package with Rcpp. I have a function like fun1 (below) that I want to put into its own .cpp file. Then I want to call fun1 with other functions (like fun() does below). I want fun1 in a separate file because I am going to call it from several Rcpp functions that are in different .cpp files. Are there certain include statements and things I need to do to make the fun1 function accessible in the .cpp where fun() is located? Thank