Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to install pymedia: http://pymedia.org/ on ubuntu. I'm fine with building pymedia itself from source, as that seems my only option, but I'd rather not have source built versions of its prerequisites lying around if I can avoid it.

I installed most of the prereq's with the following:

sudo apt-get install python-dev libogg-dev libvorbis-dev libfaad-dev libasound2-dev libmp3lame-dev

Then I downloaded the pymedia source tarball and ran:

python setup.py build

With that I get:

OGG          : found
VORBIS       : found
FAAD         : found
MP3LAME      : found
VORBISENC    : found
ALSA         : found
Continue building pymedia ? [Y,n]:

Which looks good. I hit yes.. and it errors out with:

#...
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/sound/sound.o build/temp.linux-x86_64-2.6/sound/resample.o build/temp.linux-x86_64-2.6/sound/fft.o -logg -lvorbis -lfaad -lmp3lame -lvorbisenc -lasound -o build/lib.linux-x86_64-2.6/pymedia/audio/sound.so
/usr/bin/ld: build/temp.linux-x86_64-2.6/sound/sound.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
build/temp.linux-x86_64-2.6/sound/sound.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1

What gives?

share|improve this question
add comment

1 Answer 1

This error is not related to the prereqs, it's likely a bad build script.

If I understand this correct (my C-foo is weak) 64bits shared libraries must be compiled with the -fPIC flag and sound.cpp isn't in this case.

In the setup.py of pymedia there is a function called *disable_fPIC* that forces gcc to compile all it's libraries without it. You can try to disable that function (just replace all the code with a pass statement) and try to compile it again. It shoul read something like this:

def disable_fPIC():
    pass

I can't test it as my machine is 32bits, so I can just hope that it helps.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.