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 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
--ls -l /usr/lib/libgeos.so : /usr/lib/libgeos.so -> 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 : /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 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...>
*To:* xiaoni <wangxni@...9...>
*Cc:* 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/>
>
> /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/>
>
> /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/>
>
> 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/>.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…>
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

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