netcdf4-python build

Ubuntu 12.04

hdf5-tools installed from package manager

netcdf-bin and python-netcdf installed from package manager

I downloaded netCDF4-1.0fix1.tar.gz from Google Code Archive - Long-term storage for Google Code Project Hosting.

python
setup.py build

/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: ld returned 1 exit status
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: ld returned 1 exit status
error: Command “gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-i686-2.7/netCDF4.o -L/usr/local/lib -L/usr/local/lib -Wl,-R/usr/local/lib -Wl,-R/usr/local/lib -lnetcdf -lhdf5_hl
-lhdf5 -lz -o build/lib.linux-i686-2.7/netCDF4.so” failed with exit status 1

Michael: You’re missing the hdf5 library. You should be able to
install that (along with the netcdf version 4 library) using the
Ubuntu package manager. I don’t know what the relevant package names
are.
See the docs at netcdf4-python.googlecode.com for installation
instructions (including how to install the dependencies). You can also file a help request there and I’ll see it (since this
is not really a basemap issue).
-Jeff

···

On 9/19/12 11:30 AM, Michael Rawlins
wrote:

Ubuntu 12.04

      hdf5-tools installed from

package manager

      netcdf-bin and python-netcdf

installed from package manager

I downloaded netCDF4-1.0fix1.tar.gz
from

python setup.py build

      /usr/bin/ld: cannot find

-lhdf5_hl

      /usr/bin/ld: cannot find -lhdf5

      collect2: ld returned 1 exit status

      /usr/bin/ld: cannot find -lhdf5_hl

      /usr/bin/ld: cannot find -lhdf5

      collect2: ld returned 1 exit status

      error: Command "gcc -pthread -shared -Wl,-O1

-Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro
build/temp.linux-i686-2.7/netCDF4.o -L/usr/local/lib
-L/usr/local/lib -Wl,-R/usr/local/lib -Wl,-R/usr/local/lib
-lnetcdf -lhdf5_hl -lhdf5 -lz -o
build/lib.linux-i686-2.7/netCDF4.so" failed with exit status 1

-- Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : 325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web :

http://code.google.com/p/netcdf4-python/downloads/listJeffrey.S.Whitaker@…259…http://tinyurl.com/5telg

···

From: Jeff Whitaker <jeffrey.s.whitaker@…259…>
To: Michael Rawlins <rawlins02@…9…>; Matplotlib Users <matplotlib-users@…2982…e.net>
Sent: Wednesday, September 19, 2012 2:35 PM
Subject: Re: [Matplotlib-users] netcdf4-python build

  On 9/19/12 11:30 AM, Michael Rawlins wrote:

Ubuntu 12.04

      hdf5-tools installed from

package manager

      netcdf-bin and python-netcdf

installed from package manager

I downloaded netCDF4-1.0fix1.tar.gz
from Google Code Archive - Long-term storage for Google Code Project Hosting.

python setup.py build

      /usr/bin/ld: cannot find

-lhdf5_hl

      /usr/bin/ld: cannot find -lhdf5

      collect2: ld returned 1 exit status

      /usr/bin/ld: cannot find -lhdf5_hl

      /usr/bin/ld: cannot find -lhdf5

      collect2: ld returned 1 exit status

      error: Command "gcc -pthread -shared -Wl,-O1

-Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro
build/temp.linux-i686-2.7/netCDF4.o -L/usr/local/lib
-L/usr/local/lib -Wl,-R/usr/local/lib -Wl,-R/usr/local/lib
-lnetcdf -lhdf5_hl -lhdf5 -lz -o
build/lib.linux-i686-2.7/netCDF4.so" failed with exit status 1

Michael:  You're missing the hdf5 library.  You should be able to

install that (along with the netcdf version 4 library) using the
Ubuntu package manager. I don’t know what the relevant package names
are.

See the docs at [netcdf4-python.googlecode.com](http://netcdf4-python.googlecode.com/) for installation

instructions (including how to install the dependencies).

You can also file a help request there and I'll see it (since this

is not really a basemap issue).

-Jeff

Just installed h5utils from package manager. Getting same errors. In package manager I’m searching on hdf5. If there’s a package there I’m missing, then it certainly is not obvious.

Mike

-- Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Try

libhdf5-serial
libhdf5-serial-dev
Johann

···

On 19/09/2012 21:14, Michael Rawlins wrote:

Just installed h5utils from package manager. Getting same errors. In
package manager I'm searching on hdf5. If there's a package there I'm
missing, then it certainly is not obvious.

···

From: Johann Rohwer <jr@…841…>
To: matplotlib-users@…504…et
Sent: Wednesday, September 19, 2012 3:22 PM
Subject: Re: [Matplotlib-users] netcdf4-python build

On 19/09/2012 21:14, Michael Rawlins wrote:

Just installed h5utils from package manager. Getting same errors. In
package manager I’m searching on hdf5. If there’s a package there I’m
missing, then it certainly is not obvious.

Try

libhdf5-serial
libhdf5-serial-dev
Johann

After installing those two packages I was able build with setup.py in netCDF4-1.0/

Last few lines of the build:

creating build/scripts.linux-i686-2.7
copying and adjusting utils/nc3tonc4 → build/scripts.linux-i686-2.7
copying and adjusting utils/nc4tonc3 → build/scripts.linux-i686-2.7
changing mode of build/scripts.linux-i686-2.7/nc3tonc4 from 644 to 755
changing mode of build/scripts.linux-i686-2.7/nc4tonc3 from 644 to 755

Here is my initialization:

from mpl_toolkits.basemap import Basemap, shiftgrid, cm
from netCDF4 import Dataset as NetCDFFile

Here
is result of execution of script:

Traceback (most recent call last):
File “map_PrcpBias_Northeast.py”, line 21, in
from netCDF4 import Dataset as NetCDFFile

I understand using the python-netcdf package is an option. Installed that but am getting an eror saying missing libhdf5_hl.so.6 when trying:

from Scientific.IO.NetCDF import NetCDFFile

MR


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Matplotlib-users mailing list
Matplotlib-users@…504…et
https://lists.sourceforge.net/lists/listinfo/matplotlib-users