Building toy package linking to Rcpp

statquant

I've been trying to build a dummy package following the book Seamless R and C++ Integration with Rcpp This is essentially running a 1-liner: Rcpp.package.skeleton("mypackage")

J:\R\tests>ls -rla mypackage
total 2
drwx------+ 1  mkpasswd   0 Jul 24 12:24 src
drwx------+ 1  mkpasswd   0 Jul 24 12:24 man
drwx------+ 1  mkpasswd   0 Jul 24 12:24 R
-rwx------  1  mkpasswd  54 Jul 24 12:24 NAMESPACE
-rwx------  1  mkpasswd 336 Jul 24 12:24 DESCRIPTION
drwx------+ 1  mkpasswd   0 Jul 24 12:24 ..
drwx------+ 1  mkpasswd   0 Jul 24 12:24 .

All works correctly and I then tried to install the newly-created package.

J:\R\tests>"C:\Program Files\R\R-3.0.1\bin\x64\R.exe" CMD INSTALL mypackage

this fails miserably

J:\R\tests>"C:\Program Files\R\R-3.0.1\bin\x64\R.exe" CMD INSTALL mypackage

package::utils loaded
LC_TIME have been set to C
Sourcing utility file : J:/R//utils/utils.R
Adding instantClient path: C:\instantclient\x64\instantclient_11_2 to PATH
Adding MOSEK: C:\Travail\Tools\mosek\7\tools\platform\win64x86\bin to PATH
J:/R//utils/descriptifTables.csv successfully loaded in a global data.frame descriptifTables

##------ [J:/R/tests] Wed Jul 24 12:26:42 2013 ------##
* installing to library 'J:/R/win-library/3.0'
* installing *source* package 'mypackage' ...
** libs

*** arch - i386
g++ -m32 -I"C:/PROGRA~1/R/R-30~1.1/include" -DNDEBUG    -I"J:/R/win-library/3.0/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c rcpp_hello_world.cpp -o rcpp_hello_world.o
Syntax error: end of file unexpected (expecting "fi")
make: *** [mypackage.dll] Error 2
ERROR: compilation failed for package 'mypackage'
* removing 'J:/R/win-library/3.0/mypackage'

I have been trying to do the same with Rstudio, the result is the same. I have been building several other packages from sources (.tar.gz files) with not too many problems

Dirk Eddelbuettel

Weird errors. Can't think of much other than do not install R in a path with spaces -- recommendation of the "R on Windows FAQ" itself.

But this is clearly just an issue of your local installation, so work through the Windows sections of Chapter 2 of the book. That you have to call R as the weird "C:\Program Files\R\R-3.0.1\bin\x64\R.exe" strongly suggests that you did not install R and Rtools as you were supposed to.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Rcpp openmp plugin in building package

From Dev

Rcpp openmp plugin in building package

From Dev

dyn.load error linking a package with Rcpp

From Dev

dyn.load error linking a package with Rcpp

From Dev

Building a tiny R package with CUDA and Rcpp

From Dev

Building R package with C++11 & Rcpp on Windows

From Dev

Dealing with decorated external binaries when building a package with Rcpp

From Dev

Calling a Rcpp function from another Rcpp function while building an R package

From Dev

Linking Dynamic and Static Libraries Rcpp

From Dev

DMD: misunderstandings with linking and building

From Dev

Building and linking to a executable

From Dev

How do I linking to a non-standard library when building an R package

From Dev

Building and linking shared libraries in an R package - code compiles, links, but won't load

From Dev

Compiling the Rcpp package

From Dev

Is there any toy example of building convolutional autoencoders using MxNet?

From Dev

Linking R package vignettes

From Dev

Removing R package Rcpp completely

From Dev

Load shared object in Rcpp package

From Dev

Rcpp functions cause crash in package

From Dev

Building packages with Rcpp, Attributes not handled correctly

From Dev

Rcpp: error occured building shared library

From Dev

XLConnect, rJava and package building

From Dev

building reusable package in django

From Dev

Building a .deb package reproducibly

From Dev

Building Deb Package Error

From Dev

XLConnect, rJava and package building

From Dev

conda: linking cython package to dll

From Dev

conda: linking cython package to dll

From Dev

Building and Linking V8 in Visual Studio

Related Related

HotTag

Archive