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

Dirk Eddelbuettel edd at debian.org
Tue Oct 15 13:33:02 CEST 2013


Conrad,

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.

Dirk

 
| 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


More information about the Rcpp-devel mailing list