Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 488588 - =net-analyzer/cacti-spine-0.8.8b with =dev-db/mariadb-5.5.32: configure error: ld: cannot find -lmysqlclient_r
Summary: =net-analyzer/cacti-spine-0.8.8b with =dev-db/mariadb-5.5.32: configure error...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lance Albertson (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on: 474952
Blocks:
  Show dependency tree
 
Reported: 2013-10-19 12:16 UTC by Dennis Schridde
Modified: 2013-11-16 16:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,10.54 KB, text/x-log)
2013-10-19 12:16 UTC, Dennis Schridde
Details
config.log (config.log,58.72 KB, text/x-log)
2013-10-19 12:16 UTC, Dennis Schridde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2013-10-19 12:16:32 UTC
Created attachment 361314 [details]
build.log

configure:12583: checking for mysql_init in -lmysqlclient_r
configure:12608: ia64-unknown-linux-gnu-gcc -o conftest -I/usr/include/mysql -pipe -mtune=mckinley -O2  -L/usr/lib -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu conftest.c -lmysqlclient_r  -lcrypto -lz -lpthread -lm  >&5
/usr/lib/gcc/ia64-unknown-linux-gnu/4.7.3/../../../../ia64-unknown-linux-gnu/bin/ld: cannot find -lmysqlclient_r
collect2: error: ld returned 1 exit status

It appears that the library path /usr/lib/mysql was not given to the compiler.
Comment 1 Dennis Schridde 2013-10-19 12:16:50 UTC
Created attachment 361316 [details]
config.log
Comment 2 Dennis Schridde 2013-10-19 12:22:49 UTC
Temporary workaround: ln -s mysql/libmysqlclient_r.so /usr/lib/
Comment 3 Brian Evans (RETIRED) gentoo-dev 2013-11-15 21:56:29 UTC
It is rather odd to get this on 5.5.32.  The unexpected symlink removal was in 5.5.31 in portage (fixed by a -r1 bump).

My config.log shows:
configure:12608: x86_64-pc-linux-gnu-gcc -o conftest -I/usr/include/mysql -O2 -pipe -march=native  -L/usr/lib64/mysql -Wl,-z,now,--as-needed,-O1,--hash-style=gnu,--sort-common conftest.c -lmysqlclient_r  -lcrypto -lz -lpthread -lm  >&5
configure:12608: $? = 0
configure:12617: result: yes
configure:12627: checking for mysql_thread_init in -lmysqlclient_r
configure:12652: x86_64-pc-linux-gnu-gcc -o conftest -I/usr/include/mysql -O2 -pipe -march=native  -L/usr/lib64/mysql -Wl,-z,now,--as-needed,-O1,--hash-style=gnu,--sort-common conftest.c -lmysqlclient_r  -lmysqlclient_r -lcrypto -lz -lpthread -lm  >&5
configure:12652: $? = 0
configure:12617: result: yes

And the configure.ac from cacti-spine says:
<code>
AC_DEFUN([MYSQL_LIB_CHK],
  [ str="$1/libmysqlclient_r.*"
    for j in `echo $str`; do
      if test -r $j; then
        MYSQL_LIB_DIR=$1
        break 2
      fi
    done
  ]
)

for i in $MYSQL_DIR /usr /usr/local /opt /opt/mysql /usr/pkg /usr/local/mysql; do
  MYSQL_LIB_CHK($i/lib64)
  MYSQL_LIB_CHK($i/lib64/mysql)
  MYSQL_LIB_CHK($i/lib)
  MYSQL_LIB_CHK($i/lib/mysql)
done

if test -n "$MYSQL_LIB_DIR" ; then
  LDFLAGS="-L$MYSQL_LIB_DIR $LDFLAGS"
fi
</code>

For some reason, your system is not getting -L/usr/lib/mysql like it should.
The only explanation is that there is a bad link or other file of mysqlclient_r.* in /usr/lib.  It is a simple check that can fail if /usr/lib/mysqlclient_r.old even exists.

Really a call to `mysql_config --libs_r` would be better then random guessing games.
Comment 4 Dennis Schridde 2013-11-15 22:13:10 UTC
I just checked that there is no libmysqlclient_r.so symlink in /usr/lib and reemerged cacti-spine. The issue is magically gone now...
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-16 16:15:56 UTC
*mariadb-5.5.31-r1 (18 Jul 2013)
  18 Jul 2013; Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
  +mariadb-5.5.31-r1.ebuild:
  Do a revision bump to avoid packages from not finding libmysqlclient.so - bug
  474952.