# netcdf?

**URL:** <https://forums.developer.nvidia.com/t/netcdf/133105>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [July 18, 2012, 6:49pm UTC](https://forums.developer.nvidia.com/t/netcdf/133105 "2012-07-18T18:49:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuckerm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tuckerm](https://forums.developer.nvidia.com/u/tuckerm)\
**Post date:** [July 18, 2012, 6:49pm UTC](https://forums.developer.nvidia.com/t/netcdf/133105/1 "2012-07-18T18:49:37Z")

</div>

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:

```nohighlight
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:

```nohighlight
    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.

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [July 18, 2012, 8:16pm UTC](https://forums.developer.nvidia.com/t/netcdf/133105/2 "2012-07-18T20:16:47Z")

</div>

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:](http://www.pgroup.com/resources/netcdf/netcdf411_pgi2011.htm:)

> 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

---

<div class="post-metadata">

**Author:** ![tuckerm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tuckerm](https://forums.developer.nvidia.com/u/tuckerm)\
**Post date:** [July 19, 2012, 7:02pm UTC](https://forums.developer.nvidia.com/t/netcdf/133105/3 "2012-07-19T19:02:33Z")

</div>

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

```nohighlight
# 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]

---

<div class="post-metadata">

**Author:** ![tuckerm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tuckerm](https://forums.developer.nvidia.com/u/tuckerm)\
**Post date:** [July 20, 2012, 3:59pm UTC](https://forums.developer.nvidia.com/t/netcdf/133105/4 "2012-07-20T15:59:32Z")

</div>

> 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.

```plaintext
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

```

---

<div class="post-metadata">

**Author:** ![TheMatt](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/thematt/32/23143_2.png) [@TheMatt](https://forums.developer.nvidia.com/u/TheMatt)\
**Post date:** [July 23, 2012, 6:04pm UTC](https://forums.developer.nvidia.com/t/netcdf/133105/5 "2012-07-23T18:04:00Z")

</div>

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
