Created
October 4, 2013 21:49
-
-
Save labeneator/6833376 to your computer and use it in GitHub Desktop.
RMySQL OSX recipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find your R home | |
$ echo "R.home()" | Rscript /dev/stdin | |
Loading required package: stats | |
Loading required package: methods | |
[1] "/usr/local/Cellar/r/3.0.1/R.framework/Resources" | |
# Make sure that you have the MySQL home var in your Renviron | |
$ fgrep MYSQL_HOME /usr/local/Cellar/r/3.0.1/R.framework/Resources/etc/Renviron | |
MYSQL_HOME="/usr/local/mysql-5.6.12-osx10.7-x86_64/" | |
#### This step trips up everyone #### | |
# Make sure that the libmysqlclient dynamic lib is in your R lib path by | |
# 1. Get the dll path | |
$ echo "Sys.getenv('DYLD_FALLBACK_LIBRARY_PATH')" | Rscript /dev/stdin | |
Loading required package: stats | |
Loading required package: methods | |
[1] "/usr/local/Cellar/r/3.0.1/R.framework/Resources/lib" | |
# 2. Symlink your libmysqlclient | |
$ ln -s /usr/local/mysql-5.6.12-osx10.7-x86_64/lib/libmysqlclient.18.dylib /usr/local/Cellar/r/3.0.1/R.framework/Resources/lib | |
# 3. Install the package | |
$ export PKG_LIBS="-L/usr/local/mysql-5.6.12-osx10.7-x86_64/lib/ -lmysqlclient" | |
$ export PKG_CPPFLAGS="-I/usr/local/mysql-5.6.12-osx10.7-x86_64/include/" | |
$ R CMD INSTALL RMySQL.tar.gz | |
... | |
... | |
** installing vignettes | |
** testing if installed package can be loaded | |
* DONE (RMySQL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:)