Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails for Percona Server #38

Closed
tersmitten opened this issue Jan 23, 2015 · 6 comments
Closed

Compilation fails for Percona Server #38

tersmitten opened this issue Jan 23, 2015 · 6 comments

Comments

@tersmitten
Copy link

We are using Percona Server, the an enhanced, drop-in MySQL replacement.

Trying to install RMySQL results in the following error:

File mysql.h not found. Please install mysql development library, e.g: libmysqlclient-dev (deb) or mariadb-devel (rpm).

It seems that mysql.h is in /usr/include and the libmysqlclient so files are in /usr/lib.

Setting MYSQL_INC and PKG_LIBS like this:

Sys.setenv(MYSQL_INC = "/usr/include");
Sys.setenv(PKG_LIBS = "/usr/lib");

solves the problem for us, but wouldn't it be better to use mysql_config.

# mysql_config
Usage: /usr/bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I/usr/include -g -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel33.0  -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1]
        --include        [-I/usr/include]
        --libs           [-L/usr/lib -lmysqlclient -lpthread -lm -lrt -lssl -lcrypto -ldl]
        --libs_r         [-L/usr/lib -lmysqlclient_r -lpthread -lm -lrt -lssl -lcrypto -ldl]
        --plugindir      [/usr/lib/mysql/plugin]
        --socket         [/var/run/mysqld/mysqld.sock]
        --port           [0]
        --version        [5.5.35]
        --libmysqld-libs [-L/usr/lib -lmysqld]
        --variable=VAR   VAR is one of:
                pkgincludedir [/usr/include]
                pkglibdir     [/usr/lib]
                plugindir     [/usr/lib/mysql/plugin]

It seems to me that it could make the configure script much simpler.

@jeroen
Copy link
Member

jeroen commented Jan 24, 2015

The problem is that mysql_config is not available on all systems. So we can add it to the configure script, but it would not make things simpler.

@jeroen
Copy link
Member

jeroen commented Jan 24, 2015

Which operating system does this run on?

@tersmitten
Copy link
Author

Ubuntu 12.04

@jeroen
Copy link
Member

jeroen commented Feb 16, 2015

Fixed @ 26dac28. Can you help test?

@tersmitten
Copy link
Author

Sure. I'll see if I can look into it this afternoon.

@tersmitten
Copy link
Author

Seems to work!

> devtools::install_github("rstats-db/RMySQL")
Downloading github repo rstats-db/RMySQL@master
Installing RMySQL
Installing dependencies for RMySQL:
DBI
Installing package into/data/home/mtersmitten/R/x86_64-pc-linux-gnu-library/3.1’
(aslibis unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/DBI_0.3.1.tar.gz'
Content type 'application/x-gzip' length 30106 bytes (29 Kb)
opened URL
==================================================
downloaded 29 Kb

* installing *source* packageDBI...
** packageDBIsuccessfully unpacked and MD5 sums checked
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (DBI)

The downloaded source packages are in/tmp/RtmpIMAxKU/downloaded_packages'/usr/lib/R/bin/R' --vanilla CMD INSTALL '/tmp/RtmpIMAxKU/devtools3aa2e8bc3ca/rstats-db-RMySQL-6a33ac7'  \
  --library='/data/home/mtersmitten/R/x86_64-pc-linux-gnu-library/3.1' --install-tests 

* installing *source* packageRMySQL...
Found mysql_config
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include -g -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel33.0  -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c RMySQL-init.c -o RMySQL-init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include -g -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel33.0  -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c connection.c -o connection.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include -g -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel33.0  -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c db-apply.c -o db-apply.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include -g -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel33.0  -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c driver.c -o driver.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include -g -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel33.0  -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c exception.c -o exception.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include -g -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel33.0  -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c fields.c -o fields.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include -g -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel33.0  -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c result.c -o result.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include -g -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel33.0  -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c utils.c -o utils.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RMySQL.so RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o -L/usr/lib -lmysqlclient -lpthread -lm -lrt -lssl -lcrypto -ldl -L/usr/lib/R/lib -lR
installing to /data/home/mtersmitten/R/x86_64-pc-linux-gnu-library/3.1/RMySQL/libs
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (RMySQL)
> library(DBI)

>

library(DBI)

@hadley hadley closed this as completed Feb 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants