PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

C compiler cannot run C compiled programs
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
petero



Joined: 30 Mar 2005
Posts: 23

PostPosted: Mon May 16, 2005 9:49 am    Post subject: C compiler cannot run C compiled programs Reply with quote

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

PATH: /usr/local/lf9562/bin
PATH: /usr/local/lf9562/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /usr/X11R6/bin
PATH: /home/3dvar/bin
PATH: /bin
PATH: /usr/pgi/linux86/6.0/bin
PATH: /usr/bin/perl
PATH: usr/local/bin
PATH: /sbin
PATH: /usr/bin
PATH: /usr/sbin
PATH: /home/3dvar/bin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/pgi/linux86/6.0/bin
PATH: /usr/local/perl
PATH: usr/local/bin
PATH: /sbin
PATH: /usr/bin


## ----------- ##
## 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.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5871
Location: The Portland Group Inc.

PostPosted: Mon May 16, 2005 10:45 am    Post subject: Reply with quote

Hi Petero,

I started with a fresh NetCDF 3.6.0p1 install by untaring package and then running configure using the following command:
Code:
env CC=pgcc CFLAGS="-O2 -Msignextend -V" FC=pgf90 F90=pgf90 FFLAGS="-O2 -w -V" CXX=pgCC CPPFLAGS="-DNDEBUG -DpgiFortran" ./configure -prefix=/tmp/final

From my config.log file:

## ----------- ##
## 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/qa/netcdf-3.6.0-p1
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 Rel Dev 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
configure:1547: $? = 0
configure:1570: checking for C compiler default output file name
configure:1573: pgcc -O2 -Msignextend -V -DNDEBUG -DpgiFortran conftest.c >&5
PGC/x86 Linux/x86 Rel Dev
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.

pgcc Rel Dev 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
configure:1576: $? = 0

configure:1622: result: a.out
configure:1627: checking whether the C compiler works
configure:1633: ./a.out
configure:1636: $? = 0

Notice that your configuration is skipping line 1570 which determines the default executable name. However, instead of failing, your configure script sets the default exe name to 'b.out'. Since 'b.out' doesn't actually exist, your configuration fails. Unless your configure script has been modified, I find this behavior very odd.

Starting at the point where you have untar'd the NetCDF package and change to the "src" directory, what are the steps you do to run configure?

- Mat
Back to top
View user's profile
petero



Joined: 30 Mar 2005
Posts: 23

PostPosted: Mon May 16, 2005 1:59 pm    Post subject: Reply with quote

Hi Mat,

These are steps which i did in installing netcdf.
1) First i started a fresh installation by downloading the source code and put in the /tmp.
2) I created two directories working and final.
3) At /tmp, i unzip the netcdf.tar.gz
4) I changed the directory to /tmp/working and run tar -xvf /tmp/netcdf.tar
5) At /tmp/working,where i untar the netcdf.tar i changed to net*/src and run env CC=pgcc CFLAGS="-O2 -Msignextend -V" FC=pgf90 F90=pgf90 FFLAGS="-O2 -w -V" CXX=pgCC CPPFLAGS="-DNDEBUG -DpgiFortran" ./configure -prefix=/tmp/final >& config.log
6) i looked in config.log and i get the same error message: C compiler cannot run the compiled program.

-----------see my config.log------------------------------
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

PATH: /usr/local/lf9562/bin
PATH: /usr/local/lf9562/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /usr/X11R6/bin
PATH: /home/3dvar/bin
PATH: /bin
PATH: /usr/pgi/linux86/6.0/bin
PATH: /usr/bin/perl
PATH: usr/local/bin
PATH: /sbin
PATH: /usr/bin
PATH: /usr/sbin
PATH: /home/3dvar/bin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/pgi/linux86/6.0/bin
PATH: /usr/local/perl
PATH: usr/local/bin
PATH: /sbin

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
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
configure:1547: $? = 0
configure:1570: checking for C compiler default output file name
configure:1573: pgcc -o2 -Msignextend -V -DNDEBUG -DpgiFortran conftest.c >&5
NOTE: your evaluation license will expire in 9 days, 8.06 hours.
Waiting for 4 seconds...
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/x86 Linux/x86 6.0-1
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.

pgcc 6.0-1 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
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.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnu
ac_cv_build_alias=i686-pc-linux-gnu
ac_cv_env_CC_set=set
ac_cv_env_CC_value=pgcc
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-o2 -Msignextend -V'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-DNDEBUG -DpgiFortran'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value=-g
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value==pgCC
ac_cv_env_FCFLAGS_set=
ac_cv_env_FCFLAGS_value=
ac_cv_env_FC_set=set
ac_cv_env_FC_value=pgf90
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=
ac_cv_host=i686-pc-linux-gnu
ac_cv_host_alias=i686-pc-linux-gnu

## ----------------- ##
ARFLAGS=''
CC='pgcc'
CC_MAKEDEPEND=''
CFLAGS='-o2 -Msignextend -V'
COMPILE_F=''
CPP=''
CPPFLAGS='-DNDEBUG -DpgiFortran'
CXX='=pgCC'
CXXFLAGS='-g'
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
F90='pgf90'
F90FLAGS='-g'
F90LIBS=''
FC='pgf90'
FCFLAGS=''
FFLAGS='-o2 -w -V'
FLIBS=''
FPP=''
FPPFLAGS=''
FTPBINDIR=''
IGNORE_FPE=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
M4=''
M4FLAGS=''
MAKEWHATIS_CMD=''
MATHLIB=''
NM=''
NMFLAGS=''
OBJEXT=''
PACKAGE_BUGREPORT='support@unidata.ucar.edu'
PACKAGE_NAME='netCDF'
PACKAGE_STRING='netCDF 3.6.0'
PACKAGE_TARNAME='netcdf'
PACKAGE_VERSION='3.6.0'
PATH_SEPARATOR=':'
RANLIB=''
SHELL='/bin/sh'
SRCDIR='/tmp/working/netcdf-3.6.0-p1/src'
WHATIS=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_FC=''
ac_ct_RANLIB=''
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias=''
build_cpu='i686'
build_os='linux-gnu'
build_vendor='pc'
datadir='${prefix}/share'
exec_prefix='NONE'
host='i686-pc-linux-gnu'
host_alias=''
host_cpu='i686'
host_os='linux-gnu'
host_vendor='pc'
includedir='${prefix}/include'
infodir='${prefix}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='/tmp/final'
prog=''
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##
## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_BUGREPORT "support@unidata.ucar.edu"
#define PACKAGE_NAME "netCDF"
#define PACKAGE_STRING "netCDF 3.6.0"
#define PACKAGE_TARNAME "netcdf"
#define PACKAGE_VERSION "3.6.0"

configure: exit 1
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5871
Location: The Portland Group Inc.

PostPosted: Tue May 17, 2005 12:37 pm    Post subject: Reply with quote

Hi Petero,

This is really odd. I have not seen this before nor quite understand why your getting this error. Perhaps another user has encountered this? Also, you may consider contacting Unidata.

Let's by pass the configuration step. I've posted my macros.make file which is what the configuration script is attempting to create. Copy this file to your NetCDF "src" directory and modify it so that the "SRCDIR" and "prefix" variables have the correct path names for your system. Next, type 'make' to create the library.

Let me know how it goes.
Mat
Back to top
View user's profile
petero



Joined: 30 Mar 2005
Posts: 23

PostPosted: Tue May 17, 2005 9:14 pm    Post subject: Reply with quote

Mat,

This is so weird, i tried to copy the file macros.make and do some modification to SRCDIR and prefix paths,but i got the following errors after running make.
NB: i have just install a fresh linux86 compiler, and succesful compile and run a simple hello world program.
Also i have attached my .bashrc file to show you how i set up my environment

-----------------------errors----------------------------
make[1]: Entering directory `/tmp/working/netcdf-3.6.0-p1/src'

Making `all' in directory /tmp/working/netcdf-3.6.0-p1/src/libsrc

make[2]: Entering directory `/tmp/working/netcdf-3.6.0-p1/src/libsrc'
make[2]: *** No rule to make target `ncconfig.h', needed by `attr.o'. Stop.
make[2]: Leaving directory `/tmp/working/netcdf-3.6.0-p1/src/libsrc'
make[1]: *** [subdir_target] Error 1
make[1]: Leaving directory `/tmp/working/netcdf-3.6.0-p1/src'
make: *** [libsrc/all] Error 2
----------------------end of errors-------------------------------------
.bashrc file
PATH=$PATH:$HOME/bin:/bin:$PGI/linux86/6.0/bin:/usr/bin/perl:usr/local/bin:/sbin:/usr/bin:/usr/sbin
export PATH
MANPATH=/usr/pgi/linux86/6.0/man
export MANPATH
export LM_LICENSE_FILE=/usr/pgi/license.dat

#Specifying Netcdf environment variable
export CC=/usr/pgi/linux86/6.0/bin/pgcc
export FC=/usr/pgi/linux86/6.0/bin/pgf90
export F90=/usr/pgi/linux86/6.0/bin/pgf90
export CXX=/usr/pgi/linux86/6.0/bin/pgCC
export CFLAGS="-o2 -Msignextend -V"
export CPPFLAGS="-DNDEBUG -DpgiFortran"
export FFLAGS="-o2 -w -V"
export F90FLAGS=-g
export CXXFLAGS=-g
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group