Basemap Installation Errors

Hi,

I am having trouble installing Basemap. I followed the directions in the
README file included in the archive (and posted at
http://matplotlib.sourceforge.net/basemap/doc/html/users/installing.html).
After successfully installing the GEOS library (also included), I cd to the
"top level basemap directory" and run the command "python setup.py install."
The install fails, with multiple compile errors related to src/_proj.c.

However, it appears that
lib/python2.5/site-packages/numpy/core/include/numpy/__multiarray_a
pi.h also produces errors, so I suspect it may have to do with gcc...

Some relevant information...
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import numpy; import matplotlib
print numpy.__version__, matplotlib.__version__

1.1.1 0.98.3

...And the last few errors when trying to install...
src/_proj.c:3563: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘__pyx_PyInt_AsUnsignedLongLong’
src/_proj.c:3585: error: expected ‘)’ before ‘*’ token
src/_proj.c:3600: error: expected ‘)’ before ‘*’ token
src/_proj.c:3615: error: expected ‘)’ before ‘*’ token
src/_proj.c:3630: error: expected ‘)’ before ‘*’ token
src/_proj.c:3645: error: expected ‘)’ before ‘*’ token
src/_proj.c:3660: error: expected ‘)’ before ‘*’ token
src/_proj.c:3675: error: expected ‘)’ before ‘*’ token
src/_proj.c:3690: error: expected ‘)’ before ‘*’ token
src/_proj.c:3705: error: expected ‘)’ before ‘*’ token
src/_proj.c:3720: error: expected ‘)’ before ‘*’ token
src/_proj.c:3735: error: expected ‘)’ before ‘*’ token
error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
-Wall -Wstrict-prototypes -fPIC -Isrc
-I/home/jtamir/lib/python2.5/site-packages/numpy/core/include
-I/home/jtamir/include/python2.5 -c src/_proj.c -o
build/temp.linux-i686-2.5/src/_proj.o" failed with exit status 1

Any idea how to proceed?

Thanks,
Jon

···

--
View this message in context: http://www.nabble.com/Basemap-Installation-Errors-tp22915617p22915617.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

jtamir wrote:

Hi,

I am having trouble installing Basemap. I followed the directions in the
README file included in the archive (and posted at
http://matplotlib.sourceforge.net/basemap/doc/html/users/installing.html).
After successfully installing the GEOS library (also included), I cd to the
"top level basemap directory" and run the command "python setup.py install."
The install fails, with multiple compile errors related to src/_proj.c.

However, it appears that
lib/python2.5/site-packages/numpy/core/include/numpy/__multiarray_a
pi.h also produces errors, so I suspect it may have to do with gcc...
  
Does that file .h exist at that location?

Typically, it is the first error that I look at -- can you re-send the
output including the first error?

-Andrew

Andrew Straw wrote:

Does that file .h exist at that location?

Yes, __multiarray_api.h is in
~/lib/python2.5/site-packages/numpy/core/include/numpy/
I am installing with prefix set to home directory.

Andrew Straw wrote:

can you re-send the
output including the first error?

The full output is quite long - 1650 lines (attached)

$ python setup.py install --prefix=/home/jtamir > log
error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
-Wall -Wstrict-prototypes -fPIC -Isrc
-I/home/jtamir/lib/python2.5/site-packages/numpy/core/include
-I/home/jtamir/include/python2.5 -c src/_proj.c -o
build/temp.linux-i686-2.5/src/_proj.o" failed with exit status 1
http://www.nabble.com/file/p22992540/log log

Jon

···

--
View this message in context: http://www.nabble.com/Basemap-Installation-Errors-tp22915617p22992540.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

jtamir wrote:

Andrew Straw wrote:

Does that file .h exist at that location?

Yes, __multiarray_api.h is in
~/lib/python2.5/site-packages/numpy/core/include/numpy/
I am installing with prefix set to home directory.

Andrew Straw wrote:

can you re-send the
output including the first error?

The full output is quite long - 1650 lines (attached)

$ python setup.py install --prefix=/home/jtamir > log
error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2
-Wall -Wstrict-prototypes -fPIC -Isrc
-I/home/jtamir/lib/python2.5/site-packages/numpy/core/include
-I/home/jtamir/include/python2.5 -c src/_proj.c -o
build/temp.linux-i686-2.5/src/_proj.o" failed with exit status 1
http://www.nabble.com/file/p22992540/log log

compile options: '-Isrc -I/home/jtamir/lib/python2.5/site-packages/numpy/core/include -I/home/jtamir/include/python2.5 -c'
gcc: src/_proj.c
src/_proj.c:4:20: error: Python.h: No such file or directory

That's the first error -- and it's quite diagnostic. gcc can't find
Python.h.

I see you are doing some slightly non-standard stuff with paths. From
your paths, it appears you have Python installed in
/home/jtamir/bin/python. If this is the case, you should try
"/home/jtamir/bin/python setup.py install" (without the
--prefix=/home/jtamir). That will let distutils attempt to do everything
normally. Otherwise, you'll have to figure out what Python.h isn't in
/home/jtamir/include/python2.5 if you want the above to work.

···

--
Andrew D. Straw, Ph.D.
California Institute of Technology
http://www.its.caltech.edu/~astraw/

Andrew Straw wrote:

That's the first error -- and it's quite diagnostic. gcc can't find
Python.h.

Looks like I didn't have the python-dev package installed - I wasn't aware
it was necessary (still relatively new to these things!). Basemap is now
working correctly.

Thanks for the help,

Jon

···

--
View this message in context: http://www.nabble.com/Basemap-Installation-Errors-tp22915617p23030458.html
Sent from the matplotlib - users mailing list archive at Nabble.com.