Help with SSH libmad install


#1

I’m trying to install libmad and madplay so that I can decode MP3 files but I don’t know how to do things in shell (I’m using Putty). I think what I need to do is compile the two packages, but I’m getting the following error when I try to make install libmad, which seems to indicate that I don’t have write permissions in the directory? Is that close to being right?

[crystallight]$ make install
make install-recursive
make[1]: Entering directory /home/.mosby/cmb2005/rollyourownringtone.com/libmad-0.15.1b' make[2]: Entering directory/home/.mosby/cmb2005/rollyourownringtone.com/libmad-0.15.1b’
make[3]: Entering directory /home/.mosby/cmb2005/rollyourownringtone.com/libmad-0.15.1b' mkdir -p -- . /usr/lib /bin/sh ./libtool --mode=install /usr/bin/install -c libmad.la /usr/lib/libmad.la /usr/bin/install -c .libs/libmad.so.0.2.1 /usr/lib/libmad.so.0.2.1 /usr/bin/install: cannot create regular file/usr/lib/libmad.so.0.2.1’: Permission denied
make[3]: *** [install-libLTLIBRARIES] Error 1
make[3]: Leaving directory /home/.mosby/cmb2005/rollyourownringtone.com/libmad-0.15.1b' make[2]: *** [install-am] Error 2 make[2]: Leaving directory/home/.mosby/cmb2005/rollyourownringtone.com/libmad-0.15.1b’
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/.mosby/cmb2005/rollyourownringtone.com/libmad-0.15.1b’
make: *** [install] Error 2


#2

You need to install such programs to your user’s home directory (/home/username). So just direct the program there.
The libmad program should include such instructions in its Install/Readme file.

If not… let me know, and I’ll check it out and get back to you on exactly how to go about that :wink:


#3

how do i direct the program to the directory? I had previously typed "cd [directory_name] " to get to the proper directory, where i compiled the libmad program, but is that not enough?


#4

I already told you how to go about discovering that process.
Please read either the Install or Readme file that comes with the libmad source package. It should indicate how to do so in there.

If it doesn’t happen to, let me know and I’ll see if the generic way of going about it works :slight_smile:


#5

ok, so i read the install file for libmad and it mentions I need to run the commands “./configure” and “make install”. I had done those before, but for some reason, the madplay package couldn’t find the mad.h file.
It tells me
"You must install libmad before you can build this process. If libmad is already installed, , you may need to use the CPPFLAGS environment variable to specify its installed location, e.g. -I."

I assume this is what you mean, but when would i specify the cppflags environment variable? in the ./configure command?

I’m sure i’m not explaining this properly, but i’ve followed the instructions from the install and readme files included with both libraries (libmad and madplay). The instructions are identical.


#6

Okay, I see where you’re going wrong now at least :wink:

From the INSTALL file from libmad-0.15.1b.tar.gz:

Okay so - basically that means you need to set the directory to install libmad to from the ‘configure’ program.
Here’s an example of doing so on a DH server:

I created the directory ‘lib’ and ‘libmad’ within my home directory before I did this. This is actually a generic source package install, so you could apply this concept to future programs you might install through the shell as well.

Alright, so after running the ‘configure’ program, you can simply do as you had before: type ‘make’ and then ‘make install’. And that should get you a working libmad installation :slight_smile:


#7

thank you for your help; i’ve solved the libmad problem. Now I’m trying to install madplay and it needs access to the mad.h file that libmad installs in a subfolder heirarchy “/lib/include”

I need to tell madplay’s ./configure program where this file is because i keep getting these messages:

checking mad.h usability… no
checking mad.h presence… no
checking for mad.h… no
configure: error: mad.h was not found
*** You must first install libmad before you can build this package.
*** If libmad is already installed, you may need to use the CPPFLAGS
*** environment variable to specify its installed location, e.g. -I.

So I’ve added the CPPFLAGS environment variable to specify the installed location as such:

./configure cppflags=-I/home/.mosby/cmb2005/rollyourownringtone.com/lib/libmad/include

But this results in the same error. Am I not inputting the cppflags variable correctly?


#8

Yah their readme and install docs were a bit cryptic about how to go about it. But I just tested for you and this is basically what you need (I just included all the steps here, for your own reference as to what I’m doing :slight_smile: ):

You can of course change which directories you’re pointing to, but I would just go with my example for now until you feel more comfortable working in the shell :wink:

EDIT: Please also note, I DID create the directory: /home/username/madplay
So: mkdir /home/username/madplay

EDIT2: Bah… I tried making the package now and it complains about this:

:frowning:


#9

good news! I didn’t get the error! so i think i have madplay installed now! thanks a ton for your help

how can i verify that it’s actually installed though?


#10

Nice! Not sure how I’m getting that error at all… lol.
Anyways - you should be able to just run something like this, to see if it’s working properly:

(assuming /home/username/madplay/madplay is the location of the binary file)

Glad you got it going too! :slight_smile:


#11

ok looks like it install correctly. thanks

i’m now trying to figure out how to run a command from php like the following:

shell_exec(“madplay -q -o wave:$out -m -R 22050 $in”);

more simply, how do i run madplay from the command line as well?


#12

i seem to have figured out how to run it from the command line, which was great. but my php shell_exec function did not run correctly…


#13

never mind - i got that too!

thanks for all your help, you’ve been very helpful


#14

Glad you got it sorted out! :slight_smile: