Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Problem installing perl modules

by kraas (Novice)
on Sep 12, 2007 at 17:05 UTC ( [id://638615]=perlquestion: print w/replies, xml ) Need Help??

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

I've been having problems installing a few perl modules from CPAN on a solaris 9 server. They all seem to be failing the 'make' command in a similar manner. Here is one example, Crypt::Blowfish.
bash-3.1# make cc -c -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DUSE_SITECUSTOMIZE -D +NO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"2.10\" -DX +S_VERSION=\"2.10\" -KPIC "-I/opt/ActivePerl-5.8/lib/CORE" Blowfish.c cc: unrecognized option `-KPIC' In file included from /opt/ActivePerl-5.8/lib/CORE/perl.h:420, from Blowfish.xs:9: /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:27:2 +6: sys/isa_defs.h: No such file or directory /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:28:3 +1: sys/feature_tests.h: No such file or directory /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:33:2 +7: sys/machtypes.h: No such file or directory /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:45:2 +7: sys/int_types.h: No such file or directory In file included from /opt/ActivePerl-5.8/lib/CORE/perl.h:420, from Blowfish.xs:9: /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:204: + error: syntax error before "pad64_t" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:205: + error: syntax error before "upad64_t" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:371: + error: syntax error before "uint16_t" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:373: + error: syntax error before "__pthread_mutex_ceiling" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:374: + error: syntax error before "__pthread_mutex_type" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:375: + error: syntax error before "__pthread_mutex_magic" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:379: + error: syntax error before "uint8_t" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:382: + error: syntax error before "uint32_t" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:385: + error: syntax error before "__pthread_mutex_owner64" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:387: + error: syntax error before "__pthread_mutex_data" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:392: + error: syntax error before "uint8_t" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:394: + error: syntax error before "__pthread_cond_magic" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:396: + error: syntax error before "__pthread_cond_data" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:403: + error: syntax error before "int32_t" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:405: + error: syntax error before "__pthread_rwlock_magic" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:406: + error: syntax error before "__pthread_rwlock_mutex" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:407: + error: syntax error before "__pthread_rwlock_readercv" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:408: + error: syntax error before "__pthread_rwlock_writercv" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:436: + error: syntax error before "upad64_t" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:573: +24: sys/select.h: No such file or directory In file included from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/perl.h:451:19: ctype.h: No such file or d +irectory /opt/ActivePerl-5.8/lib/CORE/perl.h:463:23: locale.h: No such file or +directory /opt/ActivePerl-5.8/lib/CORE/perl.h:480:20: setjmp.h: No such file or +directory /opt/ActivePerl-5.8/lib/CORE/perl.h:486:26: sys/param.h: No such file +or directory /opt/ActivePerl-5.8/lib/CORE/perl.h:491:23: stdlib.h: No such file or +directory /opt/ActivePerl-5.8/lib/CORE/perl.h:496:23: unistd.h: No such file or +directory /opt/ActivePerl-5.8/lib/CORE/perl.h:776:23: string.h: No such file or +directory /opt/ActivePerl-5.8/lib/CORE/perl.h:925:27: netinet/in.h: No such file + or directory /opt/ActivePerl-5.8/lib/CORE/perl.h:929:26: arpa/inet.h: No such file +or directory /opt/ActivePerl-5.8/lib/CORE/perl.h:939:25: sys/stat.h: No such file o +r directory /opt/ActivePerl-5.8/lib/CORE/perl.h:968:25: sys/time.h: No such file o +r directory /opt/ActivePerl-5.8/lib/CORE/perl.h:975:27: sys/times.h: No such file +or directory /opt/ActivePerl-5.8/lib/CORE/perl.h:982:19: errno.h: No such file or d +irectory /opt/ActivePerl-5.8/lib/CORE/perl.h:997:25: sys/socket.h: No such file + or directory /opt/ActivePerl-5.8/lib/CORE/perl.h:1024:21: netdb.h: No such file or +directory /opt/ActivePerl-5.8/lib/CORE/perl.h:1127:24: sys/ioctl.h: No such file + or directory /opt/ActivePerl-5.8/lib/CORE/perl.h:1156:23: dirent.h: No such file or + directory /opt/ActivePerl-5.8/lib/CORE/perl.h:1195:22: sys/mode.h: No such file +or directory In file included from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/in +clude/limits.h:11, from /opt/ActivePerl-5.8/lib/CORE/perl.h:1510, from Blowfish.xs:9: /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/syslimits.h:29:2 +8: iso/limits_iso.h: No such file or directory /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/syslimits.h:41:2 +8: sys/int_limits.h: No such file or directory In file included from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/perl.h:1588:23: ieeefp.h: No such file or + directory In file included from /opt/ActivePerl-5.8/lib/CORE/perl.h:2120, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/handy.h:136:25: inttypes.h: No such file +or directory In file included from /opt/ActivePerl-5.8/lib/CORE/perl.h:2284, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/unixish.h:106:21: signal.h: No such file +or directory In file included from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/perl.h:2421:33: pthread.h: No such file o +r directory In file included from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/perl.h:2424: error: syntax error before " +perl_mutex" /opt/ActivePerl-5.8/lib/CORE/perl.h:2424: warning: data definition has + no type or storage class /opt/ActivePerl-5.8/lib/CORE/perl.h:2425: error: syntax error before " +perl_cond" /opt/ActivePerl-5.8/lib/CORE/perl.h:2425: warning: data definition has + no type or storage class In file included from /opt/ActivePerl-5.8/lib/CORE/perlio.h:65, from /opt/ActivePerl-5.8/lib/CORE/iperlsys.h:51, from /opt/ActivePerl-5.8/lib/CORE/perl.h:2733, from Blowfish.xs:9: /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:36:27: i +so/stdio_iso.h: No such file or directory In file included from /opt/ActivePerl-5.8/lib/CORE/perlio.h:65, from /opt/ActivePerl-5.8/lib/CORE/iperlsys.h:51, from /opt/ActivePerl-5.8/lib/CORE/perl.h:2733, from Blowfish.xs:9: /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:194: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:229: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:230: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:236: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:258: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:260: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:269: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:270: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:271: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:272: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:274: err +or: syntax error before "FILE" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:284: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:293: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:294: err +or: syntax error before "FILE" /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:295: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:303: err +or: syntax error before '*' token /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/stdio.h:304: err +or: syntax error before '*' token In file included from /opt/ActivePerl-5.8/lib/CORE/iperlsys.h:51, from /opt/ActivePerl-5.8/lib/CORE/perl.h:2733, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/perlio.h:259: error: syntax error before +'*' token /opt/ActivePerl-5.8/lib/CORE/perlio.h:262: error: syntax error before +'*' token /opt/ActivePerl-5.8/lib/CORE/perlio.h:262: warning: data definition ha +s no type or storage class /opt/ActivePerl-5.8/lib/CORE/perlio.h:265: error: syntax error before +'*' token /opt/ActivePerl-5.8/lib/CORE/perlio.h:265: warning: data definition ha +s no type or storage class /opt/ActivePerl-5.8/lib/CORE/perlio.h:268: error: syntax error before +"FILE" In file included from /opt/ActivePerl-5.8/lib/CORE/perl.h:2747, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/sv.h:389: error: syntax error before "DIR +" /opt/ActivePerl-5.8/lib/CORE/sv.h:389: warning: no semicolon at end of + struct or union /opt/ActivePerl-5.8/lib/CORE/sv.h:389: warning: no semicolon at end of + struct or union /opt/ActivePerl-5.8/lib/CORE/sv.h:391: error: syntax error before '}' +token /opt/ActivePerl-5.8/lib/CORE/sv.h:391: warning: data definition has no + type or storage class /opt/ActivePerl-5.8/lib/CORE/sv.h:405: error: syntax error before '}' +token In file included from /opt/ActivePerl-5.8/lib/CORE/op.h:497, from /opt/ActivePerl-5.8/lib/CORE/perl.h:2754, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/reentr.h:72:20: pwd.h: No such file or di +rectory /opt/ActivePerl-5.8/lib/CORE/reentr.h:75:20: grp.h: No such file or di +rectory /opt/ActivePerl-5.8/lib/CORE/reentr.h:85:26: crypt.h: No such file or +directory /opt/ActivePerl-5.8/lib/CORE/reentr.h:90:27: shadow.h: No such file or + directory In file included from /opt/ActivePerl-5.8/lib/CORE/op.h:497, from /opt/ActivePerl-5.8/lib/CORE/perl.h:2754, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/reentr.h:624: error: field `_grent_struct +' has incomplete type /opt/ActivePerl-5.8/lib/CORE/reentr.h:635: error: field `_hostent_stru +ct' has incomplete type /opt/ActivePerl-5.8/lib/CORE/reentr.h:654: error: field `_netent_struc +t' has incomplete type /opt/ActivePerl-5.8/lib/CORE/reentr.h:669: error: field `_protoent_str +uct' has incomplete type /opt/ActivePerl-5.8/lib/CORE/reentr.h:684: error: field `_pwent_struct +' has incomplete type /opt/ActivePerl-5.8/lib/CORE/reentr.h:695: error: field `_servent_stru +ct' has incomplete type /opt/ActivePerl-5.8/lib/CORE/reentr.h:710: error: field `_spent_struct +' has incomplete type /opt/ActivePerl-5.8/lib/CORE/reentr.h:721: error: field `_gmtime_struc +t' has incomplete type /opt/ActivePerl-5.8/lib/CORE/reentr.h:724: error: field `_localtime_st +ruct' has incomplete type In file included from /opt/ActivePerl-5.8/lib/CORE/perl.h:2759, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/scope.h:232: error: syntax error before " +jmp_buf" /opt/ActivePerl-5.8/lib/CORE/scope.h:232: warning: no semicolon at end + of struct or union /opt/ActivePerl-5.8/lib/CORE/scope.h:239: error: syntax error before ' +}' token In file included from /opt/ActivePerl-5.8/lib/CORE/perl.h:3882, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/thrdvar.h:85: error: field `Tstatbuf' has + incomplete type /opt/ActivePerl-5.8/lib/CORE/thrdvar.h:86: error: field `Tstatcache' h +as incomplete type /opt/ActivePerl-5.8/lib/CORE/thrdvar.h:91: error: field `Ttimesbuf' ha +s incomplete type /opt/ActivePerl-5.8/lib/CORE/thrdvar.h:140: error: field `Tstart_env' +has incomplete type In file included from /opt/ActivePerl-5.8/lib/CORE/perl.h:3951, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/proto.h:298: error: syntax error before " +off64_t" /opt/ActivePerl-5.8/lib/CORE/proto.h:300: error: syntax error before " +Perl_do_sysseek" /opt/ActivePerl-5.8/lib/CORE/proto.h:300: error: syntax error before " +off64_t" /opt/ActivePerl-5.8/lib/CORE/proto.h:300: warning: data definition has + no type or storage class /opt/ActivePerl-5.8/lib/CORE/proto.h:301: error: syntax error before " +Perl_do_tell" /opt/ActivePerl-5.8/lib/CORE/proto.h:302: warning: data definition has + no type or storage class /opt/ActivePerl-5.8/lib/CORE/proto.h:1457: error: syntax error before +'*' token /opt/ActivePerl-5.8/lib/CORE/proto.h:1457: error: syntax error before +"DIR" /opt/ActivePerl-5.8/lib/CORE/proto.h:1459: warning: data definition ha +s no type or storage class /opt/ActivePerl-5.8/lib/CORE/proto.h:2005: error: syntax error before +"Perl_PerlIO_tell" /opt/ActivePerl-5.8/lib/CORE/proto.h:2005: warning: data definition ha +s no type or storage class /opt/ActivePerl-5.8/lib/CORE/proto.h:2006: error: syntax error before +"off64_t" In file included from /opt/ActivePerl-5.8/lib/CORE/perl.h:3989, from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/perlvars.h:48: error: syntax error before + "PL_op_mutex" /opt/ActivePerl-5.8/lib/CORE/perlvars.h:48: warning: data definition h +as no type or storage class /opt/ActivePerl-5.8/lib/CORE/perlvars.h:52: error: syntax error before "PL_dollarzero_mutex" /opt/ActivePerl-5.8/lib/CORE/perlvars.h:52: warning: data definition h +as no type or storage class In file included from Blowfish.xs:9: /opt/ActivePerl-5.8/lib/CORE/perl.h:4486:24: sys/ipc.h: No such file o +r directory /opt/ActivePerl-5.8/lib/CORE/perl.h:4487:24: sys/sem.h: No such file o +r directory /opt/ActivePerl-5.8/lib/CORE/perl.h:4604:21: fcntl.h: No such file or +directory In file included from /opt/ActivePerl-5.8/lib/CORE/perlapi.h:39, from /opt/ActivePerl-5.8/lib/CORE/XSUB.h:349, from Blowfish.xs:10: /opt/ActivePerl-5.8/lib/CORE/perlvars.h:48: error: syntax error before + '*' token /opt/ActivePerl-5.8/lib/CORE/perlvars.h:48: warning: data definition h +as no type or storage class /opt/ActivePerl-5.8/lib/CORE/perlvars.h:52: error: syntax error before + '*' token /opt/ActivePerl-5.8/lib/CORE/perlvars.h:52: warning: data definition h +as no type or storage class make: *** [Blowfish.o] Error 1
This "cc: unrecognized option `-KPIC'" shows up in all the failures. When I try to install using 'perl -MCPAN -e shell I get basically the same thing. Before trying this I installed 'make' and gcc and I replaced the 'cc' file located in /usr/ucb/cc with a symlink pointing to the gcc executable. I am using ActivePerl v5.8.8.

Replies are listed 'Best First'.
Re: Problem installing perl modules
by almut (Canon) on Sep 12, 2007 at 18:48 UTC

    My guess would be that your ActivePerl hasn't been built with gcc, but rather with the system cc.  Perl extension modules must generally be built with the same compiler / compiler options as the Perl binary itself, which is why Perl "remembers" those settings (do a "perl -V" to check yourself). That's most likely where the system cc specific -KPIC option originates from. The respective gcc option would in theory be -fPIC, however, simply substituting one for the other is probably not going to get you very far, as this is not the only difference between the two compilers...

    In short, I think your options are

    • get hold of Sun's system compiler, and try again with that (but do a "perl -V" to verify my theory, before investing too much effort...)
    • build Perl yourself from scratch, using gcc
    • install binary packages pre-built for ActivePerl 5.8.8 (if available)
      I did a 'perl -V' on the system I am trying to install on, and another system where I previously installed the same modules without incident, and they were the same.

      So if I have to remove my existing ActivePerl installation and start over, how do I make sure it uses gcc?

      Thanks everyone for your help so far.
        I did a 'perl -V' ...

        What does it say? (I don't have an ActivePerl for Solaris installed here, so I can't check myself.)

Re: Problem installing perl modules
by hilitai (Monk) on Sep 12, 2007 at 18:00 UTC
    You might want to stick 'readmore' tags around all that output, btw.

    If you're seeing '-KPIC', I think that means that the installer thinks you're using Solaris's native cc, and therefore is passing in flags that are meaningful for it. Unfortunately, those flags don't mean much to gcc.

    Probably related to that, it looks like gcc can't find the standard system include paths. You might try compiling a simple C program (that pulls in some standard include files) and see if that works first.

Re: Problem installing perl modules
by rah (Monk) on Sep 13, 2007 at 03:24 UTC

    You didn't say much about your version of Solaris, but I would let compiler availability dictate which direction to take. A full-featured compiler used to be a costly add-on for Solaris (then again Solaris didn't used to be FOSS!). I'm thinking that since you appear to have gcc installed already, I'd build perl from source using gcc.

    In my experience Blowfish can be tough to build and has a lot of dependencies that can also be tricky - other Crypt modules, SHA-1, etc. The more complete your development environment the better luck you'll have negotiating all of those builds. Since the Sun package may not be readily available, gcc may be your best bet, but there are still other factors to consider. Do you need to deploy this on other machines? Do those machines have development tools, etc.?

Re: Problem installing perl modules
by superfrink (Curate) on Sep 12, 2007 at 18:22 UTC
    I am guessing but maybe try running "gmake" instead of "make".
Re: Problem installing perl modules
by goibhniu (Hermit) on Sep 12, 2007 at 17:40 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://638615]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-12-14 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (70 votes). Check out past polls.