LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   perl module installation (http://www.linuxquestions.org/questions/linux-software-2/perl-module-installation-92631/)

init-5 09-14-2003 06:08 AM

perl module installation
 
Hi everybody,
I have a program called ImageMagick installed on a Linux server. I wanted to know if I had the perl module of ImageMagick, so I ran this command - slocate .so | grep perl

But I did not find anything that was related to ImageMagick. So I downloaded PerlMagick, which is the Perl module for ImageMagick, and created a directory for it under the ImageMagick directory, and then, included the paths for the Magick libraries (/usr/lib) in the INC and LIBS values.

Next I generates a Makefile by doing this -
perl Makefile

and then I did a - make

However it gave me this error -

[root@mydomain PerlMagick-5.56]# make
gcc -c -I../ -I.. -I/usr/include/freetype2 -D_FILE_OFFSET_BITS=64 -D_REENTRANT -I/usr/X11R6/include -I/usr/include/libxml2 -I/usr/lib -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -march=i386 -mcpu=i686 -g -DVERSION=\"5.56\" -DXS_VERSION=\"5.56\" -fPIC "-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE" -DHAVE_CONFIG_H Magick.c
/bin/sh: line 1: gcc: command not found
make: *** [Magick.o] Error 127

I inferred from this that I don't have gcc on the server.

So what do I do about it?

Linux version - 9

Thanks.

MasterC 09-14-2003 06:13 AM

You'll first need to install GCC and ALLLLLL of it's dependencies (there's a lot):
http://www.linuxquestions.org/questi...der=descending

The easiest way I'm aware of:
www.freshrpms.net
Grab/install apt and Synaptic, then use them to grab GCC and it's dependencies.

After that, instead of downloading perl modules and installing one by one, as root:
perl -MCPAN -e shell

Go through the one time setup, and then when you are done and arrive at a different looking command prompt, check the helpful for more info on using it. The quick and dirty:
install PerlMagick

That's the syntax, or should be if the CaSe is correct.

HTH

Cool

init-5 09-14-2003 06:33 AM

Hi,
Okay, I am a new comer to Linux, and I am working on someone's else Linux box, which is important, and don't want to ruin something, because I don't know how to do it.
I went to - http://gcc.gnu.org/install/ to figure out a way to get gcc, but it sounded to complex to try it on a sensitive Linux machine. Sensitive as in - important.
So I guess I'll have to find some other way out.

Moreover from what you have said, I figured that, the APT(advanced package tool) would need to be used with Synaptic, which is a graphical tool. However I am remotely logging into a Linux machine using SSH, and am not sure how the Graphical Tool will work on my system.
Also a lot of Perl modules are already installed. Again I don't know if I am right, but wont using the perl -MCPAN -e shell command overwrite them?

The issue here is that the Linux box is not an experimenting tool for me.

Any suggestions?
Thanks

MasterC 09-14-2003 06:37 AM

If you need to install the Perl module another way, that's no problem, simply introducing you to the Perl shell was my intentions, possibly to help ease the way ;)

And you don't HAVE to use Synaptic, that too was to ease the pain of the command line, but if you are ssh'ing, I'm going to assume you have a few tricks up your sleeve already ;) Anyway, Synaptic is just a front end to apt, so...

apt-get install gcc

Should do it. You can also look at other options, but that seems to be the most prevelant around these parts ;)

Cool

init-5 09-14-2003 06:45 AM

Hi,
Thanks for the excellent reply. But as usual, this opens up another set of questions. So essentially I will have to install apt. Just a little bit of help needed here. The instructions say that I should install APT as root by doing this -

rpm -Uvh apt-*

What I wanted to know was, which directory is this to be done in.
Also, the apt-get install gcc would install gcc, but where?

Thanks.

init-5 09-14-2003 06:46 AM

ps: i didnt understand what you meant by "but if you are ssh'ing, I'm going to assume you have a few tricks up your sleeve already"

MasterC 09-14-2003 06:54 AM

Quote:

Originally posted by init-5
Hi,
Thanks for the excellent reply. But as usual, this opens up another set of questions. So essentially I will have to install apt. Just a little bit of help needed here. The instructions say that I should install APT as root by doing this -

rpm -Uvh apt-*

What I wanted to know was, which directory is this to be done in.
Also, the apt-get install gcc would install gcc, but where?

Thanks.

rpm -Uvh apt-* is bad, instead, from the command line, use AUTOCOMPLETE. This is done by typing the first few letters of the file to be installed:
rpm -Uvh apt-TAB
And then pressing TAB, such as I have idicated above, if the file that is going to be installed is indeed in the directory you are in, then it should autocomplete at that time.

Which directory should this be done in?
Whatever directory you download the RPM to. It's suggested to consistently use the same directory, sort of your local 'repository' of RPMs. But you could get away with puting it anywhere you have write priv's ;)

Where does it get installed?
/usr/bin
However, that REALLY shouldn't matter to the average user. The main thing to note is that it gets installed into your system $PATH. This PATH variable is setup in /etc/profile as well as custom ones in your home directory in a file .bash_profile. Again, you don't need to worry about ANY of this, it's just an FYI kinda thing. To see your current PATH variable, at a prompt type:
echo $PATH
And it will list the directories it will search for binaries you should be able to execute as the current user.

HTH

Cool

MasterC 09-14-2003 06:55 AM

Quote:

Originally posted by init-5
ps: i didnt understand what you meant by "but if you are ssh'ing, I'm going to assume you have a few tricks up your sleeve already"
If you are:
1. SSH'ing
2. Into someone else's box;
3. On a system that is a production (or non-test) box...

I'd think you'd have a bit of feel for what's going on in the dark (the terminal). No worries though, this is after all, the place where "Newbies" come for help, so you are definitely in the right place ;)

Cool

init-5 09-14-2003 07:05 AM

Quote:

Originally posted by MasterC
If you are:
1. SSH'ing
2. Into someone else's box;
3. On a system that is a production (or non-test) box...

I'd think you'd have a bit of feel for what's going on in the dark (the terminal). No worries though, this is after all, the place where "Newbies" come for help, so you are definitely in the right place ;)

Cool

lol. well I still couldn't figure out what you meant by that. But just to clarify,

1) SSH'ing - because there's three ways to access the machine - SSH, FTP and a Web Based interface. I know UNIX commands so SSH'ing seems the easiest to figure out (whatever's happening in the dark).
2) Into someone else's box - its a dedicated web server with a hosting company which charges exorbitantly for installing software. And this box is owned by my friend.
3) On a system that is a production (or non-test) box - well, i guess its a non test box. :) Dont know what's a production box.

Your replies were awsome. Thanks a lot.

Cool :)

init-5 09-14-2003 07:07 AM

Quote:

Originally posted by MasterC

Which directory should this be done in?
Whatever directory you download the RPM to. It's suggested to consistently use the same directory, sort of your local 'repository' of RPMs. But you could get away with puting it anywhere you have write priv's ;)


Would (or actually) could this directory be - /usr/share since this is where ImageMagick and other softwares have been installed.

MasterC 09-14-2003 07:13 AM

Yes it 'could', but once you:
rpm -Uvh filename.rpm

A file, there is no need to keep the rpm around, the files will be copied to the system directories, and the RPM is simply taking up space. I suggest making a directory on your system for such things, maybe:
/usr/local/packages
OR
/usr/src/RPMS

?

Just ideas, but I tend to keep the old packages around 'just in case'. And because of that, I like to organize them in like packages, so RPMs (though I have none) would go in 1 directory, source in another, and so on. Mine are:
/home/packages (on my server)
/home/username/downloads (on my desktop)
Arbitrarily chosen, for no obvious reason.

Cool

init-5 09-14-2003 07:15 AM

apt-get install gcc

This command gives the following error:

Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package gcc

Well?

MasterC 09-14-2003 07:23 AM

Woohoo, :rolleyes:

Well then, I do believe you have to setup a repository first, if you haven't yet done so. Check the man page that should have been installed with apt.

Since you don't have means to get to the Gui, I can only hope that you don't have to go through the pain in the arse of installing via rpm:
rpm -Uvh file1.rpm file2.rpm... file843.rpm

Not really, but to see what I mean grab:
ftp://distro.ibiblio.org/pub/linux/d...2.2-5.i386.rpm

The GCC RPM, and try:
rpm -Uvh filename.rpm
Where filename.rpm is the actual filename you download. Then, checkout the list of dependencies on that pup!

You should be able to/can grab them from the mirror:
ftp://distro.ibiblio.org/pub/linux/d...6/RedHat/RPMS/
And if you do, install them all on one line:
rpm -Uvh file1.rpm file2.rpm

And so on. Alternatively, an easier way to install all files on the same line is to make sure all the files needing to be installed are in a seperate directory of their own, then change into that directory and:
rpm -Uvh *

:)

Good Luck!!!

Cool

init-5 09-14-2003 07:40 AM

It says it requires 3 dependencies. So, would rpm -Uvh 'ing these three dependencies require more dependencies?

Thanks.

init-5 09-14-2003 07:57 AM

Hi,
<Phew>
Just wanted to know that everything went great with GCC. Installed it. And then tried to run the Makefile for PerlMagick again and got hundreds of errors.
A sample =
Magick.xs:7679: `exception' undeclared (first use in this function)
Magick.xs:7684: `MaxTextExtent' undeclared (first use in this function)
Magick.xs:7684: dereferencing pointer to incomplete type
Magick.xs:7685: dereferencing pointer to incomplete type
Magick.xs:7686: `UndefinedException' undeclared (first use in this function)
Magick.xs: In function `XS_Image__Magick_Set':
Magick.xs:7799: `Image' undeclared (first use in this function)
Magick.xs:7814: `OptionError' undeclared (first use in this function)
Magick.xs: In function `XS_Image__Magick_Transform':
Magick.xs:7863: `ExceptionInfo' undeclared (first use in this function)
Magick.xs:7863: parse error before "exception"
Magick.xs:7869: `Image' undeclared (first use in this function)
Magick.xs:7870: `image' undeclared (first use in this function)
Magick.xs:7899: `OptionError' undeclared (first use in this function)
Magick.xs:7957: `exception' undeclared (first use in this function)
Magick.xs:7960: invalid lvalue in assignment
Magick.xs:7961: `UndefinedException' undeclared (first use in this function)
Magick.xs:7963: parse error before ')' token
Magick.xs:7967: request for member `next' in something not a structure or union
Magick.xs: In function `XS_Image__Magick_Write':
Magick.xs:8014: `MaxTextExtent' undeclared (first use in this function)
Magick.xs:8017: `Image' undeclared (first use in this function)
Magick.xs:8017: `image' undeclared (first use in this function)
Magick.xs:8018: `next' undeclared (first use in this function)
Magick.xs:8045: `OptionError' undeclared (first use in this function)
Magick.xs:8065: dereferencing pointer to incomplete type
Magick.xs:8065: dereferencing pointer to incomplete type


So, basically I am on square one.

Any more suggestions?
lol. I just need the Image:Magick module in Perl so that I can use it in the scripts.

Thanks


All times are GMT -5. The time now is 07:08 AM.