LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-26-2005, 05:08 PM   #1
petero
LQ Newbie
 
Registered: May 2005
Location: DC
Posts: 19

Rep: Reputation: 0
C compiler cannot run C compiled programs


Hi all,
I'm trying to compile netcdf-3.6.0-p1 with pgf90 in linux machine,but i get the error, C compiler cannot run C compiled programs.This error is in config.log file.
Can anyone help me with this?
thanks,

Petero.

---------------------here is my config.log file------------------
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for top-level source-directory... /tmp/working/netcdf-3.6.0-p1/src
checking for C compiler default output file name... b.out
checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'.
See `config.log' for more details.

uname -s = Linux
uname -v = #1 Thu Dec 18 12:53:39 EST 2003

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1369: checking build system type
configure:1387: result: i686-pc-linux-gnu
configure:1395: checking host system type
configure:1409: result: i686-pc-linux-gnu
configure:1421: checking for top-level source-directory
configure:1424: result: /tmp/working/netcdf-3.6.0-p1/src
configure:1531: checking for C compiler version
configure:1534: pgcc --version </dev/null >&5
pgcc-Warning-Unknown switch: --version
pgcc-Warning-No files to process
configure:1537: $? = 0
configure:1539: pgcc -v </dev/null >&5
pgcc-Warning-No files to process
configure:1542: $? = 0
configure:1544: pgcc -V </dev/null >&5
pgcc 6.0-1 32-bit target on x86 Linux
configure:1576: $? = 0
configure:1622: result: b.out
configure:1627: checking whether the C compiler works
configure:1633: ./b.out
./configure: line 1: ./b.out: No such file or directory
configure:1636: $? = 127
configure:1645: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
 
Old 05-26-2005, 07:45 PM   #2
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Rep: Reputation: 30
Hello,
After googling this a little bit, it appears that it's related to some files not having the needed +x flag.

Check your filesystem too, if it's not mounted "exec" then that could 'cause the problem (per what I read).
-Jason
 
Old 05-26-2005, 09:22 PM   #3
petero
LQ Newbie
 
Registered: May 2005
Location: DC
Posts: 19

Original Poster
Rep: Reputation: 0
thanks,

I tried to add +x flag to some files ,but it didn't work out,and i still get the same error message "
checking whether the C compiler works...configure:error:cannot run C compiled programs".Also my file system is not mounted to any other filesystem.

Anyone with ideas or suggestions as to what went wrong?

thanks,
Petero.
 
Old 05-26-2005, 09:26 PM   #4
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Rep: Reputation: 30
Hmm,
Is the config files executable, because the typical built process consists of ./configure, make, make install.
However, ./configure would return errors if the file itself weren't executable.

It may not be a permissions error, but everything I see is about some file not having X permissions, but I don't know what file that is.

If you extracted this from a tarball, maybe delete the directory and untar it again?
-Jason
 
Old 05-26-2005, 10:49 PM   #5
petero
LQ Newbie
 
Registered: May 2005
Location: DC
Posts: 19

Original Poster
Rep: Reputation: 0
Jason,

This is weird,i get the same error even after delete ,untar and ./install the whole directory.

petero
 
Old 05-26-2005, 11:18 PM   #6
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Looks to me like the name of the compiler is wrong. It's looking for pgcc when it should probably be gcc.

Try either running:
Code:
export cc=gcc
or 
export CC=gcc
before running ./configure

If neither works, try looking at the ./configure script on line 1534 and see what variable it's getting the pgcc from. Looking for the variable may get a bit more complicated that that though.
 
Old 05-27-2005, 12:00 AM   #7
petero
LQ Newbie
 
Registered: May 2005
Location: DC
Posts: 19

Original Poster
Rep: Reputation: 0
Soory
Crabboy,
I didn't understand what to do after getting the variable name in configure script. i have already got the it.
petero.
 
Old 05-27-2005, 12:10 PM   #8
petero
LQ Newbie
 
Registered: May 2005
Location: DC
Posts: 19

Original Poster
Rep: Reputation: 0
hi all,

i'm using the portland group compiler(pgcc version 6.0) in my linux machine.I tried to compile a simple hello world c program with the option -v and i get the following messages. is this usual?
thanks,
petero.

[root@drizzle 3dvar]# pgcc -v hello.c

/usr/pgi/linux86/6.0/bin/pgc hello.c -opt 1 -x 119 0xa10000 -x 119 0x100000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 119 0x40000000 -x 19 0x400000 -x 80 0x300 -y 80 0x1000 -x 80 0x40000000 -x 119 0x8000000 -astype 0 -stdinc /usr/pgi/linux86/6.0/include:/usr/local/include:/usr/lib/gcc-lib/i386-redhat-linux/3.2/include:/usr/lib/gcc-lib/i386-redhat-linux/3.2/include:/usr/include -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __inline__= -def i386 -def __i386 -def __i386__ -def __NO_MATH_INLINES -def linux86 -def __THROW= -predicate '#machine(i386) #lint(off) #system(unix) #system(posix) #cpu(i386)' -cmdline '+pgcc hello.c -v' -asm /tmp/pgccaaaaaeCsal.s
NOTE: your evaluation license will expire in 14 days, 0.347 hours.
For a permanent license, please read the order acknowledgement
that you received. Connect to https://www.pgroup.com/License with
the username and password in the order acknowledgement.

PGC-I-0222-Redundant definition for symbol __THROW (/usr/include/sys/cdefs.h: 57)
PGC-I-0222-Redundant definition for symbol __stub___kernel_cosl (/usr/include/gnu/stubs.h: 11)
PGC-I-0222-Redundant definition for symbol __stub___kernel_sinl (/usr/include/gnu/stubs.h: 13)
PGC-I-0222-Redundant definition for symbol __stub___kernel_tanl (/usr/include/gnu/stubs.h: 15)
PGC-I-0222-Redundant definition for symbol __stub_chflags (/usr/include/gnu/stubs.h: 17)
PGC-I-0222-Redundant definition for symbol __stub_fattach (/usr/include/gnu/stubs.h: 19)
PGC-I-0222-Redundant definition for symbol __stub_fchflags (/usr/include/gnu/stubs.h: 21)
PGC-I-0222-Redundant definition for symbol __stub_fdetach (/usr/include/gnu/stubs.h: 23)
PGC-I-0222-Redundant definition for symbol __stub_futimes (/usr/include/gnu/stubs.h: 25)
PGC-I-0222-Redundant definition for symbol __stub_gtty (/usr/include/gnu/stubs.h: 27)
PGC-I-0222-Redundant definition for symbol __stub_lchmod (/usr/include/gnu/stubs.h: 29)
PGC-I-0222-Redundant definition for symbol __stub_lutimes (/usr/include/gnu/stubs.h: 31)
PGC-I-0222-Redundant definition for symbol __stub_posix_fadvise64 (/usr/include/gnu/stubs.h: 33)
PGC-I-0222-Redundant definition for symbol __stub_remap_file_pages (/usr/include/gnu/stubs.h: 35)
PGC-I-0222-Redundant definition for symbol __stub_revoke (/usr/include/gnu/stubs.h: 37)
PGC-I-0222-Redundant definition for symbol __stub_setlogin (/usr/include/gnu/stubs.h: 39)
PGC-I-0222-Redundant definition for symbol __stub_sigreturn (/usr/include/gnu/stubs.h: 41)
PGC-I-0222-Redundant definition for symbol __stub_sstk (/usr/include/gnu/stubs.h: 43)
PGC-I-0222-Redundant definition for symbol __stub_stty (/usr/include/gnu/stubs.h: 45)
PGC-I-0222-Redundant definition for symbol __need_wint_t (/usr/include/wchar.h: 47)
PGC-I-0222-Redundant definition for symbol __need_wint_t (/usr/include/wchar.h: 47)
PGC/x86 Linux/x86 6.0-4: compilation completed with informational messages

/usr/bin/as /tmp/pgccaaaaaeCsal.s -o /tmp/pgccbaaaaeCsal.o

/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-redhat-linux/3.2/crtbegin.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /tmp/pgccbaaaaeCsal.o -L/usr/pgi/linux86/6.0/lib -L/usr/lib -L/usr/lib/gcc-lib/i386-redhat-linux/3.2 -rpath /usr/pgi/linux86/6.0/lib -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/3.2/crtend.o /usr/lib/crtn.o
Unlinking /tmp/pgccaaaaaeCsal.s
Unlinking /tmp/pgccbaaaaeCsal.o
 
Old 05-27-2005, 12:35 PM   #9
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
ahh, that explains the pgcc, so the configure script is finding the correct compiler.

For you question above, does the hello.c compile? It does not look like there are any errors.

In the configure script it looks like it's trying to get the version out of pgcc, but it never spits it out. The script also expects to find the b.out file when I don't see the attempt to compile it in the trace given.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove compiled programs? piggysmile Linux - Software 2 03-22-2005 06:25 AM
error: cannot run C compiled programs. terry.trent Linux - Newbie 6 08-06-2004 12:07 AM
why ./ is used to run C++ compiled programs legend1079 Red Hat 4 03-23-2004 07:32 AM
"Can't run C compiled programs" on clean RH9 install smirnoff Linux - Newbie 8 03-16-2004 04:11 PM
cannot run C compiled programs Astro Slackware 7 01-27-2004 11:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration