Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Can't compile on gentoo linux #58

Open
funkoolow opened this issue Jun 29, 2014 · 3 comments
Open

Can't compile on gentoo linux #58

funkoolow opened this issue Jun 29, 2014 · 3 comments

Comments

@funkoolow
Copy link

hi,
trying to compile on gentoo, stops with this output:

/usr/bin/ruby19 extconf.rb
checking for portaudio.h... yes
checking for main() in -lportaudio... yes
checking for PaStreamCallbackTimeInfo in portaudio.h... yes
creating Makefile

make
compiling portaudio.c
linking shared-object portaudio.so
portaudio.o: nella funzione "rb_portaudio_write_from_mpg":
portaudio.c:(.text+0x4d9): riferimento non definito a "mpg123_read"
portaudio.c:(.text+0x534): riferimento non definito a "mpg123_plain_strerror"
collect2: error: ld returned 1 exit status
make: *** [portaudio.so] Errore 1

maybe some specific support must be enabled in portaudio? my version is 19_pre20140130, compiled with following flags: alsa cxx -debug -jack -oss -static-libs.

thanks in advance

@oioki
Copy link

oioki commented Jul 6, 2014

Hi, funkoolow.
I have the same problem as you described. Seems like problem is caused by absence of "-lmpg123" in the Makefile for portaudio extension of "audite" gem. For me, it is /usr/local/lib64/ruby/gems/1.9.1/gems/audite-0.3.0/ext/portaudio/Makefile

If I change this line

LIBS = $(LIBRUBYARG_SHARED) -lportaudio  -lpthread -lrt -ldl -lcrypt -lm   -lc

to this (adding -lmpg123):

LIBS = $(LIBRUBYARG_SHARED) -lportaudio -lmpg123 -lpthread -lrt -ldl -lcrypt -lm   -lc

then this command

cd /usr/local/lib64/ruby/gems/1.9.1/gems/audite-0.3.0/ext/portaudio
make

runs successfully and "portaudio.so" compiles.

I am not a rubyist, so I don't know how to put that change correctly into "gem install audite" procedure.

@assertivist
Copy link

I'm also having the same issue compiling on Cygwin.

Ruby seems to cache my partially installed gem in a different place (~/.gem/ruby/gems/audite-0.4.0/ext/portaudio) but I too can add -lmpg123 and get a portaudio.so.

I'm frankly very confused why this isn't in the Makefile to begin with, possibly it isn't required on some platforms?

Besides that, it seems impossible to continue the installation of the gem after compiling the .so manually. gem install audite simply deletes the .so you just compiled and nukes the changes to the Makefile so it fails again.

Is Ruby just painful like this? I also can't figure out how to install a gem "from source", audite and soundcloud2000 are both open source, but it seems impossible to build them without using the gem program.

@jgripe
Copy link

jgripe commented Mar 14, 2017

Add -lmpg123 to LIBS in /usr/lib/ruby/2.2.0/rbconfig.rb, e.g. change CONFIG["LIBS"] = "-lpthread -lgmp -ldl -lcrypt" to CONFIG["LIBS"] = "-lpthread -lgmp -ldl -lcrypt -lmpg123"
Built it successfully on Cygwin.

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

No branches or pull requests

4 participants