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

Fedora: MariaDB vs mariadb #197

Closed
bowerth opened this issue Apr 27, 2017 · 1 comment
Closed

Fedora: MariaDB vs mariadb #197

bowerth opened this issue Apr 27, 2017 · 1 comment

Comments

@bowerth
Copy link

bowerth commented Apr 27, 2017

Hello -
many thanks for the package -
I could install on Fedora 25 after installation of mariadb-devel, as explained in the readme.
Soon afterwards, I noticed the current stable version 10.1 does not support JSON functions and I installed the release candidate version 10.2 according to https://downloads.mariadb.org/mariadb/repositories/#mirror=babylon-fr&distro=Fedora&distro_release=fedora25-amd64--fedora25&version=10.2

RMySQL works like charm. However, if I attempt to re-install RMySQL (from CRAN or GitHub), I receive the error /usr/bin/ld: cannot find -lmariadb

>  install.packages("RMySQL")
Installing package into ‘/home/xps13/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'http://cran.univ-paris1.fr/src/contrib/RMySQL_0.10.11.tar.gz'
Content type 'application/x-gzip' length 54186 bytes (52 KB)
==================================================
downloaded 52 KB

* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
Found mysql_config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/mysql -I/usr/include/mysql/mysql
Using PKG_LIBS=-L/usr/lib64/ -lmariadb -lpthread -ldl -lm -lssl -lcrypto
** libs
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c RMySQL-init.c -o RMySQL-init.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c connection.c -o connection.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c db-apply.c -o db-apply.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c driver.c -o driver.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c exception.c -o exception.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c fields.c -o fields.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c result.c -o result.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c utils.c -o utils.o
utils.c: In function ‘RS_DBI_newEntry’:
utils.c:131:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
   for(i = 0; i < length; i++)
   ^~~
utils.c:136:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
     return indx;
     ^~~~~~
gcc -m64 -shared -L/usr/lib64/R/lib -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o RMySQL.so RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o -L/usr/lib64/ -lmariadb -lpthread -ldl -lm -lssl -lcrypto -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lmariadb
collect2: error: ld returned 1 exit status
/usr/share/R/make/shlib.mk:6: recipe for target 'RMySQL.so' failed
make: *** [RMySQL.so] Error 1
ERROR: compilation failed for package ‘RMySQL’
* removing ‘/home/xps13/R/x86_64-redhat-linux-gnu-library/3.3/RMySQL’
* restoring previous ‘/home/xps13/R/x86_64-redhat-linux-gnu-library/3.3/RMySQL’

The downloaded source packages are in
	‘/tmp/Rtmp2EKM8n/downloaded_packages’
Warning message:
In install.packages("RMySQL") :
  installation of package ‘RMySQL’ had non-zero exit status
>  install.packages("RMySQL")
Installing package into ‘/home/xps13/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'http://cran.univ-paris1.fr/src/contrib/RMySQL_0.10.11.tar.gz'
Content type 'application/x-gzip' length 54186 bytes (52 KB)
==================================================
downloaded 52 KB

* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
Found mysql_config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/mysql -I/usr/include/mysql/mysql
Using PKG_LIBS=-L/usr/lib64/ -lmariadb -lpthread -ldl -lm -lssl -lcrypto
** libs
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c RMySQL-init.c -o RMySQL-init.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c connection.c -o connection.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c db-apply.c -o db-apply.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c driver.c -o driver.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c exception.c -o exception.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c fields.c -o fields.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c result.c -o result.o
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -c utils.c -o utils.o
utils.c: In function ‘RS_DBI_newEntry’:
utils.c:131:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
   for(i = 0; i < length; i++)
   ^~~
utils.c:136:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
     return indx;
     ^~~~~~
gcc -m64 -shared -L/usr/lib64/R/lib -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o RMySQL.so RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o -L/usr/lib64/ -lmariadb -lpthread -ldl -lm -lssl -lcrypto -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lmariadb
collect2: error: ld returned 1 exit status
/usr/share/R/make/shlib.mk:6: recipe for target 'RMySQL.so' failed
make: *** [RMySQL.so] Error 1
ERROR: compilation failed for package ‘RMySQL’
* removing ‘/home/xps13/R/x86_64-redhat-linux-gnu-library/3.3/RMySQL’
* restoring previous ‘/home/xps13/R/x86_64-redhat-linux-gnu-library/3.3/RMySQL’

The downloaded source packages are in
	‘/tmp/Rtmp2EKM8n/downloaded_packages’
Warning message:
In install.packages("RMySQL") :
  installation of package ‘RMySQL’ had non-zero exit status
@jeroen
Copy link
Member

jeroen commented Jun 30, 2017

I think this is a bug in that custom mariadb repo. Their packag MariaDB-devel-10.2.6-1.fc25.x86_64 only contains a library named:

/usr/lib64/libmariadbclient.a

However their pkg-config yiels another name:

> pkg-config --libs mariadb
    -lmariadb

You best raise this at the maintainers of that repo. A workaround is to symlink libmariadbclient.a to libmariadb.a:

sudo ln -s /usr/lib64/libmariadbclient.a /usr/lib64/libmariadb.a

That fixes the installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants