basemap099.4 and geos

xiaoni wrote:

Jeff,
    Many thanks !

----ldd /usr/local/lib/python2.6/dist-packages/_geoslib.so
The results are:
       linux-gate.so.1 => (0x00cf2000)
        libgeos_c.so.1 => /usr/local/lib/libgeos_c.so.1 (0x00944000)
        libgeos-3.1.0.so => /usr/lib/libgeos-3.1.0.so (0x005cd000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x00a0e000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00165000)
        libgeos-3.2.0.so => /usr/local/lib/libgeos-3.2.0.so (0xb75c1000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00d5c000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00cf7000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00f77000)
        /lib/ld-linux.so.2 (0x00148000)

It seems that it mixed geos3.1 and 3.2 ?

Xianoi: Yep, there's your problem right there. My suggestion is to remove the 3.2.0 geos lib and headers from /usr/local/lib and /usr/local/include and try again.

-Jeff

···

If I have to clean out all the old versions of basemap, _geoslib.so and libgeos, then rebuild again, What is the safe way to do so ? I am afraid that I may damage the system if I simplely apply "rm". Do you have some suggestion about the steps of deleting ?

Many thanks !!

xiaoni

------------------------------------------------------------------------
*From:* Jeff Whitaker <jswhit@...146...>
*To:* xiaoni <wangxni@...9...>; Matplotlib Users <matplotlib-users@lists.sourceforge.net>
*Sent:* Wed, December 2, 2009 5:42:17 PM
*Subject:* Re: [Matplotlib-users] basemap099.4 and geos

xiaoni wrote:
> Jeff,
> Many thanks for your help ! The problem was : there was a segmentation error when I call Basemap. I applied the following steps, and then tried to launch ipython, it still has the same problem.
> --add export GEOS_DIR=/usr/local/lib
> --download basemap 099.4 to /home/xiaoni/software, where the previous version099.3 is saved also
> -- sudo python setup.py <http://setup.py> install
>
> The installation is OK. Then I test:
> --ls -l /usr/local/lib/libgeos.so : /usr/local/lib/libgeos.so -> libgeos-3.2.0.so <http://libgeos-3.2.0.so>
> --ls -l /usr/lib/libgeos.so : /usr/lib/libgeos.so -> libgeos-3.1.0.so <http://libgeos-3.1.0.so>
> --ls -l /usr/local/lib/libgeos.so : /usr/local/lib/libgeos.so -> libgeos-3.2.0.so
> --locate libgeos.so <http://libgeos.so> : /usr/lib/libgeos.so , and /usr/local/lib/libgeos.so
> --locate _geoslib :
> /home/xiaoni/software/basemap-0.99.3/build/lib.linux-i686-2.6/_geoslib.so
> /home/xiaoni/software/basemap-0.99.3/build/temp.linux-i686-2.6/src/_geoslib.o
> /home/xiaoni/software/basemap-0.99.3/src/_geoslib.c
> /home/xiaoni/software/basemap-0.99.3/src/_geoslib.pyx
> /usr/local/lib/python2.6/dist-packages/_geoslib.so
> (in fact I have saved both basemap -099.3 and basemap-0.99.4 in the /home/xiaoni/software. This result only shows 0.99.3 and is strange to me).
>
> Many thanks again !!
>
> xiaoni

Xiaoni: Is there no traceback? Can you run ldd on the _geoslib.so <http://_geoslib.so> that you are actually importing when the error occurs (presumably /usr/local/lib/python2.6/dist-packages/_geoslib.so)? That will tell you what version of the geos library you actually linked. I don't think I can be of much help here - all I can suggest is that you clean out all old versions of basemap, _geoslib.so and libgeos, then rebuild again. The fact that there are so may versions floating around increases the chance that you have a version mismatch somewhere.

Also check the build output and make sure there were no errors building _geoslib.so.

-Jeff

>
> ------------------------------------------------------------------------
> *From:* Jeff Whitaker <jswhit@...146... <mailto:jswhit@…146…>>
> *To:* xiaoni <wangxni@...9... <mailto:wangxni@…9…>>
> *Cc:* matplotlib-users@lists.sourceforge.net <mailto:matplotlib-users@lists.sourceforge.net>
> *Sent:* Wed, December 2, 2009 4:47:51 PM
> *Subject:* Re: [Matplotlib-users] basemap099.4 and geos
>
> xiaoni wrote:
> > Hello, all,
> > I have some problem with basemap and geos, and can not use Basemap。
> > In the below I list the information about basemap and geos in my computer. Hope someone would help me to figure out why it does not work. Many thanks in adance !
> >
> > 1) I type:
> > ---from mpl_toolkits.basemap import Basemap;
> > ---mpl_toolkits.basemap.__path__
> > ---mpl_toolkits.basemap.__version__
> > The results:
> > /usr/local/lib/python2.6/dist-packages/mpl_toolkits/basemap
> > '0.99.4'
> >
> > 2) I also checked the same for matplotlib:
> > /usr/lib/pymodules/python2.6/matplotlib
> > 0.99.0
> >
> > 3) I type: locate _geoslib:
> >
> > /home/xiaoni/software/basemap-0.99.3/build/lib.linux-i686-2.6/_geoslib.so
> > /home/xiaoni/software/basemap-0.99.3/build/temp.linux-i686-2.6/src/_geoslib.o
> > /home/xiaoni/software/basemap-0.99.3/src/_geoslib.c > /home/xiaoni/software/basemap-0.99.3/src/_geoslib.pyx /usr/local/lib/python2.6/dist-packages/_geoslib.so
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/build/lib.linux-i686-2.6/_geoslib.so
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/src/_geoslib.c
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/src/_geoslib.pyx
> >
> > 4) I type: locate libgeos.so <http://libgeos.so> <http://libgeos.so/&gt;
> >
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so.2
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/geom/.libs/libgeos.so.2.2.3
> > /home/xiaoni/software/temp/geos-3.2.0rc1/source/.libs/libgeos.so
> > /home/xiaoni/software/temp/lib/libgeos.so
> > /home/xiaoni/software/temp/lib/libgeos.so.2
> > /home/xiaoni/software/temp/lib/libgeos.so.2.2.3
> > /usr/lib/libgeos.so
> > /usr/local/lib/libgeos.so
> > /usr/local/lib/backup2/libgeos.so
> > /usr/local/lib/backup2/libgeos.so.2
> > /usr/local/lib/backup2/libgeos.so.2.2.3
> >
> > 5) locate libgeos_c.so <http://libgeos_c.so> <http://libgeos_c.so> <http://libgeos_c.so/>
> >
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1.1.1
> > /home/xiaoni/software/temp/basemap-0.99.3-backup/geos-2.2.3/source/capi/.libs/libgeos_c.so.1.1.1T
> > /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so
> > /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1
> > /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1.6.0
> > /home/xiaoni/software/temp/geos-3.2.0rc1/capi/.libs/libgeos_c.so.1.6.0T
> > /home/xiaoni/software/temp/lib/libgeos_c.so
> > /home/xiaoni/software/temp/lib/libgeos_c.so.1
> > /home/xiaoni/software/temp/lib/libgeos_c.so.1.1.1
> > /usr/lib/libgeos_c.so
> > /usr/lib/libgeos_c.so.1
> > /usr/lib/libgeos_c.so.1.5.0
> > /usr /local/lib/libgeos_c.so.1
> > /us r/local/lib/libgeos_c.so.1.6.0
> > /usr/local/lib/backup2/libgeos_c.so
> > /usr/local/lib/backup2/libgeos_c.so.1
> > /usr/local/lib/backup2/libgeos_c.so.1.1.1
> >
> > > 6) I also type:
> > ls -l /usr/local/lib/python2.6/dist-packages/_geoslib.so
> > It does not linked to any files (no pointer)
> >
> > 2) ls -l /usr/local/lib/libgeos.so
> > /usr/local/lib/libgeos.so -> libgeos-3.2.0.so <http://libgeos-3.2.0.so> <http://libgeos-3.2.0.so/&gt;
> >
> > 3) ls -l /usr/local/lib/libgeos.so
> > /usr/local/lib/libgeos.so -> libgeos-3.2.0.so
> >
> > 4) ls -l /usr/local/lib/backup2/libgeos.so.2
> > /usr/local/lib/backup2/libgeos.so.2 -> libgeos.so <http://libgeos.so/&gt;\.2\.2\.3
> >
> > 5) ls -l /usr/local/lib/backup2/libgeos.so.2.2.3
> > /usr/local/lib/backup2/libgeos.so.2.2.3, no links
> >
> > It seems that Basemap can not be used because of something wrong with the installation of GEOS ? Anyone would give some hints for help ? I appreciate it a lot !!
> >
> > xiaoni
> >
> Xianoi: You never said what the actual problem is with basemap. I have seen segfaults when there are two versions of geos installed (version 2 and version 3) and you pick up the header from one version and lib from the other version. I suggest setting the GEOS_DIR env var to /usr/local/lib and re-running the basemap install (python setup.py <http://setup.py> install), after deleting the existing build directory. Hopefully then it will grab both the header and lib for version 3.2.0 (which by the way is a pre-release, as yet untested with basemap).
>
> -Jeff
>
> -- Jeffrey S. Whitaker Phone : (303)497-6313
> Meteorologist FAX : (303)497-6449
> NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259... <mailto:Jeffrey.S.Whitaker@…259…> <mailto:Jeffrey.S.Whitaker@…259…>
> 325 Broadway Office : Skaggs Research Cntr 1D-113
> Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory
>

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

--
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 : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory