LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   perl module installation (https://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

MasterC 09-14-2003 03:30 PM

I'd personally take my chances with the Perl shell at this point, but let's continue on for learnings sake ;)

As long as it's not ERRORING out, errors are fine and normal. However, if it is indeed erroring out, 9 times out of 10, it's a dependency resolving issue (which the cpan shell resolves most of the time ;) ). Sometimes, and it's rare, there is simply an error in the code itself, and you'll need to grab an alternate version of the software. If it's the latest stable, I'll usually go 1 up onto the unstable platform. On production equipment (that means things that are running actual servers, not home brewed units like a Desktop :) ) you might choose to go 1 down instead, but the error may still be there if it's not really a new release to fix that bug..

HTH

Very glad to see you got GCC installed/resolved, that can be one helluva brain fry for some people.

Cool

init-5 09-14-2003 04:24 PM

Quote:

Originally posted by MasterC
I'd personally take my chances with the Perl shell at this point, but let's continue on for learnings sake ;)

You mean, I should take chances with -

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


?
See, the only problem I have is that CGI Perl scripts are running great on the server, and I don't want to do something which would result in a change of some setting which is again going to take me a lifetime to troubleshoot. As it is I am getting to know about the things the hard way. :)

I got so fired up today morning, that after I stopped working on the Linux server, I actually downloaded the Solaris binaries and burnt them into CD's(from the Sun's website) and created a second partition on my AMD Athlon Laptop, dual booting it with XP. Got into hell with the display, since my latop would probe a display of 320 x 480 or something like that. So, I searched a few forums and came up with an answer - portking. Downloaded it, and well, now I have Solaris 9 running on my laptop, with a resolution of 800x600 having some 65000 colors. :P Next I have no idea, how to get this connected to the internet, but I'll try something.

However, back to the problem I have on-hand. I'll ask my friend if he wants me to do the Perl job for him. I guess if something goes wrong at the server, then the hosting company guys are going to charge helluva lot of dough to reset everthing back to normal!

Thank You.

ps: pardon my windowish vocab. i dont know what certain procedures and things-you-do-to-the-system are said in Linux/Unix.

init-5 09-16-2003 06:20 PM

recursive dependencies??
 
Here's what I get when I am trying to install XFree86 -

[root@mydomain x]# rpm -Uvh XFree86-4.3.0-2.i386.rpm

warning: XFree86-4.3.0-2.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

error: Failed dependencies:
/usr/X11R6/bin/xauth is needed by XFree86-4.3.0-2
Glide3 >= 20010520 is needed by XFree86-4.3.0-2
XFree86-base-fonts = 4.3.0 is needed by XFree86-4.3.0-2
xinitrc is needed by XFree86-4.3.0-2

And then if I try to install its dependencies, I get the following error -

[root@mydomain x]# rpm -Uvh XFree86-xauth-4.3.0-2.i386.rpm Glide3-20010520-25.i386.rpm XFree86-base-fonts-4.3.0-2.i386.rpm xinitrc-3.32-1.noarch.rpm

warning: XFree86-xauth-4.3.0-2.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

error: Failed dependencies:
XFree86 is needed by xinitrc-3.32-1
switchdesk >= 3.7 is needed by xinitrc-3.32-1


So, Xfree86 needs xinitrc and xinitrc needs XFree86??
I am trying to install XFree86 on a remote linux box so that I can install VNC. I am SSHing into RHL 9.
Am I doing something wrong here?

Thank You.

MasterC 09-16-2003 08:53 PM

I don't think that XFree86-xauth is the same as plain old XFree86.

HTH

Cool

neo77777 09-16-2003 09:42 PM

and on the other note of installing perl modules,
perl -MCPAN -e shell
is the greatest way to do perl things installed, sort of apt-get for perl, but if you are doubtful of ots potentional running make in the module directory isn't the first step
perl Makefile.PL
is the first step, then you run
make
make test (optional)
make install (as superuser)

init-5 09-17-2003 12:56 AM

Quote:

Originally posted by MasterC
I don't think that XFree86-xauth is the same as plain old XFree86.

HTH

Cool

the Xfree86-auth is not the problem here.
its xinitrc which need xfree86 and xfree86 which needs xinitrc

MasterC 09-17-2003 11:27 AM

Right, but you'd satisfy that if Xfree was the RPM you were installing on the same line as xinitrc.

Cool

init-5 09-17-2003 07:30 PM

So, you want me to install all 5 on the same line?

/usr/X11R6/bin/xauth is needed by XFree86-4.3.0-2

Glide3 >= 20010520 is needed by XFree86-4.3.0-2

XFree86-base-fonts = 4.3.0 is needed by XFree86-4.3.0-2

xinitrc is needed by XFree86-4.3.0-2

and the package that I am originally trying to install -

XFree86-4.3.0-2

Thanks.

MasterC 09-17-2003 07:37 PM

Correct.

Cool

init-5 09-17-2003 07:57 PM

Hi, trying to resolve one of the infinite dependencies -
ERROR -

[root@mydomain x]# rpm -Uvh desktop-file-utils-0.3-5.src.rpm
warning: desktop-file-utils-0.3-5.src.rpm: V3 DSA signature: NOKEY, key ID db42a60e
error: cannot create %sourcedir /usr/src/redhat/SOURCES


Any idea?

I am installing "desktop-file-utils-0.3-5.src.rpm" so that I can install "switchdesk" so that I can install "xinitrc" so that I can install "XFree86" so that I can finally install "VNC".

MasterC 09-18-2003 12:42 AM

.src.rpm is not a file that you typically install like that. With srpms you tend to rebuild them first, then install the binary RPM that is produced from it:
rpm --rebuild
However it would seem that RedHat has decided to discontinue that as an option in their latest version of RPM yet not remove it from the man page... So, you'll want to hunt down a binary release of that file.

Still, by far, the easiest way to resolve dependencies with RPM's is apt with Synaptic, since you aren't in a gui, apt should do just fine.

Cool

tongueroo 10-25-2004 04:14 AM

Im having the same problem
 
Im having the same problem when I try to install PerlMagick.

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)

Has anyone found a solution to this problem?

Tung


All times are GMT -5. The time now is 07:34 PM.