[Rcpp-devel] 0.11.0 error concerning enterRNGScope

2014-02-06 Thread Gregor Kastner
Dear all,

following the update to 0.11.0, my package stochvol is broken with the
following error:

checking whether the namespace can be loaded with stated dependencies ...
WARNING Error in dyn.load(file, DLLpath = DLLpath, ...) :
function ‘enterRNGScope’ not provided by package ‘Rcpp’
Calls: loadNamespace - library.dynam - dyn.load
Execution halted

A namespace must be able to be loaded with just the base namespace
loaded: otherwise if the namespace gets loaded by a saved object, the
session will be unable to start.

Probably some imports need to be declared in the NAMESPACE file.

I tried to ask Uncle Google but did not find any suggestions of how to deal
with this error on my end of the line. Any pointers would be warmly welcome.

Thanks and best,
Gregor
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] calling and R function from rcpp and evaluation

2014-02-06 Thread Romain Francois
Hi Antonio, 

This is about how R evaluation works. Might not just be what you think it is. 

When you use Rcpp and therefore .Call things are evaluated fairly early, at 
least earlier than what would happen with R, etc … you can reproduce what R 
does by using promises. For example this work in Rcpp11: 

// [[Rcpp::export]]
RawVector rcpp_serialize(Dots dots){
  Function serialize(serialize) ;
  return serialize( dots.promise(0), R_NilValue ) ;
}

Dots has not been implemented in Rcpp, but would not be too hard to port: 
https://github.com/romainfrancois/Rcpp11/blob/master/inst/include/Rcpp/Dots.h

But it would also need to fix Rcpp’s handling of recursive promises (i.e. 
promise of a promise of a promise). 



Alternatively, for a solution based on Rcpp, you can look in dplyr. The 
.data_dots function has most of the R-level logic
https://github.com/hadley/dplyr/blob/master/R/manip-df.r

And the C++ logic is mostly in DataDots.h
https://github.com/hadley/dplyr/blob/master/inst/include/tools/DataDots.h

Romain

Le 6 févr. 2014 à 02:07, Antonio Piccolboni anto...@piccolboni.info a écrit :

 Hi,
 I was wondering why I can serialize a call such as in
 
 serialize(call(ripley), NULL) 
 [1] 58 0a 00 00 00 02 00 03 00 02 00 02 03 00 00 00 00 06 00 00 00 01 00 04 
 00 09 00 00 00 06 72 69 70 6c 65 79 00 00 00 fe
 
 but if I try from C++ the call gets evaluated
 
  library(Rcpp)
 
  rcpp.serialize = cppFunction(code=RObject my_serialize(RObject x){Function 
 r_serialize(\serialize\); return r_serialize(x, R_NilValue);})
 
  rcpp.serialize(10)
  [1] 58 0a 00 00 00 02 00 03 00 02 00 02 03 00 00 00 00 0e 00 00 00 01 40 24 
 00 00 00 00 00 00
 # easy things work
 
  rcpp.serialize(call(ripley))
 Error: could not find function ripley
 # wants to evaluate it
 
  unserialize(rcpp.serialize(call(sqrt, 2)))
 [1] 1.414214
 # How is one to serialize the call itself
 
  rcpp.serialize(list(call(ripley)))
  [1] 58 0a 00 00 00 02 00 03 00 02 00 02 03 00 00 00 00 13 00 00 00 01 00 00 
 00 06 00 00 00 01 00 04 00 09 00 00 00 06 72 69 70 6c 65 79 00 00 00 fe
 #wrapping in a list is enough to stop evaluation
 
  eval(call(ripley))
 Error in eval(expr, envir, enclos) : could not find function ripley
  eval(list(call(ripley)))
 [[1]]
 ripley()
 
 #OK that's consistent
 
 
 Could anyone enlighten me on the evaluation mechanism? Not saying it's 
 broken, but certainly my expectations were off. Thanks
 
 
 Antonio
 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] 0.11.0 error concerning enterRNGScope

2014-02-06 Thread Gregor Kastner
Hi again,

I am afraid my email got sent in error. I composed it a few days ago but this
issue was already discussed yesterday on this list:

[Rcpp-devel] dataptr / char_get_string_elt not provided by package ‘Rcpp’

I am sorry for any inconvenience caused.

Best,
Gregor

On Thu, 6 Feb 2014 11:55:52 +0100
Gregor Kastner gregor.kast...@wu.ac.at wrote:

 Dear all,
 
 following the update to 0.11.0, my package stochvol is broken with the
 following error:
 
 checking whether the namespace can be loaded with stated dependencies ...
 WARNING Error in dyn.load(file, DLLpath = DLLpath, ...) :
 function ‘enterRNGScope’ not provided by package ‘Rcpp’
 Calls: loadNamespace - library.dynam - dyn.load
 Execution halted
 
 A namespace must be able to be loaded with just the base namespace
 loaded: otherwise if the namespace gets loaded by a saved object, the
 session will be unable to start.
 
 Probably some imports need to be declared in the NAMESPACE file.
 
 I tried to ask Uncle Google but did not find any suggestions of how to deal
 with this error on my end of the line. Any pointers would be warmly welcome.
 
 Thanks and best,
 Gregor
 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

[Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Steffen Neumann
Hi list,

I am having issues to build Rdisop on Mac (to which I have no access)
after the upgrade to Rcpp 0.11.0 / RcppClassic 0.9.5, on both 

http://bioconductor.org/checkResults/2.13/bioc-LATEST/Rdisop/perceval-buildsrc.html
http://bioconductor.org/checkResults/2.14/bioc-LATEST/Rdisop/petty-buildsrc.html

with the same error message. Somehow the typeinfo for Rcpp::RObject
is not found in the shared library:

Symbol not found: __ZTIN4Rcpp7RObjectE (typeinfo for Rcpp::RObject)
Expected in: flat namespace

Any idea how to get back it in there ? This sounds similar 
to [1] and [2] and would hint that someone 
(R ? BioC build farm ?) needs to set (at compile time[3])

export REQUIRES_RTTI=1

Thanks in advance,
Yours,
Steffen

[1] https://github.com/llvmpy/llvmpy/issues/50
[2] 
http://stackoverflow.com/questions/9058594/building-and-running-llvm-py-on-mac-os-x
[3] http://llvm.org/docs/Packaging.html#c-features


The system is petty:
http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-NodeInfo.html
with Mac OS X Snow Leopard (10.6.8), 
R Under development (unstable) (2014-01-15 r64790) -- Unsuffered Consequences 
and llvm-g++-4.2 compiler.

Installed packages here are:
http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-R-instpkgs.html
Rcpp0.11.0 3.1.0
RcppClassic  0.9.5 3.1.0


[Don't mind the windows build failure, that comes next, 
 but it only happens on one machine so it works somewhere.]


** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object 
‘/private/tmp/RtmpoagsNv/Rinst13f9973b0c29a/Rdisop/libs/Rdisop.so’:
  dlopen(/private/tmp/RtmpoagsNv/Rinst13f9973b0c29a/Rdisop/libs/Rdisop.so, 6): 
Symbol not found: __ZTIN4Rcpp7RObjectE
  Referenced from: 
/private/tmp/RtmpoagsNv/Rinst13f9973b0c29a/Rdisop/libs/Rdisop.so
  Expected in: flat namespace
 in /private/tmp/RtmpoagsNv/Rinst13f9973b0c29a/Rdisop/libs/Rdisop.so
Error: loading failed


echo __ZTIN4Rcpp7RObjectE | c++filt -s auto -t  -_
typeinfo for Rcpp::RObject


-- 
IPB HalleAG Massenspektrometrie  Bioinformatik
Dr. Steffen Neumann  http://www.IPB-Halle.DE
Weinberg 3   http://msbi.bic-gh.de
06120 Halle  Tel. +49 (0) 345 5582 - 1470
  +49 (0) 345 5582 - 0
sneumann(at)IPB-Halle.DE Fax. +49 (0) 345 5582 - 1409


___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

[Rcpp-devel] xts inputs and outputs for Rcpp translation

2014-02-06 Thread Hideyoshi Maeda
Hello I am new to Rcpp, and am looking to translate some for loops in R to C++ 
using Rcpp, but I am sort of stuck at the first hurdle, as the simple tutorials 
do not really seem to deal with xts structures.

The closest I found for some help online was found here 
(http://gallery.rcpp.org/articles/accessing-xts-api/) but that seems to only 
give xts outputs rather than taking in xts inputs. Below is a mock example of R 
code that has a function and takes an xts object as an input and gives an xts 
object as an output.

toy.xts - function(xtsobj,val.vec){
  xtsobj1 - xtsobj
  for(i in 1:nrow(xtsobj1)){
if((i %/% 3)==3 ){
  xtsobj1[i,B] - val.vec[1]
} else {
  xtsobj1[i,c(C,D)] - val.vec+1
}
  }
  xtsobj1
}

tmp.xts - xts(matrix(c(1:500),ncol=5),Sys.Date()-c(1:100))
colnames(tmp.xts) - LETTERS[1:5]
tmp.vec - c(0.4,0.9)
toy.xts(tmp.xts,tmp.vec)

I know that this isn’t exactly the use case for converting R code, to C++, but 
I’m not too sure where to start when dealing with these different/non-simple 
structures as inputs. Apologies if this is very simple. 

Would the RcppXts packages help at all? It doesn’t seem to have a huge number 
of functions, and am not too sure how to use it?

Thanks in advance

HLM___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] xts inputs and outputs for Rcpp translation

2014-02-06 Thread Darren Cook
 The closest I found for some help online was found here
 (http://gallery.rcpp.org/articles/accessing-xts-api/) but that seems
 to only give xts outputs rather than taking in xts inputs. 

I think the key point being shown there is that an xts object is just a
NumericMatrix with a few attributes attached.  (Or a NumericVector if it
is a single-column xts object.)

If you've never poked around in xts internals this is probably going to
be a bit painful ;-)

Darren



-- 
Darren Cook, Software Researcher/Developer

http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] xts inputs and outputs for Rcpp translation

2014-02-06 Thread Hideyoshi Maeda
I was aware that an xts object is just a NumericMatrix with a few attributes 
and index attached, but was wondering if anybody could please give me a 
walkthrough example to show me how its done with some thing that has more than 
one column and also how one goes about subsetting columns of the xts 
object/matrix etc.

any help as always would be greatly appreciated.

Thanks

HLM

On 6 Feb 2014, at 13:15, Darren Cook dar...@dcook.org wrote:

 The closest I found for some help online was found here
 (http://gallery.rcpp.org/articles/accessing-xts-api/) but that seems
 to only give xts outputs rather than taking in xts inputs. 
 
 I think the key point being shown there is that an xts object is just a
 NumericMatrix with a few attributes attached.  (Or a NumericVector if it
 is a single-column xts object.)
 
 If you've never poked around in xts internals this is probably going to
 be a bit painful ;-)
 
 Darren
 
 
 
 -- 
 Darren Cook, Software Researcher/Developer
 
 http://dcook.org/work/ (About me and my work)
 http://dcook.org/blogs.html (My blogs and articles)
 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Dirk Eddelbuettel

On 6 February 2014 at 13:05, Steffen Neumann wrote:
| Hi list,
| 
| I am having issues to build Rdisop on Mac (to which I have no access)
| after the upgrade to Rcpp 0.11.0 / RcppClassic 0.9.5, on both 
| 
| 
http://bioconductor.org/checkResults/2.13/bioc-LATEST/Rdisop/perceval-buildsrc.html
| 
http://bioconductor.org/checkResults/2.14/bioc-LATEST/Rdisop/petty-buildsrc.html
| 
| with the same error message. Somehow the typeinfo for Rcpp::RObject
| is not found in the shared library:
| 
|   Symbol not found: __ZTIN4Rcpp7RObjectE (typeinfo for Rcpp::RObject)
|   Expected in: flat namespace
| 
| Any idea how to get back it in there ? This sounds similar 
| to [1] and [2] and would hint that someone 
| (R ? BioC build farm ?) needs to set (at compile time[3])
| 
|   export REQUIRES_RTTI=1

Weird. If it is on the Mac, is that with g++-4.2 or with clang ?

Dirk
 
| Thanks in advance,
| Yours,
| Steffen
| 
| [1] https://github.com/llvmpy/llvmpy/issues/50
| [2] 
http://stackoverflow.com/questions/9058594/building-and-running-llvm-py-on-mac-os-x
| [3] http://llvm.org/docs/Packaging.html#c-features
| 
| 
| The system is petty:
| http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-NodeInfo.html
| with Mac OS X Snow Leopard (10.6.8), 
| R Under development (unstable) (2014-01-15 r64790) -- Unsuffered 
Consequences 
| and llvm-g++-4.2 compiler.
| 
| Installed packages here are:
| http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-R-instpkgs.html
| Rcpp0.11.0 3.1.0
| RcppClassic  0.9.5 3.1.0
| 
| 
| [Don't mind the windows build failure, that comes next, 
|  but it only happens on one machine so it works somewhere.]
| 
| 
| ** testing if installed package can be loaded
| Error in dyn.load(file, DLLpath = DLLpath, ...) : 
|   unable to load shared object 
‘/private/tmp/RtmpoagsNv/Rinst13f9973b0c29a/Rdisop/libs/Rdisop.so’:
|   dlopen(/private/tmp/RtmpoagsNv/Rinst13f9973b0c29a/Rdisop/libs/Rdisop.so, 
6): Symbol not found: __ZTIN4Rcpp7RObjectE
|   Referenced from: 
/private/tmp/RtmpoagsNv/Rinst13f9973b0c29a/Rdisop/libs/Rdisop.so
|   Expected in: flat namespace
|  in /private/tmp/RtmpoagsNv/Rinst13f9973b0c29a/Rdisop/libs/Rdisop.so
| Error: loading failed
| 
| 
| echo __ZTIN4Rcpp7RObjectE | c++filt -s auto -t  -_
| typeinfo for Rcpp::RObject
| 
| 
| -- 
| IPB HalleAG Massenspektrometrie  Bioinformatik
| Dr. Steffen Neumann  http://www.IPB-Halle.DE
| Weinberg 3   http://msbi.bic-gh.de
| 06120 Halle  Tel. +49 (0) 345 5582 - 1470
|   +49 (0) 345 5582 - 0
| sneumann(at)IPB-Halle.DE Fax. +49 (0) 345 5582 - 1409
| 
| 
| ___
| Rcpp-devel mailing list
| Rcpp-devel@lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] xts inputs and outputs for Rcpp translation

2014-02-06 Thread Dirk Eddelbuettel

On 6 February 2014 at 13:29, Hideyoshi Maeda wrote:
| I was aware that an xts object is just a NumericMatrix with a few attributes 
and index attached, but was wondering if anybody could please give me a 
walkthrough example to show me how its done with some thing that has more than 
one column and also how one goes about subsetting columns of the xts 
object/matrix etc.
| 
| any help as always would be greatly appreciated.

i)   Pass down the xts as a SEXP to your C++ function.

ii)  Instantiate a NumericMatrix from the SEXP. That would be equivalent 
 to coredata(myXtsObject)

iii) Pick of the attribute for the time index and instantiate a
 NumericMatrix.  That would be equivalent to as.numeric(index(myXtsObject)

If all that fails, separate the xts in R into coredata() and index() before
passing things down, and take it from there.  

You can probably also combine i) and ii), my suggestion is untested. 

Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] xts inputs and outputs for Rcpp translation

2014-02-06 Thread Dirk Eddelbuettel

On 6 February 2014 at 13:54, Hideyoshi Maeda wrote:
| Furthermore, when trying to compile the function createXts(), by coping and
| pasting it into a file, and then Rcpp::sourceCpp(‘file.cpp’), given in the
| link (http://gallery.rcpp.org/articles/accessing-xts-api/), it provides the
| following error…
| 
| Error in 
dyn.load(/var/folders/cj/d05h2g2938q7yb5rhp9rwx80gn/T//RtmpjfmSg9
| /sourcecpp_157729b6a1bf/sourceCpp_33663.so) : 
|   unable to load shared object 
'/var/folders/cj/d05h2g2938q7yb5rhp9rwx80gn/
| T//RtmpjfmSg9/sourcecpp_157729b6a1bf/sourceCpp_33663.so':
|   dlopen(/var/folders/cj/d05h2g2938q7yb5rhp9rwx80gn/T//RtmpjfmSg9/
| sourcecpp_157729b6a1bf/sourceCpp_33663.so, 6): Symbol not found:
| 
__ZNK4Rcpp7RObject4attrERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIc
|   Referenced from: 
/var/folders/cj/d05h2g2938q7yb5rhp9rwx80gn/T//RtmpjfmSg9
| /sourcecpp_157729b6a1bf/sourceCpp_33663.so
|   Expected in: flat namespace
|  in /var/folders/cj/d05h2g2938q7yb5rhp9rwx80gn/T//RtmpjfmSg9/
| sourcecpp_157729b6a1bf/sourceCpp_33663.so
| 
| Does anybody else get this?

Nope. Works fine here. If you're on a Mac, you may need to rebuild Rcpp
itself from source.

My quick check below

Dirk

R 
sourceCpp(~/git/rcpp-gallery/src/2013-01-12-getting-attributes-for-xts-example.cpp)

R   suppressMessages(library(xts))

R   set.seed(42)

R   n - 20

R   Z - xts(100+cumsum(rnorm(n)), order.by=ISOdatetime(2013,1,12,20,21,22) + 
60*(1:n))

R   xtsAttributes(Z)
[1] dim index   class   .indexCLASS tclass  
.indexTZtzone  

R   names(attributes(Z))
[1] dim index   class   .indexCLASS tclass  
.indexTZtzone  

R   all.equal(xtsAttributes(Z), names(attributes(Z)))
[1] TRUE

R   xtsIndex(Z)
 [1] 2013-01-12 20:22:22 CST 2013-01-12 20:23:22 CST 2013-01-12 20:24:22 
CST 2013-01-12 20:25:22 CST 2013-01-12 20:26:22 CST
 [6] 2013-01-12 20:27:22 CST 2013-01-12 20:28:22 CST 2013-01-12 20:29:22 
CST 2013-01-12 20:30:22 CST 2013-01-12 20:31:22 CST
[11] 2013-01-12 20:32:22 CST 2013-01-12 20:33:22 CST 2013-01-12 20:34:22 
CST 2013-01-12 20:35:22 CST 2013-01-12 20:36:22 CST
[16] 2013-01-12 20:37:22 CST 2013-01-12 20:38:22 CST 2013-01-12 20:39:22 
CST 2013-01-12 20:40:22 CST 2013-01-12 20:41:22 CST
R 

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Steffen Neumann
Hi,

On Thu, 2014-02-06 at 07:54 -0600, Dirk Eddelbuettel wrote:
...
 Weird. If it is on the Mac, is that with g++-4.2 or with clang ?
...
 | and llvm-g++-4.2 compiler.

I don't know the terminology in llvm land, 
the BioC system information page says llvm-g++-4.2,
and there is more about the build environment on 

 | http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-NodeInfo.html

Did that help ? Otherwise we need input from Dan or Kevin.

Yours,
Steffen


-- 
IPB HalleAG Massenspektrometrie  Bioinformatik
Dr. Steffen Neumann  http://www.IPB-Halle.DE
Weinberg 3   http://msbi.bic-gh.de
06120 Halle  Tel. +49 (0) 345 5582 - 1470
  +49 (0) 345 5582 - 0
sneumann(at)IPB-Halle.DE Fax. +49 (0) 345 5582 - 1409

___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Dirk Eddelbuettel

On 6 February 2014 at 15:15, Steffen Neumann wrote:
| Hi,
| 
| On Thu, 2014-02-06 at 07:54 -0600, Dirk Eddelbuettel wrote:
| ...
|  Weird. If it is on the Mac, is that with g++-4.2 or with clang ?
| ...
|  | and llvm-g++-4.2 compiler.
| 
| I don't know the terminology in llvm land, 
| the BioC system information page says llvm-g++-4.2,
| and there is more about the build environment on 

That's the old standard compiler that Simon still builds R with too.  I would
not know why it suddenly needs an RTTI switch.

Dirk
 
|  | http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-NodeInfo.html
| 
| Did that help ? Otherwise we need input from Dan or Kevin.
| 
| Yours,
| Steffen
| 
| 
| -- 
| IPB HalleAG Massenspektrometrie  Bioinformatik
| Dr. Steffen Neumann  http://www.IPB-Halle.DE
| Weinberg 3   http://msbi.bic-gh.de
| 06120 Halle  Tel. +49 (0) 345 5582 - 1470
|   +49 (0) 345 5582 - 0
| sneumann(at)IPB-Halle.DE Fax. +49 (0) 345 5582 - 1409
| 

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] 0.11.0 error concerning enterRNGScope

2014-02-06 Thread Avraham Adler
You probably have the same issues some of has as well due to the change in
importing and libraries. Please see this thread: 
http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2014-February/007120.html


Avraham


On Thu, Feb 6, 2014 at 6:50 AM, Gregor Kastner gregor.kast...@wu.ac.atwrote:

 Hi again,

 I am afraid my email got sent in error. I composed it a few days ago but
 this
 issue was already discussed yesterday on this list:

 [Rcpp-devel] dataptr / char_get_string_elt not provided by package 'Rcpp'

 I am sorry for any inconvenience caused.

 Best,
 Gregor

 On Thu, 6 Feb 2014 11:55:52 +0100
 Gregor Kastner gregor.kast...@wu.ac.at wrote:

  Dear all,
 
  following the update to 0.11.0, my package stochvol is broken with the
  following error:
 
  checking whether the namespace can be loaded with stated dependencies ...
  WARNING Error in dyn.load(file, DLLpath = DLLpath, ...) :
  function 'enterRNGScope' not provided by package 'Rcpp'
  Calls: loadNamespace - library.dynam - dyn.load
  Execution halted
 
  A namespace must be able to be loaded with just the base namespace
  loaded: otherwise if the namespace gets loaded by a saved object, the
  session will be unable to start.
 
  Probably some imports need to be declared in the NAMESPACE file.
 
  I tried to ask Uncle Google but did not find any suggestions of how to
 deal
  with this error on my end of the line. Any pointers would be warmly
 welcome.
 
  Thanks and best,
  Gregor
  ___
  Rcpp-devel mailing list
  Rcpp-devel@lists.r-forge.r-project.org
  https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

[Rcpp-devel] cbind column(s) or rbind row(s) to a NumericMatrix

2014-02-06 Thread Hideyoshi Maeda
Is there a way to cbind column(s) or rbind row(s) to a NumericMatrix in Rcpp?

I have made a NumericVector that is the same length as the number of rows of a 
NumericMatrix, and was wondering how to (c)bind them together.

Thanks

HLM
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] cbind column(s) or rbind row(s) to a NumericMatrix

2014-02-06 Thread Søren Højsgaard
I don't think there is a cbind-equivalent in Rcpp, but you can do

cbind1 - cppFunction(NumericMatrix cbind1 (NumericVector x, NumericVector y){
  NumericMatrix out (x.size(), 2);
  out(_,0) = x; out(_,1)=y;
  return out;
})

cbind1(1:5, 2:6)

 [,1] [,2]
[1,]12
[2,]23
[3,]34
[4,]45
[5,]56

regards
Søren

-Original Message-
From: rcpp-devel-boun...@lists.r-forge.r-project.org 
[mailto:rcpp-devel-boun...@lists.r-forge.r-project.org] On Behalf Of Hideyoshi 
Maeda
Sent: 6. februar 2014 18:13
To: rcpp-devel@lists.r-forge.r-project.org
Subject: [Rcpp-devel] cbind column(s) or rbind row(s) to a NumericMatrix

Is there a way to cbind column(s) or rbind row(s) to a NumericMatrix in Rcpp?

I have made a NumericVector that is the same length as the number of rows of a 
NumericMatrix, and was wondering how to (c)bind them together.

Thanks

HLM
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Segfault in using RInside

2014-02-06 Thread Kevin Ushey
Hi Jiqiang,

Thanks for reporting this. I pushed a couple fixes to RInside and they
are available on GitHub at

https://github.com/eddelbuettel/rinside

Cheers,
Kevin

On Tue, Feb 4, 2014 at 8:09 PM, Dirk Eddelbuettel e...@debian.org wrote:

 With one follow-up off-list (where Jiqiang notes that he had in fact rebuilt
 RInside) and a quick test here, I have to conclude that RInside appears to be
 a casualty of the recent change. Darn.

 (gdb) backtrace
 #0  0x7799bd52 in Rf_isNull (s=0x0) at memory.c:3378
 #1  0x7767fa9d in Rcpp_ReplaceObject (y=0x0, x=0x0) at 
 /usr/local/lib/R/site-library/Rcpp/include/RcppCommon.h:107
 #2  set__ (x=0x0, this=0x7fffe168) at 
 /usr/local/lib/R/site-library/Rcpp/include/Rcpp/storage/PreserveStorage.h:18
 #3  Environment_Impl (this=0x7fffe168) at 
 /usr/local/lib/R/site-library/Rcpp/include/Rcpp/Environment.h:46
 #4  RInside::RInside (this=0x7fffe160, argc=1, argv=0x7fffe278, 
 loadRcpp=optimized out, verbose=optimized out, interactive=optimized 
 out)
 at RInside.cpp:91
 #5  0x00402a00 in main (argc=optimized out, argv=optimized out) 
 at rinside_sample0.cpp:14
 (gdb)

 Looks like RInside does not quite mesh with the reorganisation of the Rcpp
 internals.

 Sorry,  Dirk

 --
 Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Kevin Ushey
Apparently this is moot now, because it looks like Rdisop now builds
successfully on BioC for all systems:
http://bioconductor.org/checkResults/2.14/bioc-LATEST/Rdisop/petty-buildsrc.html,
http://bioconductor.org/checkResults/2.13/bioc-LATEST/Rdisop/perceval-buildsrc.html.

Did you have to change something in your package, or was it related to
the BioC build system?

Thanks,
Kevin

On Thu, Feb 6, 2014 at 10:41 AM, Kevin Ushey kevinus...@gmail.com wrote:
 I wonder if the 'typeid' error could be a red herring and the real
 cause could be somehow related to virtual functions. If the compiler
 didn't know what 'typeid' meant (ie, had no RTTI) it would have failed
 on compilation, not linking, no? E.g.:
 http://stackoverflow.com/questions/307352/g-undefined-reference-to-typeinfo

 I'll try to see if I can figure something out.

 -Kevin

 On Thu, Feb 6, 2014 at 6:34 AM, Dirk Eddelbuettel e...@debian.org wrote:

 On 6 February 2014 at 15:15, Steffen Neumann wrote:
 | Hi,
 |
 | On Thu, 2014-02-06 at 07:54 -0600, Dirk Eddelbuettel wrote:
 | ...
 |  Weird. If it is on the Mac, is that with g++-4.2 or with clang ?
 | ...
 |  | and llvm-g++-4.2 compiler.
 |
 | I don't know the terminology in llvm land,
 | the BioC system information page says llvm-g++-4.2,
 | and there is more about the build environment on

 That's the old standard compiler that Simon still builds R with too.  I would
 not know why it suddenly needs an RTTI switch.

 Dirk

 |  | 
 http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-NodeInfo.html
 |
 | Did that help ? Otherwise we need input from Dan or Kevin.
 |
 | Yours,
 | Steffen
 |
 |
 | --
 | IPB HalleAG Massenspektrometrie  Bioinformatik
 | Dr. Steffen Neumann  http://www.IPB-Halle.DE
 | Weinberg 3   http://msbi.bic-gh.de
 | 06120 Halle  Tel. +49 (0) 345 5582 - 1470
 |   +49 (0) 345 5582 - 0
 | sneumann(at)IPB-Halle.DE Fax. +49 (0) 345 5582 - 1409
 |

 --
 Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Kevin Ushey
I wonder if the 'typeid' error could be a red herring and the real
cause could be somehow related to virtual functions. If the compiler
didn't know what 'typeid' meant (ie, had no RTTI) it would have failed
on compilation, not linking, no? E.g.:
http://stackoverflow.com/questions/307352/g-undefined-reference-to-typeinfo

I'll try to see if I can figure something out.

-Kevin

On Thu, Feb 6, 2014 at 6:34 AM, Dirk Eddelbuettel e...@debian.org wrote:

 On 6 February 2014 at 15:15, Steffen Neumann wrote:
 | Hi,
 |
 | On Thu, 2014-02-06 at 07:54 -0600, Dirk Eddelbuettel wrote:
 | ...
 |  Weird. If it is on the Mac, is that with g++-4.2 or with clang ?
 | ...
 |  | and llvm-g++-4.2 compiler.
 |
 | I don't know the terminology in llvm land,
 | the BioC system information page says llvm-g++-4.2,
 | and there is more about the build environment on

 That's the old standard compiler that Simon still builds R with too.  I would
 not know why it suddenly needs an RTTI switch.

 Dirk

 |  | 
 http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-NodeInfo.html
 |
 | Did that help ? Otherwise we need input from Dan or Kevin.
 |
 | Yours,
 | Steffen
 |
 |
 | --
 | IPB HalleAG Massenspektrometrie  Bioinformatik
 | Dr. Steffen Neumann  http://www.IPB-Halle.DE
 | Weinberg 3   http://msbi.bic-gh.de
 | 06120 Halle  Tel. +49 (0) 345 5582 - 1470
 |   +49 (0) 345 5582 - 0
 | sneumann(at)IPB-Halle.DE Fax. +49 (0) 345 5582 - 1409
 |

 --
 Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Dan Tenenbaum


- Original Message -
 From: Kevin Ushey kevinus...@gmail.com
 To: Dirk Eddelbuettel e...@debian.org
 Cc: rcpp-devel@lists.r-forge.r-project.org
 Sent: Thursday, February 6, 2014 10:43:25 AM
 Subject: Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject 
 for Rdisop on Mac after Rcpp/RcppClassic
 update
 
 Apparently this is moot now, because it looks like Rdisop now builds
 successfully on BioC for all systems:
 http://bioconductor.org/checkResults/2.14/bioc-LATEST/Rdisop/petty-buildsrc.html,
 http://bioconductor.org/checkResults/2.13/bioc-LATEST/Rdisop/perceval-buildsrc.html.
 
 Did you have to change something in your package, or was it related
 to
 the BioC build system?
 

The build system was pulling down a binary version of RcppClassic but it needs 
to be built from source.

Dan



 Thanks,
 Kevin
 
 On Thu, Feb 6, 2014 at 10:41 AM, Kevin Ushey kevinus...@gmail.com
 wrote:
  I wonder if the 'typeid' error could be a red herring and the real
  cause could be somehow related to virtual functions. If the
  compiler
  didn't know what 'typeid' meant (ie, had no RTTI) it would have
  failed
  on compilation, not linking, no? E.g.:
  http://stackoverflow.com/questions/307352/g-undefined-reference-to-typeinfo
 
  I'll try to see if I can figure something out.
 
  -Kevin
 
  On Thu, Feb 6, 2014 at 6:34 AM, Dirk Eddelbuettel e...@debian.org
  wrote:
 
  On 6 February 2014 at 15:15, Steffen Neumann wrote:
  | Hi,
  |
  | On Thu, 2014-02-06 at 07:54 -0600, Dirk Eddelbuettel wrote:
  | ...
  |  Weird. If it is on the Mac, is that with g++-4.2 or with clang
  |  ?
  | ...
  |  | and llvm-g++-4.2 compiler.
  |
  | I don't know the terminology in llvm land,
  | the BioC system information page says llvm-g++-4.2,
  | and there is more about the build environment on
 
  That's the old standard compiler that Simon still builds R with
  too.  I would
  not know why it suddenly needs an RTTI switch.
 
  Dirk
 
  |  | 
  http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-NodeInfo.html
  |
  | Did that help ? Otherwise we need input from Dan or Kevin.
  |
  | Yours,
  | Steffen
  |
  |
  | --
  | IPB HalleAG Massenspektrometrie 
  | Bioinformatik
  | Dr. Steffen Neumann  http://www.IPB-Halle.DE
  | Weinberg 3   http://msbi.bic-gh.de
  | 06120 Halle  Tel. +49 (0) 345 5582 - 1470
  |   +49 (0) 345 5582 - 0
  | sneumann(at)IPB-Halle.DE Fax. +49 (0) 345 5582 - 1409
  |
 
  --
  Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
  ___
  Rcpp-devel mailing list
  Rcpp-devel@lists.r-forge.r-project.org
  https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
 
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Dan Tenenbaum


- Original Message -
 From: Dan Tenenbaum dtene...@fhcrc.org
 To: Kevin Ushey kevinus...@gmail.com
 Cc: rcpp-devel@lists.r-forge.r-project.org
 Sent: Thursday, February 6, 2014 10:49:29 AM
 Subject: Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject 
 for Rdisop on Mac after Rcpp/RcppClassic
 update
 
 
 
 - Original Message -
  From: Kevin Ushey kevinus...@gmail.com
  To: Dirk Eddelbuettel e...@debian.org
  Cc: rcpp-devel@lists.r-forge.r-project.org
  Sent: Thursday, February 6, 2014 10:43:25 AM
  Subject: Re: [Rcpp-devel] Undefined Reference to typeinfo for
  Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic
  update
  
  Apparently this is moot now, because it looks like Rdisop now
  builds
  successfully on BioC for all systems:
  http://bioconductor.org/checkResults/2.14/bioc-LATEST/Rdisop/petty-buildsrc.html,
  http://bioconductor.org/checkResults/2.13/bioc-LATEST/Rdisop/perceval-buildsrc.html.
  
  Did you have to change something in your package, or was it related
  to
  the BioC build system?
  
 
 The build system was pulling down a binary version of RcppClassic but
 it needs to be built from source.
 

Probably RcppCLassic needs a version bump? It was last updated 1/26, before the 
Rcpp update.

Dan


 Dan
 
 
 
  Thanks,
  Kevin
  
  On Thu, Feb 6, 2014 at 10:41 AM, Kevin Ushey kevinus...@gmail.com
  wrote:
   I wonder if the 'typeid' error could be a red herring and the
   real
   cause could be somehow related to virtual functions. If the
   compiler
   didn't know what 'typeid' meant (ie, had no RTTI) it would have
   failed
   on compilation, not linking, no? E.g.:
   http://stackoverflow.com/questions/307352/g-undefined-reference-to-typeinfo
  
   I'll try to see if I can figure something out.
  
   -Kevin
  
   On Thu, Feb 6, 2014 at 6:34 AM, Dirk Eddelbuettel
   e...@debian.org
   wrote:
  
   On 6 February 2014 at 15:15, Steffen Neumann wrote:
   | Hi,
   |
   | On Thu, 2014-02-06 at 07:54 -0600, Dirk Eddelbuettel wrote:
   | ...
   |  Weird. If it is on the Mac, is that with g++-4.2 or with
   |  clang
   |  ?
   | ...
   |  | and llvm-g++-4.2 compiler.
   |
   | I don't know the terminology in llvm land,
   | the BioC system information page says llvm-g++-4.2,
   | and there is more about the build environment on
  
   That's the old standard compiler that Simon still builds R with
   too.  I would
   not know why it suddenly needs an RTTI switch.
  
   Dirk
  
   |  | 
   http://bioconductor.org/checkResults/2.14/bioc-LATEST/petty-NodeInfo.html
   |
   | Did that help ? Otherwise we need input from Dan or Kevin.
   |
   | Yours,
   | Steffen
   |
   |
   | --
   | IPB HalleAG Massenspektrometrie 
   | Bioinformatik
   | Dr. Steffen Neumann  http://www.IPB-Halle.DE
   | Weinberg 3   http://msbi.bic-gh.de
   | 06120 Halle  Tel. +49 (0) 345 5582 - 1470
   |   +49 (0) 345 5582 - 0
   | sneumann(at)IPB-Halle.DE Fax. +49 (0) 345 5582 - 1409
   |
  
   --
   Dirk Eddelbuettel | e...@debian.org |
   http://dirk.eddelbuettel.com
   ___
   Rcpp-devel mailing list
   Rcpp-devel@lists.r-forge.r-project.org
   https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
  ___
  Rcpp-devel mailing list
  Rcpp-devel@lists.r-forge.r-project.org
  https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
  
 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
 
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Dirk Eddelbuettel

On 6 February 2014 at 10:49, Dan Tenenbaum wrote:
| The build system was pulling down a binary version of RcppClassic but it 
needs to be built from source.

*Every* package built against Rcpp needs to be rebuilt this time.

*Every* one.  See the release notes.


On 6 February 2014 at 11:28, Dan Tenenbaum wrote:
| Probably RcppCLassic needs a version bump? It was last updated 1/26, before 
the Rcpp update.

That *was* a pre-release built, but I didn't add (didn't need?)
importFrom(Rcpp, evalCpp). If it needs a fix we'll make a release, but it has
not yet been determined that it needs fix.

But *every* reverse dependency of Rcpp does not a rebuild this time.
We're sorry for the inconvenience but we were also very clear and upfront
about it.

Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Dan Tenenbaum


- Original Message -
 From: Dirk Eddelbuettel e...@debian.org
 To: Dan Tenenbaum dtene...@fhcrc.org
 Cc: Kevin Ushey kevinus...@gmail.com, 
 rcpp-devel@lists.r-forge.r-project.org, Dirk Eddelbuettel
 e...@debian.org
 Sent: Thursday, February 6, 2014 11:56:47 AM
 Subject: Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject 
 for Rdisop on Mac after Rcpp/RcppClassic
 update
 
 
 On 6 February 2014 at 10:49, Dan Tenenbaum wrote:
 | The build system was pulling down a binary version of RcppClassic
 | but it needs to be built from source.
 
 *Every* package built against Rcpp needs to be rebuilt this time.
 
 *Every* one.  See the release notes.
 
 
 On 6 February 2014 at 11:28, Dan Tenenbaum wrote:
 | Probably RcppCLassic needs a version bump? It was last updated
 | 1/26, before the Rcpp update.
 
 That *was* a pre-release built, but I didn't add (didn't need?)
 importFrom(Rcpp, evalCpp). If it needs a fix we'll make a release,
 but it has
 not yet been determined that it needs fix.
 
 But *every* reverse dependency of Rcpp does not a rebuild this time.
 We're sorry for the inconvenience but we were also very clear and
 upfront
 about it.
 


If every reverse dependency of Rcpp needs a rebuild, and that includes 
RcppClassic, does it not follow that RcppClassic needs a rebuild on CRAN? 
Otherwise Mac or windows users without compilers are out of luck.

Dan





 Dirk
 
 --
 Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
 
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


[Rcpp-devel] RcppArmadillo: Solving triangular system using trimatu

2014-02-06 Thread Søren Højsgaard
Dear all,

Consider solving Ax=b. According to the Armadillo docs it is so that if we know 
that A is upper triangular then declaring this should lead to a faster 
solution, i.e. (my understanding)
  
  solve( trimatu(A), b )

should be faster than

  solve( A, b )

My limited experience is that this is not the case (I have tried where A is 
14x14). I have read (SO) that Armadillo does not have proper forward/backward 
substitution implemented, so I am not sure what declaring trimatu(A) should do 
when solving linear equations.

Does anyone have any insight on these issues? 

Thanks in advance
Søren
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


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

2014-02-06 Thread Avraham Adler
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?

Thank you,

Avraham
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

[Rcpp-devel] Profiling Rcpp compiled through sourceCpp or cxxfunction

2014-02-06 Thread Luke.Domanski
Hi All,

I am trying to profile some Rcpp code, and have tried using Solaris Studios and 
Intel Vtune with little success.

I have found the info re. Google perftools here 
http://dirk.eddelbuettel.com/papers/ismNov2009introHPCwithR.pdf and here 
http://stackoverflow.com/questions/13224322/profiling-rcpp-code-on-os-x but 
would prefer to find a more generic solution applicable to a number of profiler 
products (note: I have not tried the perftools solution yet, if nobody has an 
alternative solution I'll will install and try perftools) .

We have compiled a version of R 3.0.2 with both debug+profiling flags (i.e. -g 
-pg) and profiling only (i.e. -pg).

Solarise Studio can  profile with only the debugger information. While vtune 
relies on a profiling compilation I believe.

As an example, take:
$: cat ProfilingTest.cpp
#include math.h
#include Rcpp.h

void shortFunc(Rcpp::NumericVector x,
   Rcpp::NumericVector y) {

Rcpp::NumericVector temp(x.size());

for (unsigned int j = 0; j  x.size(); j++) {
temp[j]=sqrt(x[j]/y[j]);
}
}

void lengthyFunc(Rcpp::NumericVector x,
 Rcpp::NumericVector y) {

Rcpp::NumericVector temp(x.size());

for (unsigned int i = 0; i  1000; i++) {
for (unsigned int j = 0; j  x.size(); j++) {
temp[j]=sqrt(x[j]/y[j]);
}
}
}

// [[Rcpp::export]]
void testfunc(SEXP x, SEXP y){

Rcpp::NumericVector v1(x);
Rcpp::NumericVector v2(y);

for (unsigned int i=0; i100; i++){
shortFunc(v1,v2);
lengthyFunc(v1,v2);
}
}

To get a profile (and similarly debug) version of the Rcpp code using either 
sourceCpp or cxxfunction I do the following in R run through the profiler 
product's interrogation process:
 require(Rcpp)
 Sys.setenv(-pg)
 sourceCpp(ProfilingTest.cpp)
 testfunc(rnorm(1),rnorm(1))
 q(no)

OR

 require(inline)
 require(Rcpp)
 myplugin=getPlugin(Rcpp)
 myplugin$env$PKG_CXXFLAGS--pg
 testfunc-cxxfunction(signature(x=numeric,y=numeric), 
 includes=readLines(ProfilingTest.cpp), body=testfunc(x,y);, 
 settings=myplugin)
 testfunc(rnorm(1),rnorm(1))
 q(no)

When viewing the profiler results however, both profilers I tried give a 
single, non descriptive, entry for the call to testfunc(), where the functions 
names would otherwise be listed. Something along the lines of:
sourceCpp_.so - No functions found

and similarly for the file produced by cxxfunction . This gives you no more 
information than running the code with Rprof(), which assigns all the C++ time 
to the Anonymous tag/function.

With Solaris Studios I even used collect -A copy R to automatically copy and 
archive the loaded .so files of the program together with the raw profile 
results, so that the temporary sourceCPP_.so with profiling file should be 
available during the analysis/viewing stage (analyzer program), but no luck.

Can anyone see something obvious the I am doing wrong here? Could it be that 
functions inside the Rcpp source are simply being optimized out in favour of 
inlined code? Surely you would at least see the one entry point function to the 
.so file.

Any help from someone who has done this successfully would be appreciated.

Cheers,
Luke Domanski.

___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

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 BLAS_LIBS, as well as the
actual compilation steps invoked when installing RcppArmadillo from
source, to see how exactly it is linking to BLAS / LAPACK.

But (I think) Rblas.dll is still just the packaged version of BLAS
distributed with R; I don't think it even gets generated if you
specify a system BLAS library explicitly. But (assuming you're on
Windows) I'm not sure if R does something Windows-specific here.

Cheers,
Kevin

On Thu, Feb 6, 2014 at 3:08 PM, Avraham Adler avraham.ad...@gmail.com 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?

 Thank you,

 Avraham

 ___
 Rcpp-devel mailing list
 Rcpp-devel@lists.r-forge.r-project.org
 https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


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 e...@debian.org 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 fooling R into thinking it's
ATLAS).

Thank you,

Avraham
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


Re: [Rcpp-devel] Undefined Reference to typeinfo for Rcpp::RObject for Rdisop on Mac after Rcpp/RcppClassic update

2014-02-06 Thread Dirk Eddelbuettel

On 6 February 2014 at 12:01, Dan Tenenbaum wrote:
| If every reverse dependency of Rcpp needs a rebuild, and that includes 
RcppClassic, does it not follow that RcppClassic needs a rebuild on CRAN? 
Otherwise Mac or windows users without compilers are out of luck.

It has always been my understanding that is what happens on Windows. 

But I work on Linux and I can assure you that you need to rebuild.

Greetings from Miami,  Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


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 use different BLAS +
LAPACK, then RcppArmadillo will use then.  

On Linux that is plug and play if you a) build with dynamic library
configuration and b) use external BLAS/LAPACK.  That is the default for Linux
distributions.  On Windows you may want to check the 'R Installation and
Administration' manual.

Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel