-   Programming (
-   -   "cc1: error: invalid option 'tune=i686'" while installing Perl modules via CPAN (

scuzzman 02-20-2006 01:14 AM

"cc1: error: invalid option 'tune=i686'" while installing Perl modules via CPAN
For some reason I am no longer able to install Perl modules via CPAN. I'm getting a consistent error message everytime I try to install something, regardless of what it is (which leads me to think it's a library issue), and Google turns up absolutely nothing useful that I've found. For instance, I'm trying to install the Gtk module to build a front-end for a program I'm working on. This is what takes place:

/usr/X11R6/include  -I./Gtk -I./build -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -march=i486 -mtune=i686  -DVERSION=\"0.7000\" -DXS_VERSION=\"0.7000\" -fPIC "-I/usr/lib/perl5/5.8.8/i486-linux/CORE"  -DPERL_POLLUTE -DGTK_HVER=0x01020a build/GtkDefs.c
cc1: error: invalid option `tune=i686'
cc1: error: unrecognized option `-Wdeclaration-after-statement'
make: *** [build/GtkDefs.o] Error 1
  /usr/bin/make  -- NOT OK
Running make test
  Can't test without successful make
Running make install
  make had returned bad status, install seems impossible


I'm then returned to a cpan> prompt (like above) and that's that. I tried using cpanp which I've read works a little better, but it gets to "Installing Gtk..." and freezes. Any help with this is greatly appreciated.

jxi 02-20-2006 07:19 PM

have you tried -
1) checking / rebuilding your config file OR
2) installing module (which is failing as above ) by hand?

On 1) : for CPAN , locate
in my setup its at $HOME/.cpan/CPAN
is there a value for the hash key 'make_arg' ? (just a guess)

however I'm confused about a few things: you also tried cpanp (front end to CPANPLUS)? Did you install that
successfully via CPAN? (And i assume CPANPLUS would have also been installed). And, if CPANPLUS was installed
, could you have made the same error in the config setup (maybe my hunch above is totally off)?

Regarding 2)
How about simply downloading a module, say IO::Prompt, and then going to the build directory and installing
by hand. Usually it's perl Makefile.PL; make ; su -c 'make install' but follow the directions per the README.
(there's also the newer build method).

scuzzman 02-21-2006 09:51 AM

I've rebuilt the config file from within cpan, and I've checked it for 'tune', it's not present. Just in case though, here is my

[scuzzy@slackdell /usr/lib/perl5/5.8.8/CPAN]$ ls -l
-rw-rw-r--  1 root cpan 1602 2006-02-18 20:08
[scuzzy@slackdell /usr/lib/perl5/5.8.8/CPAN]$ cat

# This is's systemwide configuration file. This file provides
# defaults for users, and the values can be changed in a per-user
# configuration file. The user-config file is being looked for as
# ~/.cpan/CPAN/

$CPAN::Config = {
  'build_cache' => q[1024],
  'build_dir' => q[/usr/cpan/build],
  'cache_metadata' => q[1],
  'cpan_home' => q[/usr/cpan],
  'dontload_hash' => {  },
  'ftp' => q[/bin/ftp],
  'ftp_proxy' => q[],
  'getcwd' => q[cwd],
  'gpg' => q[/usr/bin/gpg],
  'gzip' => q[/usr/bin/gzip],
  'histfile' => q[/usr/cpan/histfile],
  'histsize' => q[100],
  'http_proxy' => q[],
  'inactivity_timeout' => q[0],
  'index_expire' => q[1],
  'inhibit_startup_message' => q[0],
  'keep_source_where' => q[/usr/cpan/sources],
  'lynx' => q[/usr/bin/lynx],
  'make' => q[/usr/bin/make],
  'make_arg' => q[],
  'make_install_arg' => q[],
  'makepl_arg' => q[],
  'ncftpget' => q[/usr/bin/ncftpget],
  'no_proxy' => q[],
  'pager' => q[/usr/bin/less],
  'prerequisites_policy' => q[follow],
  'scan_cache' => q[atstart],
  'shell' => q[/usr/bin/bash],
  'tar' => q[/usr/bin/tar],
  'term_is_latin' => q[1],
  'unzip' => q[/usr/bin/unzip],
  'urllist' => [q[], q[], q[], q[], q[], q[], q[], q[], q[], q[]],
  'wget' => q[/usr/bin/wget],
[scuzzy@slackdell /usr/lib/perl5/5.8.8/CPAN]$

As you've probably guessed, I have scuzzy as a member of the cpan group ;)
It is quite curious, now that you mention it, that I was able to build cpanp. I've just tried building the Term::ReadKey module (a dependency of IO::Prompt), and it failed with this (the same errors as with CPAN):

[scuzzy@slackdell /home/scuzzy/tarball/TermReadKey-2.30]$ make test
cp blib/lib/Term/
AutoSplitting blib/lib/Term/ (blib/lib/auto/Term/ReadKey)
/usr/bin/perl5.8.8 -I/usr/lib/perl5/5.8.8

Writing termio/termios section of cchars.h... Done.
Checking for sgtty...
        Sgtty NOT found.
Writing sgtty section of cchars.h... Done.
/usr/bin/perl5.8.8 /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -noprototypes -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap  ReadKey.xs > ReadKey.xsc && mv ReadKey.xsc ReadKey.c
cc -c  -I/usr/include/bsd -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -march=i486 -mtune=i686  -DVERSION=\"2.30\" -DXS_VERSION=\"2.30\" -fPIC "-I/usr/lib/perl5/5.8.8/i486-linux/CORE"  ReadKey.c
cc1: error: invalid option `tune=i686'
cc1: error: unrecognized option `-Wdeclaration-after-statement'
make: *** [ReadKey.o] Error 1
[scuzzy@slackdell /home/scuzzy/tarball/TermReadKey-2.30]$

I just remembered that I upgraded gcc a couple of weeks ago (had to because I upgraded KDE) and haven't tried to install a Perl module since. Perhaps this is what's causing it - a problem with gcc? If it helps any: gcc is working fine - I can still compile C applications. I've done a few searches though, and can't find anything related...

jxi 02-21-2006 04:03 PM

a few more things to try -

which make does perl use (should be same as in Config above!):
perl -V:make

run this perl script:


#!/usr/bin/perl -w
@keys  = keys %ENV;
@values = values %ENV;
while (@keys) {
    print pop(@keys), '=', pop(@values), "\n";

pipe it into more, less or redirect to a file. Check the environmental settings.

as for a problem with gcc, it don't think gcc gets involved in the make step when the makefile was generated by perl, e.g.,

perl Makefile.PL #builds a makefile for the perl interpreter.#

#make by itself is compiler/interpreter independent#

instead of using the make, try with Module::Build from cpan.

(sorry i can;t remember if it needs `make` to be installed itself)


Tinkster 02-21-2006 04:59 PM

Did you play around with .bashrc and have set some stuff
in CFLAGS that the compiler doesn't like?


scuzzman 02-22-2006 09:17 AM

It doesn't appear I have that, Tink... The only line in my ~/.bashrc is my "export PS1=..." line... TBH, I don't know what this file is for... or any of the bash* files in my ~.
As for CFLAGS, there is no definition for that, and I don't know where I would find one (didn't adjust it - I'm sure of that).

As for the above Perl script and command, here are the results:

[scuzzy@slackdell /home/scuzzy/devel/perl]$ ./
LS_OPTIONS= --color=auto -F -b -T 0
PS1=[\u@\h $PWD]$
[scuzzy@slackdell /home/scuzzy/devel/perl]$ perl -V:make
[scuzzy@slackdell /home/scuzzy/devel/perl]$

It doesn't have a CFLAGS defined, nor is there anything in there about make...

Edit: just installed Module::Build with a typical "perl Makefile.PL && make && sudo make install"

jxi 02-22-2006 09:29 AM


just installed Module::Build with a typical "perl Makefile.PL && make && sudo make install"
Excellent! Now, in a downloaded package's folder, you can use:
perl Build.PL
./Build test
./Build install

(perhaps you've already tried it!)

scuzzman 02-23-2006 12:26 PM

Sorry for the delay, had a few things happening... This is what takes place though:
When I cd to a package I've downloaded and type 'perl Build.PL' this happens:

[scuzzy@slackdell /home/scuzzy/tarball/TermReadKey-2.30]$ perl Build.PL
Can't open perl script "Build.PL": No such file or directory

So, I thought I had to specify the Build.PL in the directory of the Module-Build, so I did this:

[scuzzy@slackdell /home/scuzzy/tarball/TermReadKey-2.30]$ perl ../Module-Build-0.2611/Build.PL
Checking whether your kit is complete...
Looks good
 * Optional prerequisite Module::Signature isn't installed
 * Optional prerequisite ExtUtils::ParseXS isn't installed
 * Optional prerequisite ExtUtils::CBuilder isn't installed
ERRORS/WARNINGS FOUND IN PREREQUISITES.  You may wish to install the versions
 of the modules indicated above before proceeding with this installation.

Feature 'YAML_support' disabled because of the following prerequisite failures:
 * Prerequisite YAML isn't installed

Can't open 'lib/Module/' for version: No such file or directory at /usr/lib/perl5/site_perl/5.8.8/Module/Build/ line 623.
[scuzzy@slackdell /home/scuzzy/tarball/TermReadKey-2.30]$

There is no Build.PL in the TermKey directory... What am I missing?

jxi 02-23-2006 09:05 PM

My omission, sorry :rolleyes: Module::Build is relatively new and not all packages can take advantage of it. IO::Prompt is an example of one with it: what I wanted is just that you can prove that it's possible to install perl modules on your system, then try to work back and find the reason for that tune=i686 error (if it's still a problem)...

Sounds like
HTH John

scuzzman 02-24-2006 06:10 AM

What's with the "cc1" in the error message on the make? Does that mean it's using gcc or cc (which would make sense if the modules are written in C and not Perl - especially in the case of Gtk or Gnome modules)? If so, it could be a CFLAGS error as Tink pointed out before, but I can't, for the life of me, figure out where this is set. Where would that "tune=i686" come from, and is it possible to just take it out? Also, the more I look, I'm seeing -mtune=i686 used, not -tune...

scuzzman 02-26-2006 12:20 PM

Got the problem fixed. Downgraded from Perl v5.8.8 to Perl v5.8.7 and it fixed it strangely enough. Thanks for both your help though.

jxi 02-26-2006 04:29 PM

glad to hear it. I didn'nt have much more to offer.
But I just noticed (checking my Perl version, which is 5.8.7)
perl -V

under Compiler: there's settings like
cc='cc', ccflags =' ...

and so on. Maybe those were misconfigured previously.

hydroxyblue 08-21-2006 10:30 PM

I found I got the same error "tune=686" for perl 5.8.8 (slackware 10.0 with various 10.0 CD installed packages)

This was on a new install of 10.0 last night on a vmware partition.

I 'removepkg perl' to remove bundled version.

I downloaded latest perl from slackware/pb (5.8.8) and:
installpkg perl*
perl -MCPAN -e shell
> install Bundle::CPAN

I got the error during numerous cc1's throughout the session, and it ultimately failed.

I'd forgotten to install the /l packages, once I did that, the error disappeared.

So the issue might just be a missing library package. I'll see if I can find the offending one, but since I 'installpkg /l/*.tgz' I'm not sure which one it is, and it may be difficult to find.

I suppose we could check the perl 5.8.8 prerequisite libraries... :)

All times are GMT -5. The time now is 01:16 AM.