Operating System - HP-UX
1822143 Members
3682 Online
109640 Solutions
New Discussion юеВ

Perl: How to add a new CPAN module

 
David_246
Trusted Contributor

Perl: How to add a new CPAN module

Hi,

I just downloaded Graph.pm as I would like to use : GD::GRAPH::lines in my perl script.
Now I read some docu, but I really can't figure out how to make it work. I copied over the file to my : /opt/perl/lib/5.8.0/PA-RISC2.0
directory.
Any help will be much apreciated !!

Regs David
@yourservice
5 REPLIES 5
Uday_S_Ankolekar
Honored Contributor

Re: Perl: How to add a new CPAN module

OK here is the process..

Unzip the file ( this will give you a tar file)

Untar the file, This will create a directory. Make that dir as your current directory.

MANIFEST,README and Todo files will be there It is better you read these files before you go further.
This will tell you what platform scripts has been tested and about the demo scripts.
then,
#perl Makefile.PL: verifies all the files destributed with the module this will create makefile to compile module

then ,
run make this will use makefile to compile the programs
make terst will verify for any problems.

and lastly run make install : this will move the executables to the directory required for the module.
man pages wil also be installed in proper directory update MANPATH accordingly

-USA..
Good Luck..
A. Clay Stephenson
Acclaimed Contributor

Re: Perl: How to add a new CPAN module

I haven't installed your particular module but it's usuaaly very simple.

1) Uncompress/Untar the module to a temp directory.

2) Cd to that temp dir.

3) perl Makefile.PL
make
make test
make install

You are done. This procedure works for the vast majority of modules but there will always be a README or TODO in the temp dir for any other instructions. In General, the make's will even install the man pages for you.


http://www.perl.com/CPAN/modules/INSTALL.html
If it ain't broke, I can fix that.
David_246
Trusted Contributor

Re: Perl: How to add a new CPAN module

Hi,

Thanks for your help, indeed I overlooked something that works now. GD has a beautifull README, not.
It tells you to install zlib (easy doing) and libpng (NOT easy doing). I get very anoying compiling errors when running a make test. I downloaded Merijn's precompiled gcc, and now it gives me a short but clear --> do it yourself <-- message.

I did modify the makefile for pointing to the correct gcc and the correct dir for zlib.
Any ideas ??

Regs David

/usr/local/libpng 1# make test
/usr/local/pa20_32/bin/gcc -I/usr/local/zlib/include -O -Ae +DA1.1 +DS2.0 -c pngtest.c
gcc: +DA1.1: No such file or directory
gcc: +DS2.0: No such file or directory
:4:2: missing '(' after predicate
*** Error exit code 1

Stop.
@yourservice
H.Merijn Brand (procura
Honored Contributor

Re: Perl: How to add a new CPAN module

The options you see are for HP C-ANSI-C, and are not recognized by gcc.

You better use the same (type of) compiler for your modules that was used to build perl. You can check what perl was built with like

a5:/u/usr/merijn 102 > /opt/perl64/bin/perl -V:cc -V:ccversion -V:gccversion
cc='gcc64';
ccversion='';
gccversion='3.3 20030414 (prerelease)';
a5:/u/usr/merijn 103 > /opt/perl/bin/perl -V:cc -V:ccversion -V:gccversion
cc='gcc';
ccversion='';
gccversion='3.2 20020801 (prerelease)';
a5:/u/usr/merijn 104 > /pro/bin/perl -V:cc -V:ccversion -V:gccversion
cc='cc';
ccversion='B.11.11.25985.GP';
gccversion='';
a5:/u/usr/merijn 105 >

The version of gcc/cc is less important than the type, though mixing gcc-2.x with gcc-3.x is not a good idea.

If Makefile.PL is consistent in adding +D like options to gcc, run each command manually (yeah that's a nuisance) and change +DA2.0 to -mpa-risc-2-0 and +DA1.1 to -mpa-risc-1-1, and just drop -Ae and other +D options. You can also change the generated Makefile.

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
David_246
Trusted Contributor

Re: Perl: How to add a new CPAN module

HI Merijn,

Thanks for the help.
The anoying thing is that I downloaded my perl and gcc from some sort of Merijns ITRC page :)
So I think you better tell me what version of gcc perl is compiled with, no just kidding.
I'll try to find out, using your explanation. Hope this will ever start working.

Normaly these kind of problems die slowly as I drown in the new errors and ways off make things work. I'll keep asking you if you don't mind.

Groetjes David
@yourservice