Search Results

Search found 3 results on 1 pages for 'rcpp'.

Page 1/1 | 1 

  • I am getting error when using Attributes in Rcpp and have RcppArmadillo code

    - by howard123
    I am trying to create a package with RcppArmadillo. The code uses the new attributes methodology of Rcpp. The sourceCpp works fine and compiles the code, but when I build a package I get errors when I use RcppArmadillo code. Without the RcppArmadillo code and using regulare C++, I do not get these errors. The C++ code (it is essentially the fastLm sample code) is: // [[Rcpp::depends(RcppArmadillo)]] #include <Rcpp.h> #include <RcppArmadillo.h> using namespace Rcpp; // [[Rcpp::depends(RcppArmadillo)]] #include <RcppArmadillo.h> // [[Rcpp::export]] List fastLm(NumericVector yr, NumericMatrix Xr) { int n = Xr.nrow(), k = Xr.ncol(); arma::mat X(Xr.begin(), n, k, false); arma::colvec y(yr.begin(), yr.size(), false); arma::colvec coef = arma::solve(X, y); arma::colvec resid = y - X*coef; double sig2 = arma::as_scalar(arma::trans(resid)*resid/(n-k)); arma::colvec stderrest = arma::sqrt( sig2 * arma::diagvec( arma::inv(arma::trans(X)*X)) ); return List::create(Named("coefficients") = coef, Named("stderr") = stderrest); } Here is the compilation error, after I execute "R Rcpp::compileAttributes() * Updated src/RcppExports.cpp == Rcmd.exe INSTALL --no-multiarch NewPackage * installing to library 'C:/Users/Howard/Documents/R/win-library/2.15' * installing *source* package 'NewPackage' ... ** libs g++ -m64 -I"C:/R/R-2-15-2/include" -DNDEBUG -I"C:/Users/Howard/Documents/R/win-library/2.15/Rcpp/include" -I"C:/Users/Howard/Documents/R/win-library/2.15/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o g++ -m64 -I"C:/R/R-2-15-2/include" -DNDEBUG -I"C:/Users/Howard/Documents/R/win-library/2.15/Rcpp/include" -I"C:/Users/Howard/Documents/R/win-library/2.15/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c test_arma3.cpp -o test_arma3.o g++ -m64 -shared -s -static-libgcc -o NewPackage.dll tmp.def RcppExports.o test_arma3.o C:/Users/Howard/Documents/R/win-library/2.15/Rcpp/lib/x64/libRcpp.a -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/R/R-2-15-2/bin/x64 -lR test_arma3.o:test_arma3.cpp:(.text+0xae4): undefined reference to `dgemm_' test_arma3.o:test_arma3.cpp:(.text+0x19db): undefined reference to `dgemm_' test_arma3.o:test_arma3.cpp:(.text+0x1b0c): undefined reference to `dgemv_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma6auxlib8solve_odIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EE[_ZN4arma6auxlib8solve_odIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EE]+0x702): undefined reference to `dgels_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma6auxlib8solve_udIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EE[_ZN4arma6auxlib8solve_udIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EE]+0x51c): undefined reference to `dgels_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma6auxlib10det_lapackIdEET_RKNS_3MatIS2_EEb[_ZN4arma6auxlib10det_lapackIdEET_RKNS_3MatIS2_EEb]+0x14b): undefined reference to `dgetrf_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma6auxlib5solveIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EEb[_ZN4arma6auxlib5solveIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EEb]+0x375): undefined reference to `dgesv_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma4gemvILb1ELb0ELb0EE15apply_blas_typeIdEEvPT_RKNS_3MatIS3_EEPKS3_S3_S3_[_ZN4arma4gemvILb1ELb0ELb0EE15apply_blas_typeIdEEvPT_RKNS_3MatIS3_EEPKS3_S3_S3_]+0x17d): undefined reference to `dgemv_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_2OpINS_3MatIdEENS_9op_htransEEES5_EEvRNS4_INT_9elem_typeEEERKNS_4GlueIS8_T0_NS_10glue_timesEEE[_ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_2OpINS_3MatIdEENS_9op_htransEEES5_EEvRNS4_INT_9elem_typeEEERKNS_4GlueIS8_T0_NS_10glue_timesEEE]+0x37a): undefined reference to `dgemm_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x2c1): undefined reference to `dgetrf_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x322): undefined reference to `dgetri_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x398): undefined reference to `dgetri_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x775): undefined reference to `dgetrf_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x7d6): undefined reference to `dgetri_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x892): undefined reference to `dgetri_' collect2: ld returned 1 exit status ERROR: compilation failed for package 'NewPackage' * removing 'C:/Users/Howard/Documents/R/win-library/2.15/NewPackage' * restoring previous 'C:/Users/Howard/Documents/R/win-library/2.15/NewPackage' Exited with status 1.

    Read the article

  • How to market R at your institute?

    - by ran2
    Okay, I admit there are lots of threads R vs. something. The strengths of R are obvious to most people here. Still though advertising R in an environment that has been preferring various kinds of other software for quite some time is not easy. Moreover, even in the limited time I´ve been dealing with R, it improved so dramatically that I would mention things among its strengths that I would not have listed when I started my personal R-evolution. So, what I am trying to do here is to collect the most recent and striking arguments that can be put in nutshell and be presented easily. What I got on my list so far is: the Springer useR series ggplot2 and its documentation open source CRAN Rapache rcpp rsocket What can you add to this list? SO threads are also very welcome as answers. EDIT: so far, though indeed very helpful, most answers are arguments (pros) why one would want to use R. Do you have some specific hints that I could include in some kind of overview presentation? EDIT2: I wanted to add this link about R's future to the list...

    Read the article

  • Installing latest version of R-base

    - by Student
    I have been unsuccessfully trying to install the latest version (2.15.2) of r-base. Apparently, R package "Rcpp" would not install for R version 2.14.1 - the version that installs for me. I am not sure what/how/where to change my installation attempts which appear below. Please note that I am using ubuntu-12.04.1-server-i386. (1) ------------ The current installed version is R version 2.14.1 (2011-12-22) sudo apt-get install r-base Reading package lists... Done Building dependency tree Reading state information... Done r-base is already the newest version. (2) ------------ Including version information doesn't help: sudo apt-get install r-base=2.15.1-5ubuntu1 Reading package lists... Done Building dependency tree Reading state information... Done E: Version '2.15.1-5ubuntu1' for 'r-base' was not found (3) ------------- Changes based on CRAN Ubuntu instructions http://cran.r-project.org/bin/linux/ubuntu/README 3.1: Added to /etc/apt/sources.list deb http://lib.stat.cmu.edu/R/CRAN/bin/linux/ubuntu quantal/ 3.2: sudo apt-get update 3.3: sudo apt-get install r-base Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: r-base : Depends: r-base-core (= 2.15.2-1quantal2) but it is not going to be installed Depends: r-recommended (= 2.15.2-1quantal2) but it is not going to be installed Recommends: r-base-html but it is not going to be installed E: Unable to correct problems, you have held broken packages.

    Read the article

1