Le 28 févr. 2014 à 11:52, Gregor Kastner <gregor.kast...@wu.ac.at> a écrit :

> Hi Hideyoshi,
> 
>> Is there a way I can just call that function in Rcpp rather than having to
>> install new libraries or create my own? (I presume that there is probably a
>> “C_do_fmin.c” file somewhere that I can use?)
> 
> This questions has been discussed in this list about a month ago:
> 
> http://r.789695.n4.nabble.com/Linking-to-native-routines-in-other-packages-tt4683969.html#none

As Dirk said, this is not the same thing. The level of complexity of calling an 
internal function of the stats package is quite high. 

I’d suggest :
- reimplement clean c++ code as Dirk says
- call the R function optimize form C++. Chances are the overhead of doing that 
is minimal and anecdotic compared to calling the objective function. 
- use something else as Dale says. 

> I am now using the approach that Romain suggested in this thread. Be sure to
> include
> 
> PKG_CPPFLAGS+=-I../inst/include/

As it has been reported to me by Brian Ripley, += is a gnu-ism so it is not 
portable. 
Also, you should not have the last `/` So: 

PKG_CPPFLAGS = -I../inst/include


> in the Makevars and Makevars.win files. AFAIK know this mechanism is not
> automated (yet), see
> http://r.789695.n4.nabble.com/LinkingTo-self-tt4684613.html
> 
> 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

Reply via email to