Operating System - HP-UX
1752766 Members
5015 Online
108789 Solutions
New Discussion

Re: error 2005: invalid option '-x'

 
SOLVED
Go to solution
WeeFee
Frequent Visitor

error 2005: invalid option '-x'

I downloaded the GNU compiler from the HP website, to run on an HP 11i3 itanium server (only 11i2 version available for download).

 http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2a08725cc2f02110725cc2f02110275d6e10RCRD

 

But am having difficulty getting a simple dummy program to compile.  My aim is to get Doxygen compiled, if I can...

 

My C program is as follows:

// This program does nothing except return 0, for use when
// testing rtest scripts.

#include <stdlib.h>

int main( int argc, char** argv )
{
        printf( "strcmp(20051001,20051101) = %d",

                strcmp( "20051001", "20051101" ) );

        printf( "strcmp(20051001,20051001) = %d",

                strcmp( "20051001", "20051001" ) );

        printf( "strcmp(20051001,20050901) = %d",

                strcmp( "20051001", "20050901" ) );

        return 0;
}

Saved as dummy.c and compiled by the command:

(fjack) 122 % /full/path/to/downloaded/gcc dummy.c
error 2005: invalid option '-x'
(fjack) 123 % ls
total 240
-rwxr-xr-x   1 fjack      generic       5520 Sep 27  2005 dummy
drwxr-xr-x  16 fjack      generic       1024 Apr  2  2010 ..

drwxr-xr-x   2 fjack      generic       1024 Jul  6 15:15 .
(fjack) 124 %  /full/path/to/downloaded/gcc -pedantic dummy.c
randgen.c:1:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
randgen.c:1:1: warning: (this will be reported only once per input file) [enabled by default]
error 2005: invalid option '-x'

 

The warnings I can live with, it's only a test program ;o) but where is this invalid -x option?  From GNU documentation it's the way of specifying the language, if you don't want it to work it out by the file extension but can't see (or imagine) where this is coming from.

(fjack) 126 %  /full/path/to/downloaded/gcc -v
Using built-in specs.
COLLECT_GCC=/full/path/to/downloaded/gcc
COLLECT_LTO_WRAPPER =/full/path/to/downloaded/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../libexec/gcc/ia64-hp-hpux11.23/4.6.0/lto-wrapper
Target: ia64-hp-hpux11.23
Configured with: /tmp/gcc-4.6.0.tar.gz/gcc-4.6.0/configure --host=ia64-hp-hpux11.23 --target=ia64-hp-hpux11.23 --build=ia64-hp-hpux11.23 --prefix=/opt/hp-gcc-4.6.0 --with-gnu-as --without-gnu-ld --enable-threads=posix --enable-languages=c,c++ --with-gmp=/proj/opensrc/be/ia64-hp-hpux11.23 --with-mpfr=/proj/opensrc/be/ia64-hp-hpux11.23 SED=/usr/bin/sed
Thread model: posix
gcc version 4.6.0 (GCC)

 

uname -a returns

HP-UX hostname B.11.31 U ia64 0938135552 unlimited-user license

11 REPLIES 11
Steven E. Protter
Exalted Contributor

Re: error 2005: invalid option '-x'

Shalom,

 

I would not be confortable running a compiler on 11.31 designed for use on 11.23.

--host=ia64-hp-hpux11.23

 

Unless the documentation specifically supports that, I would be more comfortable compiling from source.

 

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
WeeFee
Frequent Visitor

Re: error 2005: invalid option '-x'

I tried compiling the source, but there were so many errors and pre-dependencies that I couldn't install - there were some packages GCC said that it required that had NO support or makefile for HP ;o( Otherwise, yes, I agree, that was what I tried first before getting desperate! Besides, I 'believed' the HP website where it said... "The GCC packages for HP-UX are available for HP-UX 11.11 or later running on HP PA-RISC and for HP-UX 11.23 or later running on the Itanium?-based processor family platform. " Naive, surely ;o) Fiona
Dennis Handly
Acclaimed Contributor

Re: error 2005: invalid option '-x'

Can you add -v to your compile line so we can narrow down who produces that error message.

It may be trying to use HP's as(1) and not the foreign devil version.

 

I assume that "/full/path/to/downloaded" was not changed from HP's value?

You may have to put /full/path/to/downloaded in your PATH.

 

Next time please specify the EXACT path you used for gcc.

 

 

WeeFee
Frequent Visitor

Re: error 2005: invalid option '-x'

Dennis, you are right, I omitted to say how I'd installed gcc.  Sorry.

 

Due to limitations of our hardware team, we can't get root to install gcc (something about impacting their support contract) so I had to do it as a non-root user.  I downloaded the depot file, gunzip and tar xf'd it, then put links in my target directory to the un-tar'd location:

 

un-tar'd to: /psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/gcc

links created in: bin lib include lib libexec share/man directories from here /psg/tools/host/bin etc. to above location.

 

I added /psg/tools/host/bin to my PATH and SHLIB_PATH variables.  So when I do which gcc and which as, the correct ones in my 'new' location are picked up.

 

host (fjack)110 % ls /psg/tools/host/bin
a2p             dbilogstrip     gprof           objdump         psed
acyclic         dbiprof         gv2gxl          ora_explain     pstruct
addr2line       dbiproxy        gvcolor         osage           ptar
ar              diffimg         gvgen           patchwork       ptardiff
as              dijkstra        gvmap           perl            ranlib
awk             dot             gvmap.sh        perl5.10.0      readelf
bcomps          dot2gxl         gvpack          perlbug         s2p
bison           dot_builtins    gvpr            perldoc         sccmap
c++filt         dotty           gxl2dot         perlivp         sfdp
c2ph            dprofpp         gxl2gv          pgawk           shasum
ccomps          elfedit         h2ph            pgawk-3.1.6     size
circo           enc2xs          h2xs            piconv          splain
cluster         fdp             igawk           pl2pm           strings
config_data     find2perl       instmodsh       pod2html        strip
corelist        flex            libnetcfg       pod2latex       tred
cpan            g++             lneato          pod2man         twopi
cpan2dist       gawk            m4              pod2text        unflatten
cpanp           gawk-3.1.6      mm2gv           pod2usage       xsubpp
cpanp-run-perl  gc              neato           podchecker      yacc
cpp             gcc             nm              podselect
curl            gcov            nop             prove
curl-config     gml2gv          objcopy         prune

But when I run the command with -v it's picking up the 'wrong' as as you guessed??

 

host (fjack) 151 % gcc -v -pedantic dummy.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../libexec/gcc/ia64-hp-hpux11.23/4.6.0/lto-wrapper
Target: ia64-hp-hpux11.23
Configured with: /tmp/gcc-4.6.0.tar.gz/gcc-4.6.0/configure --host=ia64-hp-hpux11.23 --target=ia64-hp-hpux11.23 --build=ia64-hp-hpux11.23 --prefix=/opt/hp-gcc-4.6.0 --with-gnu-as --without-gnu-ld --enable-threads=posix --enable-languages=c,c++ --with-gmp=/proj/opensrc/be/ia64-hp-hpux11.23 --with-mpfr=/proj/opensrc/be/ia64-hp-hpux11.23 SED=/usr/bin/sed
Thread model: posix
gcc version 4.6.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-pedantic'
 /psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../libexec/gcc/ia64-hp-hpux11.23/4.6.0/cc1 -quiet -v -iprefix /psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../lib/gcc/ia64-hp-hpux11.23/4.6.0/ dummy.c -quiet -dumpbase dummy.c -auxbase dummy -pedantic -version -o /var/tmp//cc5eOb5N.s
GNU C (GCC) version 4.6.0 (ia64-hp-hpux11.23)
        compiled by GNU C version 4.6.0, GMP version 4.2.4, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../lib/gcc/ia64-hp-hpux11.23/4.6.0/../../../../ia64-hp-hpux11.23/include"
ignoring duplicate directory "/psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../lib/gcc/../../lib/gcc/ia64-hp-hpux11.23/4.6.0/include"
ignoring nonexistent directory "/usr/local/include"
ignoring duplicate directory "/psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../lib/gcc/../../lib/gcc/ia64-hp-hpux11.23/4.6.0/include-fixed"
ignoring nonexistent directory "/psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../lib/gcc/../../lib/gcc/ia64-hp-hpux11.23/4.6.0/../../../../ia64-hp-hpux11.23/include"
#include "..." search starts here:
#include <...> search starts here:
 /psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../lib/gcc/ia64-hp-hpux11.23/4.6.0/include
 /psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../lib/gcc/ia64-hp-hpux11.23/4.6.0/include-fixed
 /psg/tools/host/GNU_C_C++/GCC_4_6_0/opt/hp-gcc-4.6.0/bin/../lib/gcc/../../include
 /usr/include
End of search list.
GNU C (GCC) version 4.6.0 (ia64-hp-hpux11.23)
        compiled by GNU C version 4.6.0, GMP version 4.2.4, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 8bb82ece916072d2847c95dadf363758
dummy.c:1:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
dummy.c:1:1: warning: (this will be reported only once per input file) [enabled by default]
COLLECT_GCC_OPTIONS='-v' '-pedantic'
 /usr/ccs/bin/as -v -x -o /var/tmp//ccIJzWyP.o /var/tmp//cc5eOb5N.s
error 2005: invalid option '-v'
HOST (fjack) 152 % which as
/psg/tools/host/bin/as

I hope this helps - I'm afraid it just confuses me ;o(

Many thanks,

 

Fiona

Dennis Handly
Acclaimed Contributor

Re: error 2005: invalid option '-x'

>I downloaded the depot file, gunzip and tar xf'd it, then put links in my target directory to the un-tar'd location:

 

This may make it useless if you don't invoke any control scripts to set up the application.

 

>it's picking up the 'wrong' as as you guessed?

 

$ as -x fff
error 2005: invalid option '-x'

 

You may have to use this to change to your alternate root:  --prefix=/opt/hp-gcc-4.6.0

Not sure how.


You may just have to be root to install it.

WeeFee
Frequent Visitor

Re: error 2005: invalid option '-x'

Thanks Dennis, so if I understand you right, I need to use girly tears to appeal to the unix guy's better nature to install this as root...

 

Will try and get them to do this!

Many thanks,

 

Fiona

Dennis Handly
Acclaimed Contributor
Solution

Re: error 2005: invalid option '-x'

>Will try and get them to do this!

 

I'll talk to the gcc maintainer and see if there is any other way.  But using root is easiest.

WeeFee
Frequent Visitor

Re: error 2005: invalid option '-x'

Hi Dennis,

 

my UNIX team are reluctant to do anything that looks remotely like 'software', but my crocodile tears worked, they installed the .depot file into /opt/hp-gcc, and after updating my path and library variables it all worked smashingly!

 

I think they get enjoyment out of torturing me like this... but many thanks for your help!

Fiona

Dennis Handly
Acclaimed Contributor

Re: error 2005: invalid option '-x'

>many thanks for your help!

 

If you're happy with the answers you were given, please assign some kudos:

http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/4803621#M1