[Rcpp-devel] Error when trying to your piSugar example

Charles Cara CharlesC at absolute-strategy.com
Fri Jan 11 12:11:21 CET 2013


I have been trying to experiment with Rcpp as it looks like it could be
an excellent tool. However, I am unable to get your Finding Pi example (
http://dirk.eddelbuettel.com/blog/2012/11/20/#rcpp_attributes_pi_example
) to work.

 

I have the C++ file and the R script, but sourceCpp fails.  When I set
showOutput and verbose to be TRUE then I get the following message.
Looking through the message, it appears that the g++ command line does
not have one of the parameters in quotes (highlighted in green) which is
why it might be interpreted as two (missing) parameters.

 

It is beyond my limited knowledge whether this is a bug or a problem
with the configuration of my system, details of which are attached.

 

If you have any suggestions on how to fix this, so that I can go on and
use Rcpp, then I would be grateful.

 

Best regards

 

Charles Cara

 

 

sourceCpp("src/piSugar.cpp", showOutput=TRUE, verbose=TRUE)

 

Generated extern "C" functions 

--------------------------------------------------------

 

 

#include <Rcpp.h>

 

RcppExport SEXP sourceCpp_49731_piSugar(SEXP NSEXP) {

BEGIN_RCPP

    Rcpp::RNGScope __rngScope;

    int N = Rcpp::as<int >(NSEXP);

    double __result = piSugar(N);

    return Rcpp::wrap(__result);

END_RCPP

}

 

Generated R functions 

-------------------------------------------------------

 

`.sourceCpp_49731_DLLInfo` <-
dyn.load('C:/Users/charlesc/AppData/Local/Temp/RtmpO2NWdT/sourcecpp_16e8
276073a/sourceCpp_69065.dll')

 

piSugar <- Rcpp:::sourceCppFunction(function(N) {},
`.sourceCpp_49731_DLLInfo`, 'sourceCpp_49731_piSugar')

 

rm(`.sourceCpp_49731_DLLInfo`)

 

Building shared library

--------------------------------------------------------

 

DIR:
C:/Users/charlesc/AppData/Local/Temp/RtmpO2NWdT/sourcecpp_16e8276073a

 

C:/PROGRA~1/R/R-215~1.1/bin/i386/R CMD SHLIB -o "sourceCpp_69065.dll"
"piSugar.cpp" 

g++  -I"C:/PROGRA~1/R/R-215~1.1/include" -DNDEBUG     -I"C:/Program
Files/R/R-2.15.1/library/Rcpp/include" -I"H:/Quantitative Strategy/R
Working folder/3rd party examples/Rcpp and Pi/src"  -I"C:/Program
Files/R/R-2.15.1/library/Rcpp/include" -I"H:/Quantitative Strategy/R
Working folder/3rd party examples/Rcpp and Pi/src/../inst/include"
-O2 -Wall  -mtune=core2 -c piSugar.cpp -o piSugar.o

g++ -shared -s -static-libgcc -o sourceCpp_69065.dll tmp.def piSugar.o
C:/Program Files/R/R-2.15.1/library/Rcpp/lib/i386/libRcpp.a
-LC:/PROGRA~1/R/R-215~1.1/bin/i386 -lR

g++.exe: error: C:/Program: No such file or directory

g++.exe: error: Files/R/R-2.15.1/library/Rcpp/lib/i386/libRcpp.a: No
such file or directory

Error in inDL(x, as.logical(local), as.logical(now), ...) : 

  unable to load shared object
'C:/Users/charlesc/AppData/Local/Temp/RtmpO2NWdT/sourcecpp_16e8276073a/s
ourceCpp_69065.dll':

  LoadLibrary failure:  The specified module could not be found.

 

 

 

 

 

 

 

 

  

Charles Cara
Absolute Strategy Research Ltd.
1st Floor

1-2 Royal Exchange Buildings,
London, EC3V 3LF

+44 207-073-0738 (direct line)
+44 207-073-0732 (fax) 
--------------------------------------------------
Absolute Strategy Research Ltd is authorised and regulated by the
Financial Services Authority.  This email may contain confidential
information intended only for use of the individual(s) named on this
e-mail. If you are not the intended recipient, or responsible for
delivery of the message to that person, you may not copy, disclose, or
take any action in reliance of the contents of this email. If you have
received this message in error, please notify us by return email
immediately and destroy this message. The information in this email is
intended only for investors who are Market Counterparties or
Professional Customers, as defined by the FSA, and may not be
distributed to Private Customers.  Absolute Strategy Research Ltd does
not solicit any action based upon this email, which is not to be
construed as an invitation to buy or sell any security.  Unless
specifically stated to the contrary in the main body of the text, this
email is not intended to provide personal investment advice, nor to take
into account the investment objectives, financial situation and the
particular needs of any particular person who may read it. This email
provides general information only. The information contained was
obtained from sources that we believe to be reliable but we do not
guarantee that it is accurate or complete, and it should not be relied
upon as such. Opinions expressed are our current opinions as of the
original publication date appearing on this material only and the
information, including the opinions contained herein, are subject to
change without notice.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130111/5a399829/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diagnostics-report.txt
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130111/5a399829/attachment-0001.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: piSugar.cpp
Type: application/octet-stream
Size: 294 bytes
Desc: piSugar.cpp
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130111/5a399829/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Pi Example.R
Type: application/octet-stream
Size: 491 bytes
Desc: Pi Example.R
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130111/5a399829/attachment-0003.obj>


More information about the Rcpp-devel mailing list