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

Charles Cara CharlesC at absolute-strategy.com
Mon Jan 14 14:41:56 CET 2013


Now that I have changed the directory to one without spaces in the path,
it works.  Thank you

 

From: rcpp-devel-bounces at lists.r-forge.r-project.org
[mailto:rcpp-devel-bounces at lists.r-forge.r-project.org] On Behalf Of
Charles Cara
Sent: 11 January 2013 12:10
To: JJ Allaire
Cc: rcpp-devel at lists.r-forge.r-project.org
Subject: Re: [Rcpp-devel] Error when trying to your piSugar example

 

Thank you.  I will have a go at changing the directory when I upgrade to
R-2.15.2  .

 

Charles

 

From: JJ Allaire [mailto:jj.allaire at gmail.com] 
Sent: 11 January 2013 11:33
To: Charles Cara
Cc: rcpp-devel at lists.r-forge.r-project.org
Subject: Re: [Rcpp-devel] Error when trying to your piSugar example

 

Hi Charles,

 

I believe the problem is that the Rcpp package is installed in a
directory with spaces in the path (C:/Program Files/R/R-2.15.1/library/)
and that this is causing the problem. If you install into a library
without spaces in the path everything should work correctly (see:
http://stackoverflow.com/questions/9764495/how-to-get-rcpp-to-work-in-r-
on-a-windows-xp-platform)

 

J.J.

On Fri, Jan 11, 2013 at 6:11 AM, Charles Cara
<CharlesC at absolute-strategy.com> wrote:

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_exampl
e ) 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 <tel:%2B44%20207-073-0738>  (direct line)
+44 207-073-0732 <tel:%2B44%20207-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.

 


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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130114/6967508e/attachment-0001.html>


More information about the Rcpp-devel mailing list