Re: Problem building Nio from source

From: Ivan Lima <ivan_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 26 2010 - 13:26:09 MDT

David,

Your diagnosis is correct. I edited setup.py following your
instructions and rebuilt Nio. Everything seems to be working fine now.

Thank you very much for your help.

- Ivan

--
Ivan Lima
Woods Hole Oceanographic Institution, MC&G MS #25
360 Woods Hole Road, Woods Hole, MA 02543-1543 USA
On Tue, Oct 26, 2010 at 14:57, David Brown <dbrown@ucar.edu> wrote:
> Hi Ivan,
>
> It looks like this is may be a bug that is triggered if you try to build PyNIO without GRIB2 support. The PyNIO source is supposed to include a directory pynio/ncarg/grib2_codetables that has all the GRIB2 code table files. This gets copied during the installation to  install-prefix/lib/site-packages/PyNIO/ncarg. If you build without GRIB2 support the copy does not happen and the 'ncarg' directory in site-packages does not get created. Of course it is not really needed if you do not include GRIB2 support, but Nio.py wants it to be there. You could
>
> Assuming you do not want GRIB2 support, as a work-around you can edit the setup.py file to install the tables unconditionally At line 451 change:
>
> if HAS_GRIB2 > 0:
>  data_files = get_grib2_codetables()
> else:
>  data_files = []
>
> to simply read:
>
> data_files = get_grib2_codetables()
>
> Please let me know if this was a correct diagnosis of the problem and if this fixes it.
>
> For other users who do want GRIB2 support, I should note that I uncovered another somewhat related problem while tracking this down: if you do not have an NCARG installation and you do not have NCARG_ROOT set, you will get the following error message when you try to open a GRIB2 file:
> fatal:NCARG_ROOT environment variable not set
>
> In my case this was not truly a fatal error message, and the file was read in normally. However, this may be because I have my python install in a standard location such that the site-packages
> directory path is /usr/local/lib/python2.6/site-packages. I have not fully tracked down where this path is being found. At any rate you can work around this problem by setting the environment variable NIO_GRIB2_CODETABLES to the install location of the files, e.g.: /usr/local/lib/python2.6/site-packages/PyNIO/ncarg/grib2_codetables.
>
> Hope this helps. I will try to get these problems corrected as soon as possible.
>  -dave
>
>
> On Oct 26, 2010, at 11:27 AM, Ivan Lima wrote:
>
>> Hello all,
>>
>> I'm having trouble building Nio from source in a workstation with gcc
>> 4.3.2, Python 2.5.2 and numpy 1.1.0 (Debian Lenny).  I built hdf4 and
>> Nio from source following the directions in the web site. But when I
>> try to run  test2.5.sh or do a "import Nio", I get: " No path found to
>> PyNIO/ncarg data directory and no usable NCARG installation found".  I
>> though I did NOT have to have NCL installed to build Nio. And that
>> dependency is not listed on the web site (
>> http://www.pyngl.ucar.edu/Download/build_pynio_from_src.shtm). Am I
>> missing something?
>>
>> Thanks,
>>
>> - Ivan
>> --
>> Ivan Lima
>> Woods Hole Oceanographic Institution, MC&G MS #25
>> 360 Woods Hole Road, Woods Hole, MA 02543-1543 USA
>>
>> _______________________________________________
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
>
_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Tue Oct 26 13:26:45 2010

This archive was generated by hypermail 2.1.8 : Mon Nov 15 2010 - 09:11:30 MST