Re: [Rcpp-devel] RcppArmadillo with -fopenmp: Not using all available cores

2024-03-02 Thread Dirk Eddelbuettel
Hi Robin, On 2 March 2024 at 16:34, Robin Liu wrote: | sessionInfo() was the right clue. Indeed the version of R on machine B was not | linked to OpenBLAS. Switching to a version with OpenBLAS allows the test code | to use all cores. | | A clear way to check which library is linked is to run the

Re: [Rcpp-devel] RcppArmadillo with -fopenmp: Not using all available cores

2024-03-02 Thread Robin Liu
Hi Dirk, sessionInfo() was the right clue. Indeed the version of R on machine B was not linked to OpenBLAS. Switching to a version with OpenBLAS allows the test code to use all cores. A clear way to check which library is linked is to run the following: > extSoftVersion()["BLAS"] Thanks for you

Re: [Rcpp-devel] RcppArmadillo with -fopenmp: Not using all available cores

2024-02-24 Thread Dirk Eddelbuettel
On 24 February 2024 at 11:44, Robin Liu wrote: | Thank you Dirk for the response. | | I called RcppArmadillo::armadillo_get_number_of_omp_threads() on both machines | and correctly see that machine A and B have 20 and 40 cores, respectively. I | also see that calling the setter changes this value

Re: [Rcpp-devel] RcppArmadillo with -fopenmp: Not using all available cores

2024-02-24 Thread Robin Liu
Thank you Dirk for the response. I called RcppArmadillo::armadillo_get_number_of_omp_threads() on both machines and correctly see that machine A and B have 20 and 40 cores, respectively. I also see that calling the setter changes this value. However, calling the setter does not seem to change the

Re: [Rcpp-devel] RcppArmadillo with -fopenmp: Not using all available cores

2024-02-23 Thread Dirk Eddelbuettel
On 23 February 2024 at 09:35, Robin Liu wrote: | Hi all, | | Here is an R script that uses Armadillo to decompose a large matrix and print | the first 10 eigenvalues. | | library(RcppArmadillo) | library(Rcpp) | | src <- | r"(#include | | // [[Rcpp::depends(RcppArmadillo)]] | | // [[Rcpp::e

Re: [Rcpp-devel] RcppArmadillo build failures

2017-10-29 Thread Dirk Eddelbuettel
On 27 October 2017 at 08:11, Dirk Eddelbuettel wrote: | | We have two recent build failures reports at GitHub: | | https://github.com/RcppCore/RcppArmadillo/issues/177 | https://github.com/RcppCore/RcppArmadillo/issues/185 | | I don't understand what is going on as this just builds fine on my s

Re: [Rcpp-devel] RcppArmadillo Mat_meat.hpp:4467 and arma_static_check.hpp:31 errors

2017-07-25 Thread Dirk Eddelbuettel
On 25 July 2017 at 12:56, Patrick Veenstra wrote: | My apologies! I mistook what the code in those files were for. It seemed to | be completely separate from my code. So I thought it was something about my | environment. But in the process of setting up a reproducible example, I | found that actua

Re: [Rcpp-devel] RcppArmadillo Mat_meat.hpp:4467 and arma_static_check.hpp:31 errors

2017-07-25 Thread Patrick Veenstra
My apologies! I mistook what the code in those files were for. It seemed to be completely separate from my code. So I thought it was something about my environment. But in the process of setting up a reproducible example, I found that actually it was something in my own code. An accidental assignme

Re: [Rcpp-devel] RcppArmadillo Mat_meat.hpp:4467 and arma_static_check.hpp:31 errors

2017-07-24 Thread Dirk Eddelbuettel
Please provide a minimal yet reproducible example. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | [email protected] ___ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/r

Re: [Rcpp-devel] RcppArmadillo Mat_meat.hpp:4467 and arma_static_check.hpp:31 errors

2017-07-24 Thread Patrick Veenstra
Correction, Armadillo version: 7.900.2 On 24 July 2017 at 19:09, Patrick Veenstra wrote: > When attempting to compile a cpp function that uses RcppArmadillo (in > RStudio), I get the following two errors from files provided by > RcppArmadillo: > > Error 1: In ~/RLibs/RcppArmadillo/include/armadi

Re: [Rcpp-devel] [RcppArmadillo] Result of Rcpp Wrap() for Sparse Matrix

2017-06-15 Thread Serguei Sokol
Le 14/06/2017 à 16:06, Serguei Sokol a écrit : Le 14/06/2017 à 15:21, Douglas Bates a écrit : ... That is the format of the dgTMatrix class from the Matrix package for R but not, as far as I can tell, in Armadillo. A brief glance at the Armadillo documentation indicates that sparse matrices a

Re: [Rcpp-devel] [RcppArmadillo] Result of Rcpp Wrap() for Sparse Matrix

2017-06-14 Thread Serguei Sokol
Le 14/06/2017 à 17:33, Douglas Bates a écrit : On Wed, Jun 14, 2017 at 9:06 AM Serguei Sokol mailto:[email protected]>> wrote: Le 14/06/2017 à 15:21, Douglas Bates a écrit : > > > On Wed, Jun 14, 2017 at 3:59 AM Serguei Sokol mailto:[email protected]>

Re: [Rcpp-devel] [RcppArmadillo] Result of Rcpp Wrap() for Sparse Matrix

2017-06-14 Thread Douglas Bates
On Wed, Jun 14, 2017 at 9:06 AM Serguei Sokol wrote: > Le 14/06/2017 à 15:21, Douglas Bates a écrit : > > > > > > On Wed, Jun 14, 2017 at 3:59 AM Serguei Sokol > wrote: > > > > Le 13/06/2017 à 18:24, Douglas Bates a écrit : > > > On Tue, Jun 13, 2017 at 1

Re: [Rcpp-devel] [RcppArmadillo] Result of Rcpp Wrap() for Sparse Matrix

2017-06-14 Thread Serguei Sokol
Le 14/06/2017 à 15:21, Douglas Bates a écrit : On Wed, Jun 14, 2017 at 3:59 AM Serguei Sokol mailto:[email protected]>> wrote: Le 13/06/2017 à 18:24, Douglas Bates a écrit : > On Tue, Jun 13, 2017 at 10:56 AM Binxiang Ni mailto:[email protected]>

Re: [Rcpp-devel] [RcppArmadillo] Result of Rcpp Wrap() for Sparse Matrix

2017-06-14 Thread Dirk Eddelbuettel
On 14 June 2017 at 11:00, Serguei Sokol wrote: | Le 13/06/2017 à 18:24, Douglas Bates a écrit : | > On Tue, Jun 13, 2017 at 10:56 AM Binxiang Ni mailto:[email protected]>> wrote: | > | > Hi, | > | > I am working on fixing sparse matrix conversion for RcppArmadillo. Now a problem come

Re: [Rcpp-devel] [RcppArmadillo] Result of Rcpp Wrap() for Sparse Matrix

2017-06-14 Thread Douglas Bates
On Wed, Jun 14, 2017 at 3:59 AM Serguei Sokol wrote: > Le 13/06/2017 à 18:24, Douglas Bates a écrit : > > On Tue, Jun 13, 2017 at 10:56 AM Binxiang Ni > wrote: > > > > Hi, > > > > I am working on fixing sparse matrix conversion for RcppArmadillo. > Now a prob

Re: [Rcpp-devel] [RcppArmadillo] Result of Rcpp Wrap() for Sparse Matrix

2017-06-14 Thread Serguei Sokol
Le 13/06/2017 à 18:24, Douglas Bates a écrit : On Tue, Jun 13, 2017 at 10:56 AM Binxiang Ni mailto:[email protected]>> wrote: Hi, I am working on fixing sparse matrix conversion for RcppArmadillo. Now a problem comes up to me: what kind of sparse matrix is expected to pass from

Re: [Rcpp-devel] [RcppArmadillo] Result of Rcpp Wrap() for Sparse Matrix

2017-06-13 Thread Douglas Bates
On Tue, Jun 13, 2017 at 10:56 AM Binxiang Ni wrote: > Hi, > > I am working on fixing sparse matrix conversion for RcppArmadillo. Now a > problem comes up to me: what kind of sparse matrix is expected to pass from > Armadillo to R? That is, what should the result of wrap() be? dgCMatrix(if > logic

Re: [Rcpp-devel] RcppArmadillo::sample() multiple definition error

2016-04-28 Thread Dirk Eddelbuettel
On 28 April 2016 at 03:10, Subodh Acharya wrote: | Hello,  | I know this was once fixed in the RcppArmadillo, | As discussed here | | http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-August/006364.html | | But when I tried to compile my package today, that error showed up again. I |

Re: [Rcpp-devel] RcppArmadillo, solve always requires zgels?

2015-05-31 Thread Baptiste Auguie
Hi, I attach a minimal sourceCpp file: Rcpp::sourceCpp('testzgels.cpp') provides extra debugging info, and shows my complete lack of understanding of c++ templates. It would appear that upon compilation, all cases (nrow == ncol, nrow > ncol, nrow < ncol) are considered (of course: the matrix A h

Re: [Rcpp-devel] RcppArmadillo, solve always requires zgels?

2015-05-31 Thread Dirk Eddelbuettel
On 1 June 2015 at 09:06, Baptiste Auguie wrote: | Hi, | | Thanks Dirk for your suggestions. Let me try to clarify a few things below. | Basically, | | - zgels should not be needed (probably, and if I was doing things correctly) | | - I believe the template mechanism is simply unaware of the squ

Re: [Rcpp-devel] RcppArmadillo, solve always requires zgels?

2015-05-31 Thread Baptiste Auguie
Hi, Thanks Dirk for your suggestions. Let me try to clarify a few things below. Basically, - zgels should not be needed (probably, and if I was doing things correctly) - I believe the template mechanism is simply unaware of the square format of my matrix, and defaults to the nrow < ncol case for

Re: [Rcpp-devel] RcppArmadillo, solve always requires zgels?

2015-05-31 Thread Dirk Eddelbuettel
Hi Baptiste, On 31 May 2015 at 20:47, Baptiste Auguie wrote: | Dear list, | | My cda package (https://github.com/baptiste/cda) solves a linear system Ax=b | with Armadillo; win-builder and CRAN complain about a missing "zgels_" when | trying to build on windows or mac, as it's not part of the su

Re: [Rcpp-devel] RcppArmadillo test release

2015-05-12 Thread Dirk Eddelbuettel
On 9 May 2015 at 10:36, Dirk Eddelbuettel wrote: | | There is a test-release [0] of RcppArmadillo 0.5.100.2 available [1] in the | Rcpp drat repo. If you would to help test it do | |drat::addRepo("RcppCore") # maybe after install.packages("drat") |update.packages() | | or use a

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-25 Thread Charles Determan Jr
William, To close this point on the use of Rdefines.h on the list it was my oversight to include all the R header files. I have now removed them. I initially only retained those headers as the initial package contained them. I was unaware that Rcpp includes the necessary components and I can us

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-25 Thread William Dunlap
Why do you include "Rdefines.h" in your Rcpp code? It contains errors (e.g., it leaves the initial Rf_ off of the length function). Also, in my opinion, it is obsolete, especially for Rcpp code, since it is for writing code that works in R and S (including S+) and Rcpp will never work in S+. Bil

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-25 Thread Dirk Eddelbuettel
On 25 February 2015 at 09:26, Charles Determan Jr wrote: | I have finally solved the problem.  After coming across another posting http:// | r.789695.n4.nabble.com/rtools-fstream-error-td4702713.html I discovered the | problem.  I needed to include #define R_NO_REMAP at the start of my file and |

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-25 Thread Charles Determan Jr
I have finally solved the problem. After coming across another posting http://r.789695.n4.nabble.com/rtools-fstream-error-td4702713.html I discovered the problem. I needed to include #define R_NO_REMAP at the start of my file and then append Rf_ to any function I use from Rdefines.h. The package

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-25 Thread Charles Determan Jr
My apologies, I should have just did this from the start. I thought it may be something simple. I create a git repo to access the stripped down package (just the first cpp function and a simple R function). If you clone it with: git clone https://github.com/cdeterman/test.git And try to build

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-24 Thread Dirk Eddelbuettel
Hi Charles, I understand this is frustrating for you but we are wasting everybody's time here. Can you please prepare a minimally reproducible example? Also, maybe try some bisection. Does the problem go away after you remove bigmemory/bigalgebra? Dirk -- http://dirk.eddelbuettel.com | @edde

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-24 Thread Charles Determan Jr
Adding the #ifdef test removes the error with INT but I don't follow if you are suggesting something else for the #ifdef test? I sadly continue to see the same "length" errors once I fix the INT error in the BigMatrix.h file. Current headers: #ifdef REFBLAS #include "refblas64longlong.h" #define

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-24 Thread Dirk Eddelbuettel
On 24 February 2015 at 15:06, Charles Determan Jr wrote: | Unfortunately I get the same errors with #include last as | well as #include "bigmemory/BigMatrix.h" next to last.  The latter results in | additional errors in BigMatrix.h with the expansion of INT.  Both scenarios | still have "length p

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-24 Thread Charles Determan Jr
Unfortunately I get the same errors with #include last as well as #include "bigmemory/BigMatrix.h" next to last. The latter results in additional errors in BigMatrix.h with the expansion of INT. Both scenarios still have "length passed 4 arguments" errors. On Tue, Feb 24, 2015 at 2:51 PM, Dirk

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-24 Thread Dirk Eddelbuettel
On 24 February 2015 at 14:41, Charles Determan Jr wrote: | Thank you for that clarification, I always seem to forget that Rcpp packages | have many libraries loaded by default.  I have trimmed the headers down to the | following to just  | | #include | | However, some further background, I am w

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-24 Thread Charles Determan Jr
Thank you for that clarification, I always seem to forget that Rcpp packages have many libraries loaded by default. I have trimmed the headers down to the following to just #include However, some further background, I am working on extending the bigalgebra package (hence the interest in RcppArm

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-24 Thread William Dunlap
Do you really need the macros like GET_LENGTH that are defined in #include ? It looks like they are meant to ease porting of C code written for S or S+, but very little code these days is written for S or S+ and certainly not Rcpp code. Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Fe

Re: [Rcpp-devel] RcppArmadillo and Rdefines

2015-02-24 Thread Dirk Eddelbuettel
On 24 February 2015 at 12:30, Charles Determan Jr wrote: | Greetings, | | I have run in to an error when compiling an R package that has the following | headers in the only cpp file at the moment: | | #include | #include | #include | | #define R_NO_REMAP | | #include | #include | #include

Re: [Rcpp-devel] RcppArmadillo generates warning with arma_rng::set_seed_random()

2015-02-20 Thread Dirk Eddelbuettel
On 20 February 2015 at 13:14, terrance savitsky wrote: | When using - arma_rng::set_seed_random(), | to initialize the RNG in RcppArmadillo, the following warning is generated, | | When called from R, the RNG seed has to be set at the R level via set.seed() | | | This warning seems appropriate

Re: [Rcpp-devel] RcppArmadillo release candidate 0.4.599.1.0

2014-12-25 Thread Dirk Eddelbuettel
On 23 December 2014 at 13:16, Dirk Eddelbuettel wrote: | | Conrad is nearing an Armadillo 4.600 release, and provided a 4.599.alpha.1 | candiate which I wrapped up as 0.4.599.1.0 -- after testing on the 101 CRAN | dependents. All good. | | So if you're bored over the holidays, feel free to play

Re: [Rcpp-devel] RcppArmadillo compilation failure

2014-11-13 Thread Dirk Eddelbuettel
On 13 November 2014 at 13:24, Jon Clayden wrote: | Dear all, | | After recently updating to OS X 10.10, "Yosemite", and recompiling R | 3.1.2, I'm reinstalling various packages, but running into trouble | with RcppArmadillo. | | I configured R with | | ./configure --with-blas="-framework Accele

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-12 Thread Dirk Eddelbuettel
Hi Scott, On 13 August 2014 at 13:52, Scott Ritchie wrote: | Thanks Dirk, | | Since the original question has been answered (no there isn't a way to control | this through Armadillo or Rcpp, and the problem is unrelated), I'll go bug the One of the issue is that you start frim R when using Rcpp

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-12 Thread Scott Ritchie
Thanks Dirk, Since the original question has been answered (no there isn't a way to control this through Armadillo or Rcpp, and the problem is unrelated), I'll go bug the r-sig-hpc mailing list if I can't find a working answer. Thanks for the additional pointers, Cheers, Scott On 12 August 20

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-12 Thread Dirk Eddelbuettel
On 12 August 2014 at 17:09, Scott Ritchie wrote: | Well that's frustrating. | | I've tried the OpenMPController package without success, and tried to | explicitly disable BLAS in the Armadillo headers and removing the linking code | in the Makevars files. That is IMHO the wrong approach. You wan

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-12 Thread Scott Ritchie
Well that's frustrating. I've tried the OpenMPController package without success, and tried to explicitly disable BLAS in the Armadillo headers and removing the linking code in the Makevars files. If my reading of this thread: http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2012-June/0038

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-11 Thread Dirk Eddelbuettel
On 11 August 2014 at 19:23, Yixuan Qiu wrote: | Good point by Dirk. | | And why not just adding a line "export OPENBLAS_NUM_THREADS=1" to your .bashrc | file, or compiling OpenBlas again by setting NUM_THREADS = 1 in the | Makefile.rule? Unless you insist on it you should not need to recompile O

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-11 Thread Dirk Eddelbuettel
On 12 August 2014 at 10:04, Scott Ritchie wrote: | Thanks Dirk and Yixuan, | | I think I'm misstating the question. | | I'm developing a package which makes use of LAPACK routines through | RcppArmadillo, and I'm handling the parallelism from within R. | | At the moment it looks like I have to

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-11 Thread Scott Ritchie
Setting the environment variables within my Rcpp function using `putenv` also doesn't seem to have an effect. On 12 August 2014 10:04, Scott Ritchie wrote: > Thanks Dirk and Yixuan, > > I think I'm misstating the question. > > I'm developing a package which makes use of LAPACK routines through

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-11 Thread Scott Ritchie
Thanks Dirk and Yixuan, I think I'm misstating the question. I'm developing a package which makes use of LAPACK routines through RcppArmadillo, and I'm handling the parallelism from within R. At the moment it looks like I have to write a vignette, telling the user to monitor their CPU usage with

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-11 Thread Yixuan Qiu
Good point by Dirk. And why not just adding a line "export OPENBLAS_NUM_THREADS=1" to your .bashrc file, or compiling OpenBlas again by setting NUM_THREADS = 1 in the Makefile.rule? Best, Yixuan 2014-08-11 18:55 GMT-04:00 Dirk Eddelbuettel : > > Hi Scott, > > > On 12 August 2014 at 08:43, Sco

Re: [Rcpp-devel] RcppArmadillo BLAS/LAPACK force number of threads to 1

2014-08-11 Thread Dirk Eddelbuettel
Hi Scott, On 12 August 2014 at 08:43, Scott Ritchie wrote: | Hi Everyone, | | I'm having trouble with restricting the Armadillo function "svd_econ" to run on | a single thread. | | I am able to restrict it if I `export OPENBLAS_NUM_THREADS=1` before opening an | R session, but not from withi

Re: [Rcpp-devel] RcppArmadillo: Linking to OpenBLAS under Windows

2014-02-06 Thread Avraham Adler
On Thu, Feb 6, 2014 at 10:09 PM, Dirk Eddelbuettel wrote: > > RcppArmadillo uses whatever R uses. If you tell R to use different BLAS + > LAPACK, then RcppArmadillo will use then. Great! Unfortunately, under Windows, there is no "easy" way to feed in a different LAPACK as there is a BLAS (by foo

Re: [Rcpp-devel] RcppArmadillo: Linking to OpenBLAS under Windows

2014-02-06 Thread Dirk Eddelbuettel
On 6 February 2014 at 18:08, Avraham Adler wrote: | If I have compiled my installation of R linking to OpenBLAS so that Rblas.dll | is fast and not reference, if I install RcppArmadillo from source, will it take | advantage of that Fast Blas? RcppArmadillo uses whatever R uses. If you tell R to

Re: [Rcpp-devel] RcppArmadillo: Linking to OpenBLAS under Windows

2014-02-06 Thread Kevin Ushey
Hi Avraham, IIUC, when you install / compile RcppArmadillo, it sets the BLAS, LAPACK linker arguments based on the results of R CMD config BLAS_LIBS R CMD config LAPACK_LIBS So if you've compiled R using OpenBLAS, RcppArmadillo should also be using OpenBLAS. You can check R CMD config BL

Re: [Rcpp-devel] RcppArmadillo test release available

2013-12-05 Thread Dirk Eddelbuettel
On 3 December 2013 at 05:32, Dirk Eddelbuettel wrote: | | Conrad is getting ready for a new release 3.930 and prepared a first beta | release -- from http://arma.sf.net : | | 2013-12-03 Version 3.929.beta1 (test release) | | added size() based specifications of submatrix view sizes | a

Re: [Rcpp-devel] RcppArmadillo matrix with writeable auxiliary memory

2013-11-26 Thread Steven Varga
t;> Gesendet über den BlackBerry® Service von E-Plus. >> >> -Original Message- >> From: Steven Varga >> Sender: [email protected]: Mon, 25 Nov >> 2013 23:23:24 >> To: >> Reply-To: [email protected] >>

Re: [Rcpp-devel] RcppArmadillo matrix with writeable auxiliary memory

2013-11-26 Thread Steven Varga
23:23:24 > To: > Reply-To: [email protected] > Subject: Re: [Rcpp-devel] RcppArmadillo matrix with writeable auxiliary > memory > > ___ > Rcpp-devel mailing list > [email protected]

Re: [Rcpp-devel] RcppArmadillo matrix with writeable auxiliary memory

2013-11-26 Thread Steven Varga
Thanks a lot again; I will look at the views and see how that works out. The matrix size is not modified inside of a layer but the content only (gradient) while the optimizer outside of the instances modifies the weight matrix accoding to gradients. Storing all layers gradients and weights at one

Re: [Rcpp-devel] RcppArmadillo matrix with writeable auxiliary memory

2013-11-26 Thread Dirk Eddelbuettel
Hi Steven On 25 November 2013 at 23:23, Steven Varga wrote: | Thank you Dirk for the quick response; | and for noting the memory handling. | | I am aware of it and there are other ways of obtaining a pointer to some memory | location. I used malloc/free to put focus on arma::mat copying data du

Re: [Rcpp-devel] RcppArmadillo matrix with writeable auxiliary memory

2013-11-26 Thread szehnder
fast. Best Simon Gesendet über den BlackBerry® Service von E-Plus. -Original Message- From: Steven Varga Sender: [email protected]: Mon, 25 Nov 2013 23:23:24 To: Reply-To: [email protected] Subject: Re: [Rcpp-devel] RcppArmadillo matrix with writ

Re: [Rcpp-devel] RcppArmadillo matrix with writeable auxiliary memory

2013-11-25 Thread Steven Varga
Thank you Dirk for the quick response; and for noting the memory handling. I am aware of it and there are other ways of obtaining a pointer to some memory location. I used malloc/free to put focus on arma::mat copying data during assignment and/or not able to use reference as class member. Leaving

Re: [Rcpp-devel] RcppArmadillo matrix with writeable auxiliary memory

2013-11-25 Thread Dirk Eddelbuettel
Steven, In a case like this I would try to set up a fist minimal working example using just plain C++, and no R. Once that works, try it with R. For Armadillo, the docs at http://arma.sourceforge.net/docs.html#Mat are your best shot. I presume you saw what it says about strict=true. Also, in

Re: [Rcpp-devel] RcppArmadillo Memory Leak?

2013-11-20 Thread Dirk Eddelbuettel
On 20 November 2013 at 19:24, Alessandro Vitale wrote: | I've done the new test (dense matrix with just Rcpp NumericMatrix, no RcppArmadillo) and in this case there is no leak. | | This is the code I used | | // [[Rcpp::export]] | NumericMatrix dense_numericMatrix(NumericMatrix A){ | A(0,0

Re: [Rcpp-devel] RcppArmadillo Memory Leak?

2013-11-20 Thread Alessandro Vitale
I've done the new test (dense matrix with just Rcpp NumericMatrix, no RcppArmadillo) and in this case there is no leak. This is the code I used // [[Rcpp::export]] NumericMatrix dense_numericMatrix(NumericMatrix A){ A(0,0) = 1; A(1,0) = 2; return A ; } testMatrix <- matrix(data=0,

Re: [Rcpp-devel] RcppArmadillo Memory Leak?

2013-11-20 Thread Dirk Eddelbuettel
On 18 November 2013 at 18:16, Alessandro Vitale wrote: | Dirk, I've run the code a couple times with valgrind, one time calling sparse 5 times, the other calling sparse 10 times. | Below is the main code and valgrind output. | What do you think, could it be an Armadillo / RcppArmadillo leak? Cou

Re: [Rcpp-devel] RcppArmadillo Memory Leak?

2013-11-18 Thread Alessandro Vitale
Dirk, I've run the code a couple times with valgrind, one time calling sparse 5 times, the other calling sparse 10 times. Below is the main code and valgrind output. What do you think, could it be an Armadillo / RcppArmadillo leak? testMatrix <- Matrix(data=0,nrow=1e7,ncol=1e7,sparse=TRUE) for(

Re: [Rcpp-devel] RcppArmadillo Memory Leak?

2013-11-18 Thread Alessandro Vitale
Thanks Dirk and Hadley. Dirk, asap I will try your b) and c) suggestions. While for suggestion a), I didn't really understand how to implement it. Hadley, I am determining rsession process memory looking at osx activity monitor utility, under Real Mem column. This is what I get (I am using your

Re: [Rcpp-devel] RcppArmadillo Memory Leak?

2013-11-18 Thread Hadley Wickham
> After every call, the memory from gc() is stable, while rsession process > memory keeps growing of around 100Mb at each call and doesn't decrease after > the garbage collection. You don't mention how you're determining the size of the rsession process, but you shouldn't necessarily expect it to

Re: [Rcpp-devel] RcppArmadillo Memory Leak?

2013-11-18 Thread Dirk Eddelbuettel
On 18 November 2013 at 12:41, Alessandro Vitale wrote: | Hi, | | I was trying RcppArmadillo sparse matrix and found an odd memory behavior. | | I used this code from Romain http://stackoverflow.com/questions/18336021/ | sparse-matrix-conversion-from-matrix-to-armadillo-with-rcpparmadilloextensi

Re: [Rcpp-devel] RcppArmadillo and the version of Rcpp

2013-11-08 Thread Dirk Eddelbuettel
On 8 November 2013 at 11:04, Weldon, Mat wrote: | If it helps, I recently had similar problems. In the end I realised that I needed to update my installation of R to 3.0.2 to get RcppArmadillo to work. Update R, then update Rcpp, then RcppArmadillo should install from CRAN no problem. We gener

Re: [Rcpp-devel] RcppArmadillo and the version of Rcpp

2013-11-08 Thread Weldon, Mat
- Message: 1 Date: Fri, 8 Nov 2013 07:14:39 + From: Greg Distiller To: "[email protected]" Subject: Re: [Rcpp-devel] RcppArmadillo and the version of Rcpp Message-ID: <[email protected]

Re: [Rcpp-devel] RcppArmadillo and the version of Rcpp

2013-11-07 Thread Romain Francois
Le 08/11/2013 08:14, Greg Distiller a écrit : Hi I hope its not inappropriate for me to post this as a follow up to my problems with getting RcppArmadillo to work. I tried to compile from source using R CMD INSTALL as Dirk suggested but am getting the error message below. I don’t know if this pa

Re: [Rcpp-devel] RcppArmadillo and the version of Rcpp

2013-11-07 Thread Greg Distiller
Hi I hope its not inappropriate for me to post this as a follow up to my problems with getting RcppArmadillo to work. I tried to compile from source using R CMD INSTALL as Dirk suggested but am getting the error message below. I don't know if this particular problem is related to a small issue

Re: [Rcpp-devel] RcppArmadillo and the version of Rcpp

2013-10-24 Thread Dirk Eddelbuettel
On 24 October 2013 at 13:06, Greg Distiller wrote: | I am new to the list and new to Cpp and Rcpp. I have run into a problem when | trying to load the RcppArmadillo package. Apparently I need at least version | 0.10.5 of Rcpp and I have version 0.10.4. If I try and update this from within | RStudi

Re: [Rcpp-devel] RcppArmadillo trying to compile rcpparma_hello_world.cpp

2013-03-31 Thread Dirk Eddelbuettel
On 31 March 2013 at 22:47, Andre Mikulec wrote: | Thats good for right now. Yes. Your earlier mistake was to assume that you could do R CMD SHLIB on a file containing Rcpp and RcppArmadillo. And you cannot -- as one needs -I setting for includes, -L for libraries for Rcpp, for RcppArmadillo, et

Re: [Rcpp-devel] RcppArmadillo trying to compile rcpparma_hello_world.cpp

2013-03-31 Thread Andre Mikulec
[email protected] -------- > Date: Sun, 31 Mar 2013 09:39:41 -0500 > To: [email protected] > CC: [email protected] > Subject: Re: [Rcpp-devel] RcppArmadillo trying to compile > rcpparma_hello_world.cpp > From:

Re: [Rcpp-devel] RcppArmadillo trying to compile rcpparma_hello_world.cpp

2013-03-31 Thread Dirk Eddelbuettel
Andre, Not reproducible, and you didn't tell us - what OS and version - what compiler and version - what Rcpp version - what RcppArmadillo version etc pp. Try to redo the following at your end: R> setwd("/tmp") R> library(RcppArmadillo) R> RcppArmadillo.package.skeleton("testp

Re: [Rcpp-devel] RcppArmadillo

2013-02-03 Thread Simon Zehnder
Hi Dirk, The info about R's single-threaded heritance is very interesting. Something I haven't read about so far. The poor PhD student though! :) That must have been tough work. Regarding the OpenMP then in C++ by working with arma::mats generated via Rcpp::as<> in loops is something that will

Re: [Rcpp-devel] RcppArmadillo

2013-02-03 Thread Dirk Eddelbuettel
Hi Simon, On 3 February 2013 at 14:23, Simon Zehnder wrote: | Thanks Dirk! | | I worked a lot on it already yesterday. | | Regarding OpenMP: I haven't yet found the underlying data structure for SEXPs but there should be something in the R Internals Guide. I think you misunderstood. Let me

Re: [Rcpp-devel] RcppArmadillo

2013-02-03 Thread Simon Zehnder
Thanks Dirk! I worked a lot on it already yesterday. Regarding OpenMP: I haven't yet found the underlying data structure for SEXPs but there should be something in the R Internals Guide. As the first-touch-principle has to be applied when the memory is allocated, I would rather copy the data

Re: [Rcpp-devel] RcppArmadillo

2013-02-02 Thread Dirk Eddelbuettel
Hi Simon, Welcome to the list. On 2 February 2013 at 14:47, Simon Zehnder wrote: | Dear Rcpp-Devels, | | this list was suggested to me by Dirk Eddelbüttel in regard to a question using C++ Extensions in relation with the Armadillo library. | | At first I have to make compliments to the devel

Re: [Rcpp-devel] [RcppArmadillo] Install problem

2013-01-11 Thread Dirk Eddelbuettel
On 11 January 2013 at 13:23, Alan Coppola wrote: | Dirk, | Thanks for the quick reply. | I had found | http://grokbase.com/t/r/r-help/109fvxeb44/r-lapack-in-r-2-11-1-ubuntu-10-04-1/ With all due respect that implies an R and Ubuntu version that is two years, and four MAJOR releases each, out of d

Re: [Rcpp-devel] [RcppArmadillo] Install problem

2013-01-11 Thread Alan Coppola
Dirk, Thanks for the quick reply. I had found http://grokbase.com/t/r/r-help/109fvxeb44/r-lapack-in-r-2-11-1-ubuntu-10-04-1/oldest and did what it recommended, with your r-base-dev add-on, along with reading the FAQ. sudo apt-get update sudo apt-get remove r-base sudo apt-get remove r-base-dev

Re: [Rcpp-devel] [RcppArmadillo] Install problem

2013-01-11 Thread Dirk Eddelbuettel
On 11 January 2013 at 12:04, Alan Coppola wrote: | I've been using Rcpp for a while now, through Rstudio, and like it. | I now have the need to use RcppArmadillo, and have been trying to | install it through Rstudio. | Somehow, LAPACK_LIBS, BLAS_LIBS, and FLIBS from the Makevars file are | not g

Re: [Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Ramon Diaz-Uriarte
On Mon, 10 Dec 2012 17:06:06 +0100,Romain Francois wrote: > the .col method gives you a subview_col : >arma_inline subview_col col(const uword col_num); >arma_inline const subview_col col(const uword col_num) const; > not an umat. > The name of the class implies that it is a "

Re: [Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Romain Francois
Le 10/12/12 17:06, Romain Francois a écrit : the .col method gives you a subview_col : arma_inline subview_col col(const uword col_num); arma_inline const subview_col col(const uword col_num) const; not an umat. The name of the class implies that it is a "view" class, so a way to l

Re: [Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Romain Francois
the .col method gives you a subview_col : arma_inline subview_col col(const uword col_num); arma_inline const subview_col col(const uword col_num) const; not an umat. The name of the class implies that it is a "view" class, so a way to look a data from another class. hence, no data o

Re: [Rcpp-devel] RcppArmadillo: resize vs. insert_cols

2012-12-10 Thread Ramon Diaz-Uriarte
Hi Conrad, Thanks a lot. Understood; I'll stay away from premature optimization, then, and see if it is really needed. Best, R. On Mon, 10 Dec 2012 23:48:36 +1000,c s wrote: > Hi Ramon, > Option (b) would be more efficient, at the expense of slightly more code. > However, you can use opti

Re: [Rcpp-devel] RcppArmadillo: resize vs. insert_cols

2012-12-10 Thread c s
Hi Ramon, Option (b) would be more efficient, at the expense of slightly more code. However, you can use option (a) to quickly get something working. Once you test that your code works okay, you can always optimise it by selectively refactoring it into (b). If the code in question is not inside

Re: [Rcpp-devel] RcppArmadillo installation issue

2012-07-11 Thread c s
On Wed, Jul 11, 2012 at 5:03 AM, Vinh Nguyen wrote: >> That said, it very much looks like an issue with g++ 4.7.*. I actually made a >> small change to make it work at my end (Debian testing, g++-4.7.1). >> > > Yes, g++ 4.7.* was used... GCC versions 4.7.0 and 4.7.1 are full of bugs within the C+

Re: [Rcpp-devel] RcppArmadillo installation issue

2012-07-10 Thread Vinh Nguyen
On Tue, Jul 10, 2012 at 9:26 AM, Dirk Eddelbuettel wrote: > It would help us somewhat if you could let us know which compiler that is, eg > which compiler gets called from the mpiCC wrapper ;-) > Don't know that myself. Asking admin now. > That said, it very much looks like an issue with g++ 4

Re: [Rcpp-devel] RcppArmadillo installation issue

2012-07-10 Thread Davor Cubranic
On 2012-07-10, at 9:26 AM, Dirk Eddelbuettel wrote: > | Is my compiler not compatible with RcppArmadillo? Let me know your > | thoughts, thanks! > > It would help us somewhat if you could let us know which compiler that is, eg > which compiler gets called from the mpiCC wrapper ;-) As well as

Re: [Rcpp-devel] RcppArmadillo installation issue

2012-07-10 Thread Dirk Eddelbuettel
On 10 July 2012 at 09:00, Vinh Nguyen wrote: | Dear list, | | I'm trying to install RcppArmadillo on my school's cluster (R version | 2012-05-31 r59485). Was able to install Rcpp fine using | install.packages. However, I get the following error for Rcpp: | | > install.packages("RcppArmadillo",

Re: [Rcpp-devel] RcppArmadillo and 'trunc' problem (fixed)

2012-05-30 Thread Dirk Eddelbuettel
On 30 May 2012 at 13:11, alexios ghalanos wrote: | ok, I found the problem...somewhere in the package I had an # include | Rmath.h which once I commented out, it builds without problems. Yes, that happens -- header inclusion is complicated, and it generally just works using Rcpp.h. | Sorry

Re: [Rcpp-devel] RcppArmadillo and 'trunc' problem (fixed)

2012-05-30 Thread alexios ghalanos
ok, I found the problem...somewhere in the package I had an # include Rmath.h which once I commented out, it builds without problems. Sorry for the bother. Regards, Alexios On 30/05/2012 12:38, Dirk Eddelbuettel wrote: Hi Alexios, On 30 May 2012 at 12:00, alexios ghalanos wrote: | Hi, | |

Re: [Rcpp-devel] RcppArmadillo and 'trunc' problem

2012-05-30 Thread alexios ghalanos
Thanks Dirk. When I run it inline I have not problem: library(RcppArmadillo) library(inline) # The function draws a vector of random deviates from the multivariate # Laplace of Kotz (zero mean) given a correlation matrix R. fx <- cxxfunction( signature(R = "matrix", Z = "numeric" ) , ' Rcpp::Nu

Re: [Rcpp-devel] RcppArmadillo and 'trunc' problem

2012-05-30 Thread Dirk Eddelbuettel
Hi Alexios, On 30 May 2012 at 12:00, alexios ghalanos wrote: | Hi, | | While writing some extra functions into the rmgarch package (on r-forge) | which uses RcppArmadillo, I encountered the error relating to 'trunc' | and 'ftrunc' already discussed here: | | http://lists.r-forge.r-project.or

Re: [Rcpp-devel] RcppArmadillo solve function, dyn.load error

2012-05-06 Thread Ayn Leslie-Cook
Dirk, thank you kindly - that works just as you say. And also, thank you for all of the answers to Rcpp questions on stackoverflow and elsewhere - they've been immensely helpful throughout this project. Just about every time I have a question, you've already answered it. :) Many thanks, ayn

Re: [Rcpp-devel] RcppArmadillo solve function, dyn.load error

2012-05-06 Thread Dirk Eddelbuettel
Ayn, On 6 May 2012 at 14:38, Ayn Leslie-Cook wrote: | Hi all, | | I'm a student at the University of Washington and my course project this spring | involves rewriting the 'svmpath' R package into C++ using Rcpp and | RccpArmadillo.  Everything runs beautifully until I try to include the | funct

Re: [Rcpp-devel] RcppArmadillo -- crude benchmark of various mcmcvs rcppbugs

2012-04-30 Thread Dirk Eddelbuettel
On 30 April 2012 at 07:46, Smith, Dale wrote: | I looked at the output and found no errors. Here are my results | | > print(round(all.times.ratio,2)) | time ratio | lm0.00 0.00 Interesting. Infinite speed on Windows? I'll guess we'll all switch... Could you reprint with hig

Re: [Rcpp-devel] RcppArmadillo -- crude benchmark of various mcmcvs rcppbugs

2012-04-30 Thread Whit Armstrong
.40GHz > > Thanks, > Dale Smith, Ph.D. > Senior Financial Quantitative Analyst > Risk & Compliance > Fiserv. > 107 Technology Park > Norcross, GA 30092 > Office: 678-375-5315 > Mobile: 678-982-6599 > Mail: [email protected] > www.fiserv.com > > &

  1   2   >