in reply to [SOLVED] Build CPAN Module IO:Tty

"Why it is so hard to install a CPAN module?"

It isn't really

You say you've installed gcc, but are you sure you're not using the sun studio compiler here? cc: unrecognized option `-KPIC' looks suspicious to me. What does perl -V output? You should use the same compiler for perl modules as was used to compiler the version of perl you are running.

Perl 5.8.4 is very old. Consider building yourself a recent version from source, using gcc, installing to somewhere else, eg:

./Configure -des -Dprefix=$home/perl make test make install

So as not to mess around with the system perl which Solaris uses for various bits and bobs. Read the documentation for further installation advice.

You may also be interested in CPAN::Mini which you can use on a machine which does have internet access to create and maintain a portable mirror of CPAN for offline usage.

Replies are listed 'Best First'.
Re^2: Build CPAN Module IO:Tty
by psyk0tic (Novice) on Jul 16, 2010 at 11:36 UTC
    bash-3.00# perl -V Summary of my perl5 (revision 5 version 8 subversion 4) configuration: Platform: osname=solaris, osvers=2.10, archname=i86pc-solaris-64int uname='sunos localhost 5.10 i86pc i386 i86pc' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_T +S_ERRNO', optimize='-xO3 -xspace -xildoff', cppflags='' ccversion='Sun WorkShop', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='of +f_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags ='' libpth=/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-R /usr/ +perl5/5.8.4/lib/i86pc-solaris-64int/CORE' cccdlflags='-KPIC', lddlflags='-G' Characteristics of this binary (from libperl): Compile-time options: USE_64_BIT_INT USE_LARGE_FILES Locally applied patches: 22667 The optree builder was looping when constructing the ops + ... 22715 Upgrade to FileCache 1.04 22733 Missing copyright in the README. 22746 fix a coredump caused by rv2gv not fully converting a PV + ... 22755 Fix 29149 - another UTF8 cache bug hit by substr. 22774 [perl #28938] split could leave an array without ... 22775 [perl #29127] scalar delete of empty slice returned garb +age 22776 [perl #28986] perl -e "open m" crashes Perl 22777 add test for change #22776 ("open m" crashes Perl) 22778 add test for change #22746 ([perl #29102] Crash on assig +n ... 22781 [perl #29340] Bizarre copy of ARRAY make sure a pad op's + ... 22796 [perl #29346] Double warning for int(undef) and abs(unde +f) ... 22818 BOM-marked and (BOMless) UTF-16 scripts not working 22823 [perl #29581] glob() misses a lot of matches 22827 Smoke [5.9.2] 22818 FAIL(F) MSWin32 WinXP/.Net SP1 (x86/ +1 cpu) 22830 [perl #29637] Thread creation time is hypersensitive 22831 improve hashing algorithm for ptr tables in perl_clone: +... 22839 [perl #29790] Optimization busted: '@a = "b", sort @a' . +.. 22850 [PATCH] 'perl -v' fails if local_patches contains code s +nippets 22852 TEST needs to ignore SCM files 22886 Pod::Find should ignore SCM files and dirs 22888 Remove redundant %SIG assignments from FileCache 23006 [perl #30509] use encoding and "eq" cause memory leak 23074 Segfault using HTML::Entities 23106 Numeric comparison operators mustn't compare addresses o +f ... 23320 [perl #30066] Memory leak in nested shared data structur +es ... 23321 [perl #31459] Bug in read() 27722 perlio.c breaks on Solaris/gcc when > 256 FDs are availa +ble SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962 6663288 Upgrade to CGI.pm 3.33 REGEXP0 - fix for UTF-8 recoding in regexps - CVE-2007-5116 6758953 Perl Sys::Syslog can log messages with wrong severity Built under solaris Compiled at May 20 2009 22:16:00 @INC: /usr/perl5/5.8.4/lib/i86pc-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl

    It's interesting it shows Compiler: cc='cc', since I've modified it in the perl config files. Before that change I couldn't evem create the makefile as shown below:

    bash-3.00# perl Makefile.PL Now let's see what we can find out about your system (logfiles of failing tests are available in the conf/ dir)... ERROR: cannot run the configured compiler 'cc' (see conf/compilerok.log). Suggestions: 1) The complier 'cc' is not in your PATH. Add it to the PATH and try again. OR 2) The compiler isn't installed on your system. Install it. OR 3) You only have a different compiler installed (e.g. 'gcc'). Either fix the compiler config in the perl Config.pm or install a perl that was built with the right compiler (you could build perl yourself with the available compiler). Note: this is a system-administration issue, please ask your local admin for help. Thank you.

    But ok, at least now I know the source of the errors and a way to fix them.

    I'm gonna build a new perl as you advised, but I've one question: after building a new perl with gcc how will the system know which one to use? Trough the sheebang? If I want to use the newer just have to point the sheebang to the newer right?

    Thanks for the help marto.

      At work I have a perl installed on our solaris servers under /opt/nameofourdepartment/perl which we use. I have a couple of symlinks for perl and cpan so I know I'm calling the ones for the perl we use for our application. If you've made changes to the configuration of the Solaris perl install, I'd suggest undoing them. Hope this helps.