[Rcpp-devel] RInside error in mac 64 bit?

Ariful Azad azadcse at gmail.com
Thu Mar 22 01:46:03 CET 2012


Hi,

I created a package using Rcpp (using Rcpp.package.skeleton()).
Now I need to access a piece of R code from the cpp code in the package.
I am trying to use RInside.

I am using Mac 64 bit machine.

When I installed RInside I found the shared libraries in two places
1. /Library/Frameworks/R.
framework/Versions/2.14/Resources/library/RInside/lib
and  in
2.
/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RInside/libs

in the first directory I have one subfolder named i386 that contains two
files
libRInside.a        libRInside.dylib

but in the second directory I have three subfolders namely ,
a) i386 with files libRInside.a        libRInside.dylib
b) x86_64 with files RInside.so    RInside.so.dSYM
c)ppc with files RInside.so    RInside.so.dSYM


In my DESCRIPTION file I addedd
 LinkingTo: Rcpp, RInside
In my MakeVars I added
PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
`$(R_HOME)/bin/Rscript -e "RInside:::LdFlags()"`

Now when I install the package using R CMD install , it installs both 32
bit and 64 bit version.
However, I am getting error for the 64 bit version , probably because
RInside.so is not for mac ? (Please see below the outputs).

By the way how can I modify architecture specific compile option in
Makevars file for (for example I want to pass different libraries to
different versions directed fro 32 or 64 bit architectures ) ?

Output from R CMD install pkg
----------------------------

* installing to library
‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
* installing *source* package ‘flowMatch’ ...
** libs
*** arch - i386
g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/i386
-I/usr/local/include
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RInside/include"
-fPIC  -g -O2 -c BipartiteGraph.cpp -o BipartiteGraph.o
BipartiteGraph.cpp:28: warning: division by zero in ‘1.0e+0 / 0.’
g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/i386
-I/usr/local/include
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RInside/include"
-fPIC  -g -O2 -c MinWghtEdgCoverBipartite.cpp -o MinWghtEdgCoverBipartite.o
g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/i386
-I/usr/local/include
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RInside/include"
-fPIC  -g -O2 -c rcpp_hello_world.cpp -o rcpp_hello_world.o
g++ -arch i386 -dynamiclib -Wl,-headerpad_max_install_names -undefined
dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib
-o flowMatch.so BipartiteGraph.o MinWghtEdgCoverBipartite.o
rcpp_hello_world.o
/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/lib/i386/libRcpp.a
/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RInside/lib/i386/libRInside.a
-F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
-Wl,CoreFoundation
installing to
/Library/Frameworks/R.framework/Versions/2.14/Resources/library/flowMatch/libs/i386
*** arch - x86_64
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64
-I/usr/local/include
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RInside/include"
-fPIC  -g -O2 -c BipartiteGraph.cpp -o BipartiteGraph.o
BipartiteGraph.cpp:28: warning: division by zero in ‘1.0e+0 / 0.’
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64
-I/usr/local/include
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RInside/include"
-fPIC  -g -O2 -c MinWghtEdgCoverBipartite.cpp -o MinWghtEdgCoverBipartite.o
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64
-I/usr/local/include
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RInside/include"
-fPIC  -g -O2 -c rcpp_hello_world.cpp -o rcpp_hello_world.o
*g++ -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined
dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib
-o flowMatch.so BipartiteGraph.o MinWghtEdgCoverBipartite.o
rcpp_hello_world.o
/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/lib/x86_64/libRcpp.a
/libRInside.a -F/Library/Frameworks/R.framework/.. -framework R
-Wl,-framework -Wl,CoreFoundation*
i686-apple-darwin11-llvm-g++-4.2: /libRInside.a: No such file or directory
make: *** [flowMatch.so] Error 1
ERROR: compilation failed for package ‘flowMatch’


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


thanks

-- Ariful
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120321/65f8b15e/attachment.html>


More information about the Rcpp-devel mailing list