LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Trouble building Musescore on Slackware 64 (http://www.linuxquestions.org/questions/slackware-14/trouble-building-musescore-on-slackware-64-a-4175454576/)

Captain Pinkeye 03-18-2013 04:51 PM

Trouble building Musescore on Slackware 64
 
Hi, i tried to compile Musescore (sbopkg + mscore.Slackbuild), but it failed.

Build quits with:
Quote:

[ 84%] Building CXX object scriptgen/qtbindings/gui/CMakeFiles/qtscript_gui.dir/qtscriptshell_QDrag.cpp.o
Linking CXX shared library libqtscript_gui.so
make[3]: Leaving directory `/tmp/sbopkg.Mz0E69/mscore-1.2/build'
[ 84%] Built target qtscript_gui
make[2]: Leaving directory `/tmp/sbopkg.Mz0E69/mscore-1.2/build'
make[1]: Leaving directory `/tmp/sbopkg.Mz0E69/mscore-1.2/build'
But much further up there is this (and only) error:
Quote:

/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: note: 'pthread_cancel@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[3]: *** [mscore/mscore] Error 1
make[2]: *** [mscore/CMakeFiles/mscore.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
So i did my homework, and it seems i need to add '/lib64/libpthread.so.0' to the linker command line, as it is written here:
http://forums.fedoraforum.org/showthread.php?t=247730, but i don't know how to do it and i don't want to bork my system. Plus my brain was starting to melt down, too.


So my question is:
1. How to succesfully build this package?
2. How to add something into linker command line, preferably using the slackbuild?


Tried to compile both 1.2 and 1.3, with -j3 and without any -j, with -02 and -01, on 64 bit Slackware 14, both optional deps (portaudio & jack) i have not.
The same slackbuild went fine on Slackware64 13.37.
(I tried to attach both logs, but i can't for some reason.)

ponce 03-18-2013 06:39 PM

This is a case of underlinking, so the solution is to pass the linker the specific library.
You forgot to post when it happens, the first line of the error
Code:

/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: CMakeFiles/mscore.dir/alsa.cpp.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.2.5'
Normally, it's sufficient to pass the library with LDFLAGS="-lpthread" to configure, but in this case cmake is used so you have to hunt a little in the CMakeLists.txt of the project and sed in the additional library: I've looked around and seems you have to add this line to the slackbuild, just before the first make
Code:

# Fix linking
sed -i '/^\ \ \ \ \ \ \${ALSA_LIB}$/i\      pthread' mscore/mscore/CMakeLists.txt

have a look at the file in question and search for pthread (after sed has run) to see in which block is added.

Captain Pinkeye 03-19-2013 02:23 AM

Quote:

you have to add this line to the slackbuild, just before the first make

Code:
Quote:

# Fix linking
sed -i '/^\ \ \ \ \ \ \${ALSA_LIB}$/i\ pthread' mscore/mscore/CMakeLists.txt

I did just that, and yes, the package compiled succesfully and seems to be working well!

Thanks for your time and knowledge, i'll mark this as solved now.

chapchap70 09-19-2013 11:22 PM

Hi,

I got the same error and it quit on the same line but I'm a little dense as to what file and where I have to add the "#Fix linking" code. (I do not know what is meant by "just before the first make")

I was trying to compile and build Mscore 1.3 on Puppy Slacko 5.6 (which I believe uses slackware.)

Thanks

natharran 09-20-2013 07:36 AM

Hi,

sorry for posting to a [SOLVED] thread, but I believe I found an easier solution. You simply add "-lpthread" to CFLAGS and CXXFLAGS as instructed here.

I'm not using any slackbuild script for this so I ran
Code:

CFLAGS="-O2 -fPIC -lpthread" CPPFLAGS="-O2 -fPIC -lpthread" CXXFLAGS="-O2 -fPIC -lpthread" make release
Compiled ok and everything seems to run.

Hope it helps.

Captain Pinkeye 09-24-2013 03:19 AM

Quote:

Originally Posted by chapchap70 (Post 5031101)
Hi,

I got the same error and it quit on the same line but I'm a little dense as to what file and where I have to add the "#Fix linking" code. (I do not know what is meant by "just before the first make")

I was trying to compile and build Mscore 1.3 on Puppy Slacko 5.6 (which I believe uses slackware.)

Thanks

Yes it uses Slackware, but i'm not sure if it uses slackbuilds for making packages (i doubt it). We were talking about this one in particular. If you build the program the traditional MAKE way, i recommend following natharran's advice instead.


Quote:

Originally Posted by natharran (Post 5031323)
Hi,

sorry for posting to a [SOLVED] thread, but I believe I found an easier solution. You simply add "-lpthread" to CFLAGS and CXXFLAGS as instructed here.

I'm not using any slackbuild script for this so I ran
Code:

CFLAGS="-O2 -fPIC -lpthread" CPPFLAGS="-O2 -fPIC -lpthread" CXXFLAGS="-O2 -fPIC -lpthread" make release
Compiled ok and everything seems to run.

Hope it helps.

Thanks for this.

chapchap70 09-27-2013 04:03 PM

Update
 
Quote:

Originally Posted by natharran (Post 5031323)
Hi,

sorry for posting to a [SOLVED] thread, but I believe I found an easier solution. You simply add "-lpthread" to CFLAGS and CXXFLAGS as instructed here.

I'm not using any slackbuild script for this so I ran
Code:

CFLAGS="-O2 -fPIC -lpthread" CPPFLAGS="-O2 -fPIC -lpthread" CXXFLAGS="-O2 -fPIC -lpthread" make release
Compiled ok and everything seems to run.



Hope it helps.


Instead of starting a new thread and referencing this one, I figured I would post my situation in this thread because it seemed the exact same scenario. However, the solution offered here did not work. I can try again if anyone is curious about what the error code is but I got it to work in a way I believe did not work for the Captain Pinkeye. I simply tried ponce's way just for the heck of it. (I didn't think it would work.)

Code:

LDFLAGS="-lpthread" make release
I guess there are differences in what I am using and regular Slackware and the fact that this Puppy is a 32 bit os. Next time, I'll refer to a solved thread instead of post in it. Thanks for the help.

I did not use the slackbuilds; I did make from the tarball source.

pacas 06-30-2014 12:41 PM

How to compile mscore
 
I had the same problem as you : I can compile on a portable newly installed,
but the compilation failed on my very powerfull and modern desktop. I made
a "locale jack" on the two computers in order to find the missing or wrong files.

Only on the desktop, remains old files unused of "jack" and "jack-audio-connection-kit"
that I tested before without great success. I think they where not removed by uninstallation
process, and worse, I think one of them indicate that 'jack' was present in order that the
compilation fail. I do :

rm /usr/include/sound/jack.h
rm /usr/include/cryptopp/skipjack.h
rm /usr/include/???/pa_jack.h (I don't remember the folder, do a "locate")

After, I uninstall and reinstall "portaudio"
After, the compilation of mscore was good...

Voilą, bonne chance ą toi


All times are GMT -5. The time now is 11:47 AM.