Displaying 5 results from an estimated 5 matches for "logistic_map".
2017 Dec 03
5
Rcpp, dyn.load and C++ problems
...(1-xn);
x[i] = xn_plus_one;
y[i] = yn_plus_one;
}
return List::create(Rcpp::Named("x") = x, Rcpp::Named("y") = y);
}
And I compile it like this:
PKG_CXXFLAGS=$(Rscript -e 'Rcpp:::CxxFlags()') \
PKG_LIBS=$(Rscript -e 'Rcpp:::LdFlags()') \
R CMD SHLIB logistic_map.cpp
without problems and I get a logistic_map.so file as expected.
However in R:
R> dyn.load("logistic_map.so")
R> compute_values_cpp()
Error in compute_values_cpp() :
could not find function "compute_values_cpp"
Please advise,
What piece of the puzzle is missing?
R...
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
...] = yn_plus_one;
> }
> return List::create(Rcpp::Named("x") = x, Rcpp::Named("y") = y);
> }
>
> And I compile it like this:
> PKG_CXXFLAGS=$(Rscript -e 'Rcpp:::CxxFlags()') \
> PKG_LIBS=$(Rscript -e 'Rcpp:::LdFlags()') \
> R CMD SHLIB logistic_map.cpp
> without problems and I get a logistic_map.so file as expected.
>
> However in R:
> R> dyn.load("logistic_map.so")
> R> compute_values_cpp()
> Error in compute_values_cpp() :
> could not find function "compute_values_cpp"
>
> Please advise...
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
...in M?ller Skarbiniks Pedersen wrote:
| I have read some web-pages about Rcpp and C++ but it is a bit confusion
| for me.
1) Keep reading.
| And I compile it like this:
| PKG_CXXFLAGS=$(Rscript -e 'Rcpp:::CxxFlags()') \
| PKG_LIBS=$(Rscript -e 'Rcpp:::LdFlags()') \
| R CMD SHLIB logistic_map.cpp
| without problems and I get a logistic_map.so file as expected.
2) Possible but too complicated. Read on.
| However in R:
| R> dyn.load("logistic_map.so")
3) You never ever need that with Rcpp and its tool, unless you insist on
redoing thing by hand in which case you _must_ us...
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
I would go to the source, in this case Dirk Eddelbuettel's (I hope I
spelled it correctly) documentation for Rcpp:
http://dirk.eddelbuettel.com/code/rcpp/Rcpp-attributes.pdf
Note that you need to do
sourceCpp("logistic_map.cpp")
in R instead of building and dyn.load()-ing the object.
HTH,
Peter
On Sun, Dec 3, 2017 at 11:04 AM, Martin M?ller Skarbiniks Pedersen
<traxplayer at gmail.com> wrote:
> On 3 December 2017 at 05:23, Eric Berger <ericjberger at gmail.com> wrote:
>
>>
>> Do...
2017 Dec 03
2
Rcpp, dyn.load and C++ problems
On 3 December 2017 at 05:23, Eric Berger <ericjberger at gmail.com> wrote:
>
> Do a search on "Rcpp calling C++ functions from R"
>
Thanks. However search for "Rcpp calling C++ functions from R" gives a lot
of result but I think
some of them are outdated and others don't agree with each other.
Can you point to a specific good on-line guide for me?
Regards