View Full Version : MySQL and Amarok 2 won't Compile

23rd December 2008, 11:06 PM
Hello, all!

Ever since Amarok 2.0 went public as a final product, I've been trying to compile it from source. I've tried the in-repo build of it, and it wasn't behaving nicely. (Eating massive CPU, then crashing when I try to open a window.) I figure, not only do I possibly get a working Amarok, but I also get some experience compiling from source. But alas, I am plagued by troubles with MySQL and consequently Amarok.

Previously, I could get MySQL to compile and Amarok would be fine until it tried linking against it (somewhere around 83% of the make process). I now think that this is an artifact of the mysql-libs I have installed via yum, which are 5.0.67, not 5.1.30, which I am installing. I could have yum erase it without checking dependencies, but I think everything that depends on those libs would throw an error when trying to use the newer libs. I think a better solution would be to have MySQL compile into another directory, such as ~/lib, but that relies on this compiling right.

As of today's attempts, mysql will NOT compile, a change from earlier. When running make, it will run fairly normally until throwing a most curious error:

g++: yes: No such file or directory
make[3]: *** [mysqld] Error 1
make[3]: Leaving directory `/home/avery/Download/mysql-5.1.30/sql'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/avery/Download/mysql-5.1.30/sql'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/avery/Download/mysql-5.1.30/sql'
make: *** [all-recursive] Error 1

I have sneaky suspicion that there's something going wrong with a ./configure argument, and it's getting the "yes" from "checking for *" instead of a directory of some sort. I will try playing around with the ./configure arguments to see if I can get it to work.

23rd December 2008, 11:54 PM
OK, I've found that compiling will succeed without "--with-mysqld-libs". I just hope I don't need those for Amarok. (Somehow, I've had some difficulty in finding the proper configuration for use with Amarok 2. If anyone has a link, I'd appreciate it.)

24th December 2008, 12:43 AM
I'm giving amarok 2.0 a whirl now [F10 x86_64] and will let you know what if anything I find out for you. :)


24th December 2008, 01:22 AM
Hey Seve!

I've just tried compiling Amarok 2.0 again, and after 84% completion, I get a familiar error against MySQL:

/usr/bin/ld: ~/usr/lib/mysql/libmysqld.a(lib_sql.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
~/usr/lib/mysql/libmysqld.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [lib/libamarok_collection-sqlcollection.so] Error 1
make[1]: *** [src/collection/sqlcollection/CMakeFiles/amarok_collection-sqlcollection.dir/all] Error 2
make: *** [all] Error 2

This tells me that Amarok successfully found my newly-compiled version (in ~/usr), but it complains that I didn't install with -fPIC, which I believe to be a known MySQL bug, related to the bug listed at http://bugs.mysql.com/bug.php?id=8796. In theory, one ought to use

export CFLAGS='-fPIC'

prior to making/configuring and receive a properly-compiled set of mysql libraries -- at least, according to the MySQL bug listing. I have done this, and I continue to receive this error about libmysqld.a not being compiled as such. I think there is a workaround to be had here, but I have yet to discover it.

24th December 2008, 08:29 AM
Well, I have a success to report!

All I needed to do was to add

to the ./configure; my final command was:

export CFLAGS="-fPIC"; ./configure --with-embedded-server --with-lib-ccflags="-fPIC" --with-pic CFLAGS="-fPIC" CXXFLAGS="-fPIC" --prefix=$HOME/usr

This gave me the libraries with which Amarok is happy to work, thereby getting my a 100% compilation (after an hour or so of wait.) Sadly, I messed up the install prefix for Amarok so I have yet to say if I notice any improvements over the in-repo version, but I am glad to report that I have the means to find out!

24th December 2008, 09:17 AM
Right, I now have a happy build of Amarok. It's still buggy and sometimes unresponsive, but at least I know it's because of the code behind it, not the repo's distribution of it. Cheers to all who pursue in my footsteps and remember to pass flags to BOTH C and C++ compilers.

29th December 2008, 10:50 PM
So, the main reason Amarok was eating CPU was due to its scanning attempts. I just deleted my ~/.kde/amarok directory to see if that would fix things, and upon start-up, Amarok did a full, 100%-successful scan and then returned to a much more agreeable CPU load. My guess is that the residual database from the last install, which used an earlier MySQL version, was causing major hang-ups and issues with the current-MySQL Amarok install. I hope this will cure my other woes as well -- a functional Amarok 2.0 may be at hand!