[Rcpp-devel] Help with Installing RInside examples on OSX

Conrad Bielski conrad_bielski at yahoo.com
Tue Oct 15 14:37:28 CEST 2013

On Tuesday, October 15, 2013 2:25 PM, Conrad Bielski <conrad_bielski at yahoo.com> wrote:
Thanks Dirk,
didn't realise that I could just run make! So now I have to see why the cmake doesn't work in this case, thanks!
My output from make below.
Conrad :)

tatas-MacBook-Pro:standard tata$ make rinside_sample2
llvm-g++-4.2 -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Versions/3.0/Resources/library/Rcpp/include -I/Library/Frameworks/R.framework/Versions/3.0/Resources/library/RInside/include -mtune=core2 -g -O2 -Wall -I/usr/local/include   rinside_sample2.cpp  -F/Library/Frameworks/R.framework/.. -framework R  -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/Library/Frameworks/R.framework/Resources/lib -lRlapack
 /Library/Frameworks/R.framework/Versions/3.0/Resources/library/Rcpp/lib/libRcpp.a /Library/Frameworks/R.framework/Versions/3.0/Resources/library/RInside/lib/libRInside.a -o rinside_sample2

On Tuesday, October 15, 2013 1:33 PM, Dirk Eddelbuettel <edd at debian.org> wrote:


On 15 October 2013 at 03:56, Conrad Bielski wrote:
| I wanted to setup Rcpp development on my mac (osx 10.7.5) but I'm having
| trouble when compiling the RInside examples
 (linking). I was able to get
| started quite easily on Ubuntu and I tried to use the same procedure on the
| mac. I hope that there is a simple solution to get going on the mac.
| Setup Procedure:
| 1. Downloaded the R binaries for OSX (R version 3.0.2 (2013-09-25) -- "Frisbee
| Sailing")
| 2. Installed Rcpp (0.10.5) and RInside (0.2.10)from within R (used
| install.packages(file_name_and_path, repos = NULL, type="source"))
| 3. ran CMake (2.8.12) on the RInside examples/standard in a separate build
| directory
| 4. ran make (compiler is Clang 4.0)

It should also work without step 3. The CMake files are contributed and
optional; their focus is on help with certain IDEs with use CMake (and for
CMake itself). 
 But they may not have been tested as much on OS X.

So go to examples/standard, and instead of 'make' (ie 'make all'), let's just
make one:

edd at max:~/svn/rinside/pkg/inst/examples/standard$ rm rinside_sample0
edd at max:~/svn/rinside/pkg/inst/examples/standard$ make rinside_sample0
ccache g++-4.7 -I/usr/share/R/include -I/usr/local/lib/R/site-library/Rcpp/include -I/usr/local/lib/R/site-library/RInside/include -g -O3 -Wall -pipe -Wno-unused -pedantic -Wall    rinside_sample0.cpp  -L/usr/lib/R/lib -lR  -lblas -llapack -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/local/lib/R/site-library/RInside/lib -lRInside
 -Wl,-rpath,/usr/local/lib/R/site-library/RInside/lib -o rinside_sample0
edd at max:~/svn/rinside/pkg/inst/examples/standard$ ./rinside_sample0
Hello, world!
edd at max:~/svn/rinside/pkg/inst/examples/standard$ 

The exact linking statement will be system-dependent but you need to show us
yours.  What you show below is a) 'too late' and b) lacking detail.


| So the problem is that I get a linking problem and I'm not sure how to fix it.
| On Ubuntu, the linking was automatic so I'm a little lost how to point to the
| required libraries.
| 33 warnings generated.
| Linking CXX executable rinside_callbacks0
| Undefined symbols for architecture x86_64:
|   "RInside::RInside(int, char const* const*, bool, bool, bool)", referenced
| from:
|       _main in rinside_callbacks0.cpp.o
|   "RInside::~RInside()", referenced from:
|       _main in rinside_callbacks0.cpp.o
| ld: symbol(s) not found for architecture x86_64
| clang: error: linker command failed with exit code 1 (use -v to see invocation)
| make[2]: *** [rinside_callbacks0] Error 1
| make[1]: *** [CMakeFiles/rinside_callbacks0.dir/all] Error 2
| make: *** [all] Error 2
| Thanks in advance for your help,
| Conrad :)
| ----------------------------------------------------------------------
| _______________________________________________
| 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
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20131015/56c1917e/attachment-0001.html>

More information about the Rcpp-devel mailing list