r-dbi / RMySQL

Legacy DBI interface for MySQL
http://cran.r-project.org/package=RMySQL
208 stars 111 forks source link

Can't build on OSX 10.12.3 #181

Open john-k-mcdowell opened 7 years ago

john-k-mcdowell commented 7 years ago

I have been unable to build RMySQL on OSX 10.12.3. I have MySQL ver 5.7.17 installed. I also install mariadb-connector-c using brew. I tried to build RMySQL ver 10.9 from CRAN overriding the default locations for mysql due to have installed MySQL using Oracle installer rather than brew. After some effort I finally got the build process to find all mysql headers and libraries but the build failed due to an error linking the ssl library. I attempted to build using devtools on the latest development version and got the same error. I believe the error may have something to do with the latest version of OSX having new SSL library. I installed OpenSSL via brew but it says that the libraries are keg only with no change in the error.

I attempted to build the dev version as follows:

>devtools::install_github("rstats-db/DBI")
>devtools::install_github("rstats-db/RMySQL")

Downloading GitHub repo rstats-db/RMySQL@master
from URL https://api.github.com/repos/rstats-db/RMySQL/zipball/master
Installing RMySQL
trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.3/BH_1.62.0-1.tgz'
Content type 'application/x-gzip' length 9630884 bytes (9.2 MB)
==================================================
downloaded 9.2 MB

Installing BH
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/6h/29_3qxmn0sd0n7zh7qr65txm0000gp/T/Rtmp7cMoFB/devtools8788dd5e130/BH'  \
  --library='/Library/Frameworks/R.framework/Versions/3.3/Resources/library' --install-tests 

* installing *binary* package ‘BH’ ...
* DONE (BH)
trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.3/Rcpp_0.12.9.tgz'
Content type 'application/x-gzip' length 2949895 bytes (2.8 MB)
==================================================
downloaded 2.8 MB

Installing Rcpp
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/6h/29_3qxmn0sd0n7zh7qr65txm0000gp/T/Rtmp7cMoFB/devtools8788715c650a/Rcpp'  \
  --library='/Library/Frameworks/R.framework/Versions/3.3/Resources/library' --install-tests 

* installing *binary* package ‘Rcpp’ ...
* DONE (Rcpp)
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/6h/29_3qxmn0sd0n7zh7qr65txm0000gp/T/Rtmp7cMoFB/devtools87887f5a0066/rstats-db-RMySQL-ef2eb47'  \
  --library='/Library/Frameworks/R.framework/Versions/3.3/Resources/library' --install-tests 

* installing *source* package ‘RMySQL’ ...
Found mysql_config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb/mysql 
Using PKG_LIBS=-L/usr/local/Cellar/mariadb-connector-c/2.2.2/lib/mariadb -lmariadb -lssl /usr/lib/libiconv.dylib -ldl -lm -lpthread
** libs
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb/mysql  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2 -c MyConnection.cpp -o MyConnection.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb/mysql  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c RMySQL-init.c -o RMySQL-init.o
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb/mysql  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2 -c RcppExports.cpp -o RcppExports.o
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb/mysql  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2 -c connection.cpp -o connection.o
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb/mysql  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2 -c result.cpp -o result.o
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb/mysql  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2 -c timegm.cpp -o timegm.o
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb -I/usr/local/Cellar/mariadb-connector-c/2.2.2/include/mariadb/mysql  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2 -c version.cpp -o version.o
clang++ -std=c++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o RMySQL.so MyConnection.o RMySQL-init.o RcppExports.o connection.o result.o timegm.o version.o -L/usr/local/Cellar/mariadb-connector-c/2.2.2/lib/mariadb -lmariadb -lssl /usr/lib/libiconv.dylib -ldl -lm -lpthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [RMySQL.so] Error 1
ERROR: compilation failed for package ‘RMySQL’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RMySQL’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RMySQL’
Error: Command failed (1)
thw1st commented 7 years ago

had the same error - after upgrading to sierra. This helped me: https://github.com/brianmario/mysql2/issues/795