PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

netcdf?

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
tuckerm



Joined: 24 Jan 2006
Posts: 4

PostPosted: Wed Jul 18, 2012 11:49 am    Post subject: netcdf? Reply with quote

I'm trying to compile netcdf 4.1.3 with PGI 12.5 on Ubuntu Linux (64 bit). When I run configure I get the following error message:


Code:
checking for gcc... pgcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/opt/tmp/netcdf-4.1.3':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details


I've set the following environment variables, in addition to those necessary for the PGI compilers to work:


Code:
    export CC=pgcc
    export FC=pgfortran
    export LD=pgfortran
    export F90=pgfortran
    export FFLAGS="-O2 -Msignextend"
    export CXX=pgcpp
    export CPPFLAGS="-DpgiFortran"


So far, I haven't been able to figure out how to work around this error message. I feel like I'm missing something obvious. Any help would be appreciated.
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jul 18, 2012 1:16 pm    Post subject: Reply with quote

Hi tuckerm,

It's a known issue where NetCDF requires some 32-bit comparability headers.

From http://www.pgroup.com/resources/netcdf/netcdf411_pgi2011.htm:
Quote:
Missing 32-bit header files

If the configuration fails with the following error:

...
checking whether we are cross compiling... configure: error: in
`/home/me/Documents/netcdf-4.1.3':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

The cause is likely you're building on a 64-bit machine. NetCDF requires some 32-bit header files. To install them, enter:

sudo apt-get install libc6-dev-i386

Once this package is installed, the configure should proceed without error.


Hope this helps,
Mat
Back to top
View user's profile
tuckerm



Joined: 24 Jan 2006
Posts: 4

PostPosted: Thu Jul 19, 2012 12:02 pm    Post subject: Reply with quote

Unfortunately, this package no longer seems to be part of Ubuntu (12.04)

Code:
# apt-get install libc6-dev-i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libc6-dev-i386 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libc6-i386

E: Package 'libc6-dev-i386' has no installation candidate


libc6-i386 was already installed. There does not seem to be a dev/headers package for the 32bit libs. Is there another way to get the package to build?[/quote]
Back to top
View user's profile
tuckerm



Joined: 24 Jan 2006
Posts: 4

PostPosted: Fri Jul 20, 2012 8:59 am    Post subject: Reply with quote

Quote:
Unfortunately, this package no longer seems to be part of Ubuntu (12.04)


I had a problem with my apt sources which I worked around. Now I'm having an issue with the actual make/compile process. I'm not sure if this is actually a PGI issue or something with netcdf.


Code:
Making all in libdispatch
make[2]: Entering directory `/opt/tmp/netcdf-4.1.3/libdispatch'
source='parallel.c' object='libdispatch_la-parallel.lo' libtool=yes \
        DEPDIR=.deps depmode=none /bin/bash ../depcomp \
        /bin/bash ../libtool  --tag=CC   --mode=compile pgcc -DHAVE_CONFIG_H -I. -I.. -I../fortran  -I../include    -DpgiFortran  -g -c -o libdispatch_la-parallel.lo `test -f 'parallel.c' || echo './'`parallel.c
libtool: compile:  pgcc -DHAVE_CONFIG_H -I. -I.. -I../fortran -I../include -DpgiFortran -g -c parallel.c -o libdispatch_la-parallel.o
PGC-F-0206-Can't find include file asm/errno.h (/usr/include/linux/errno.h: 4)
PGC/x86-64 Linux 12.5-0: compilation aborted
make[2]: *** [libdispatch_la-parallel.lo] Error 1
make[2]: Leaving directory `/opt/tmp/netcdf-4.1.3/libdispatch'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/tmp/netcdf-4.1.3'
make: *** [all] Error 2
Back to top
View user's profile
TheMatt



Joined: 06 Jul 2009
Posts: 322
Location: Greenbelt, MD

PostPosted: Mon Jul 23, 2012 11:04 am    Post subject: Reply with quote

I think this is a "classic" Ubuntu issue. This file isn't in, say, /usr/include/asm as in most places but in a directory like /usr/include/i386-linux-gnu or /usr/include/x86_64-linux-gnu (and then in the asm/ directory under there). I think the way around it is to add the correct directory to a CPPFLAGS:

CPPFLAGS=-I/usr/include/x86_64-linux-gnu

or to C_INCLUDE_PATH or the like.

Matt
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
Page 1 of 1

 
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