srp0010 has asked for the wisdom of the Perl Monks concerning the following question:

Hola Monks-

I am trying to install Cpan version of Net::SSH::Perl on a Solaris 10 system with Perl 5.10 from openCSW built with Sunpro compiler. I have access to the SunStudio 12.2 compiler. Should be close right?

The issue is in including the headers. I am wondering if there are compile flags for SunStudio to build this.

Example of errors:

/opt/csw/bin/perl /opt/csw/share/perl/5.10.1/ExtUtils/xsubpp -typemap + /opt/csw/ share/perl/5.10.1/ExtUtils/typemap -typemap typemap Blowfish.xs > Blow +fish.xsc & & mv Blowfish.xsc Blowfish.c /opt/SUNWspro/bin/cc -c -D_REENTRANT -xO3 -m32 -xarch=386 -xnorunpa +th -I/opt/ csw/bdb48/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSE +T_BITS=64 -xO3 -m32 -xarch=386 -xnorunpath -DVERSION=\"2.12\" -DXS_VERSION=\ +"2.12\" -K PIC "-I/opt/csw/lib/perl/5.10.1/CORE" Blowfish.c "/opt/csw/lib/perl/5.10.1/CORE/perl.h", line 605: cannot find include +file: <sys /types.h> "/opt/csw/lib/perl/5.10.1/CORE/perl.h", line 616: cannot find include +file: <std arg.h> "/opt/csw/lib/perl/5.10.1/CORE/perl.h", line 636: cannot find include +file: <cty pe.h> "/opt/csw/lib/perl/5.10.1/CORE/perl.h", line 648: cannot find include +file: <loc ale.h> "/opt/csw/lib/perl/5.10.1/CORE/perl.h", line 665: cannot find include +file: <set jmp.h> "/opt/csw/lib/perl/5.10.1/CORE/perl.h", line 671: cannot find include +file: <sys /param.h> .......

I have googled madly and tried to noodle compiler docs without avail. Its been quite a while since I've done something like this and I feel like I am missing the solution, document, pointer to build Net::SSH::Perl.

Solution

For SunStudio compiler make sure to install the complete package - bins and lib are in separate packages

For compilation set your path and lib path like so

PATH=/usr/bin:/sbin:/usr/local/bin LC_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib

For Solaris 10 OS make sure to install the full developers version to have the headers and libraries needed to intall Net::SSH::Perl

Math::Pari do not use pari-2.5 it is not supported for Sol10. I used 2.3 with success.

Replies are listed 'Best First'.
Re: Net::SSH::Perl compile with SunStudio 12.2 instead of SunPro
by salva (Canon) on Oct 25, 2011 at 16:16 UTC
    sys/types.h, stdarg.h, etc., are standard headers that your compiler should be able to find without any extra directive. Maybe you need to install some package containing them.

    Besides that, you can replace Net::SSH::Perl by Net::OpenSSH::Compat(::Perl) that doesn't need a compiler in order to be installed. It requires OpenSSH client but you can download it as a package from SUN Freeware.

      Switched to GCC, cleaned up and started again. Much better but fail to link libpari.so

      /opt/csw/gcc2/bin/gcc -o "/opt/csw/share/perl/.cpan/build/Math-Pari-2.01080605-cubJEW/pari-2.5.0/Osolaris-ix86"/libpari.so.2.5.0 -shared -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -fPIC -Wl,-G,-h,libpari.so.3 mp.o mpinl.o F2x.o FF.o Flx.o FpE.o FpV.o FpX.o Hensel.o QX_factor.o Qfb.o RgV.o RgX.o ZV.o ZX.o alglin1.o alglin2.o arith1.o arith2.o base1.o base2.o base3.o base4.o base5.o bb_group.o bibli1.o bibli2.o bit.o buch1.o buch2.o buch3.o buch4.o concat.o ellanal.o elliptic.o galconj.o gen1.o gen2.o gen3.o hnf_snf.o ifactor1.o lll.o nffactor.o perm.o polarit1.o polarit2.o polarit3.o prime.o random.o rootpol.o subcyclo.o subgroup.o trans1.o trans2.o trans3.o anal.o compat.o compile.o default.o errmsg.o es.o eval.o hash.o init.o intnum.o members.o paricfg.o pariinl.o parse.o sumiter.o DedekZeta.o aprcl.o elldata.o ellsea.o galois.o galpol.o groupid.o krasner.o kummer.o mpqs.o part.o stark.o subfield.o thue.o -lc -lm

      Text relocation remains referenced

      against symbol offset in file

      readonly_constants 0x1cc init.o

      readonly_constants 0x1d0 init.o

      ld: fatal: relocations remain against allocatable but non-writable sections

      collect2: ld returned 1 exit status

      Does anyone have a idea on how to solve this?

      Net::OpenSSH::Compat is nifty but doesn't support the current tools. The error here is: Invalid or bad combination of options ('batch_mode'). Need to debug why this is occurring. Tools do open several concurrent SSH sessions.

Re: Net::SSH::Perl compile with SunStudio 12.2 instead of SunPro
by mrstlee (Beadle) on Oct 25, 2011 at 16:14 UTC
    The compiler can't find ../sys/types.h in its list of known directories. I'd:
    find /opt -name 'types.h'
    to see where the headers actually are.
    You may then have to edit the Makefile.PL for Net::SSH::Perl to add the necessary -I statements to the compiler options.
    It may help to look at the ExtUtils::MakeMaker docs.

      Thanks for the reply. SunStudio splits libraries from the binaries - problem solved once I found the right solaris packages.

      Link errors now :-(.