Compiling source and installation woes!

Since you are facing multiple issues, let's try and get the simplest
build working and then add stuff in. First though, it would be
helpful if you told me what devel rpms you needed to install so I
recommend these on the web page to other users. BTW, the two pages
most relevant for you with installation information are
http://matplotlib.sf.net/installing.html and
http://matplotlib.sf.net/backends.html. Make sure you give these a
good read.

From reading your email, I see that you are installing everything to
your home dir, is that right?

Step 1: start with a clean matplotlib src tree. I don't want to try
  and work with the one where you have hardcoded information in the
  code because then I don't know what is going on. Just untar the
  tar.gz file in a new dir and start cleanly

Step 2: Edit setup.py and turn all the BUILD flags off, except for
  BUILD_FT2FONT. Let's try and get a working base install and then deal
  with getting the extension code compiled.

Step 3: Edit setupext.py and add any non-standard base dirs in which
  you have installed stuff (eg /home/you/usr, /home/you/usr/local') to
  the basedirs dictionary at the top of that file. Your platform is
  linux2.

Step 4: Install matplotlib with > python setup.py install

Step 5: If the build doesn't finish cleanly (the only reason I can
  think it would fail is if you don't get ft2font built properly.
  This package requires lib freetype so make you have the freetype and
  freetype-devel libs installed. It also requires libz so make sure
  you have zlib and zlib-devel installed. If you have installed these
  to a nonstandard place, make sure you add the basedir to setupext
  basedirs.

Step 6: OK, I'm assuming you have a clean install at this point. If
  you installed with a non-standard prefix, you need to set your
  MATPLOTLIBDATA environment variable. This data should point to the
  dir that contains, for example, all the Vera*.ttf files. Eg,
  /your/install/prefix/share/matplotlib. If you add this to your rc
  file, make sure you resource your rc or open a new shell.

Step 7: At this point, if you have numarray and pygtk installed
(1.99.16 or later), you should be able to import matplotlib. Open up
python shell and make sure you can do

   >>> import pygtk
   >>> pygtk.require('2.0')
   >>> import gtk
   >>> import numarray
   >>> import matplotlib

  If not, let us know what error you are getting. You should now be
  able to run python simple_plot.py -dGTK

Step 8: Edit setup.py and add the other build flags back in. You can
  set the ones you want to build to 'auto', which will try and build
  an extension if the python dependencies are found. If you still
  have problems with arrayobject.h, let me know. You can add the
  include path to that file in the build_image method in setupext.py
  by doing

      module.include_dirs.append('/your/path/to/numerix/headers')
    
  ie, /home/karthik/usr/include/python/numarray

We do want to improve the build process for people who have stuff in
non-default locations, and it would be very helpful for us if you tell
us explicitly what you had to add and change in the steps above so we
can incorporate as much as possible into the default.

Good luck!
JDH

Hi John,

Thankx for your reply. Well, i have tried the following:

step 1: done
step 2: done
step 3: i have added '/home/karthik/usr' to the basedir which is now

basedir = {
    'win32' : bla bla
    'linux2':
['/usr','/home/karthik/usr','/home/karthik/usr/include']

}

Now when i try installing matplotlib, i just get :
gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC
-I/usr/include -I/home/karthik/usr/include
-I/home/karthik/usr/include/python/numarray/include -Isrc -Iagg2/include
-I/usr/include/python2.2 -c src/_image.cpp -o
build/temp.linux-i686-2.2/_image.o -DNUMARRAY
src/_image.cpp:8:35: numarray/arrayobject.h: No such file or directory
src/_image.cpp: In function `PyObject* _image_fromarray(PyObject*,
PyObject*)':
src/_image.cpp:555: `PyArrayObject' undeclared (first use this function)
src/_image.cpp:555: (Each undeclared identifier is reported only once for
each
   function it appears in.)
src/_image.cpp:555: `A' undeclared (first use this function)
src/_image.cpp:561: parse error before `)' token
src/_image.cpp: In function `void init_image()':
src/_image.cpp:671: `import_array' undeclared (first use this function)
error: command 'gcc' failed with exit status 1

Ofcourse, numarray/arrayobject.h is at
/home/karthik/usr/include/python/numarray

What should i do next ?

With warm regards

karthik

PS: the array image was numeric

···

-----------------------------------------------------------------------
Karthikesh Raju, email: karthik@...181...
Researcher, http://www.cis.hut.fi/karthik
Helsinki University of Technology, Tel: +358-9-451 5389
Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277
Department of Computer Sc.,
P.O Box 5400, FIN 02015 HUT,
Espoo, FINLAND
-----------------------------------------------------------------------

On Thu, 13 May 2004, John Hunter wrote:

Since you are facing multiple issues, let's try and get the simplest
build working and then add stuff in. First though, it would be
helpful if you told me what devel rpms you needed to install so I
recommend these on the web page to other users. BTW, the two pages
most relevant for you with installation information are
http://matplotlib.sf.net/installing.html and
http://matplotlib.sf.net/backends.html. Make sure you give these a
good read.

From reading your email, I see that you are installing everything to
your home dir, is that right?

Step 1: start with a clean matplotlib src tree. I don't want to try
  and work with the one where you have hardcoded information in the
  code because then I don't know what is going on. Just untar the
  tar.gz file in a new dir and start cleanly

Step 2: Edit setup.py and turn all the BUILD flags off, except for
  BUILD_FT2FONT. Let's try and get a working base install and then deal
  with getting the extension code compiled.

Step 3: Edit setupext.py and add any non-standard base dirs in which
  you have installed stuff (eg /home/you/usr, /home/you/usr/local') to
  the basedirs dictionary at the top of that file. Your platform is
  linux2.

Step 4: Install matplotlib with > python setup.py install

Step 5: If the build doesn't finish cleanly (the only reason I can
  think it would fail is if you don't get ft2font built properly.
  This package requires lib freetype so make you have the freetype and
  freetype-devel libs installed. It also requires libz so make sure
  you have zlib and zlib-devel installed. If you have installed these
  to a nonstandard place, make sure you add the basedir to setupext
  basedirs.

Step 6: OK, I'm assuming you have a clean install at this point. If
  you installed with a non-standard prefix, you need to set your
  MATPLOTLIBDATA environment variable. This data should point to the
  dir that contains, for example, all the Vera*.ttf files. Eg,
  /your/install/prefix/share/matplotlib. If you add this to your rc
  file, make sure you resource your rc or open a new shell.

Step 7: At this point, if you have numarray and pygtk installed
(1.99.16 or later), you should be able to import matplotlib. Open up
python shell and make sure you can do

   >>> import pygtk
   >>> pygtk.require('2.0')
   >>> import gtk
   >>> import numarray
   >>> import matplotlib

  If not, let us know what error you are getting. You should now be
  able to run python simple_plot.py -dGTK

Step 8: Edit setup.py and add the other build flags back in. You can
  set the ones you want to build to 'auto', which will try and build
  an extension if the python dependencies are found. If you still
  have problems with arrayobject.h, let me know. You can add the
  include path to that file in the build_image method in setupext.py
  by doing

      module.include_dirs.append('/your/path/to/numerix/headers')

  ie, /home/karthik/usr/include/python/numarray

We do want to improve the build process for people who have stuff in
non-default locations, and it would be very helpful for us if you tell
us explicitly what you had to add and change in the steps above so we
can incorporate as much as possible into the default.

Good luck!
JDH

Hi John,

Looks like in the previous mail, i had set the build numarray on, now i
removed that flag, and the installation went on smooth, and i could

1) pygtk,
2) gtk, and
3) matplotlib

things went smooth so far, and i run most of the examples bearing some.
Now i will try to set things to auto slowly and try the rest.

BTW: the following were the developmental packages that i needed here:
(At work our sys's have not installed any of the developmental packages)

audiofile-devel-0.2.3-6.i386.rpm gtk2-devel-2.2.1-4.i386.rpm
esound-devel-0.2.28-4.i386.rpm gtk+-devel-1.2.10-25.i386.rpm
freetype-2.1.3-6.i386.rpm imlib-devel-1.9.13-12.i386.rpm
freetype-devel-2.1.3-6.i386.rpm ORBit-devel-0.5.17-7.i386.rpm
freetype-utils-2.1.3-6.i386.rpm pygtk2-1.99.16-8rh9.i386.rpm
glib-devel-1.2.10-10.i386.rpm
pygtk2-devel-1.99.16-8rh9.i386.rpm
gnome-libs-devel-1.4.1.2.90-32.i386.rpm
pygtk2-libglade-1.99.16-8rh9.i386.rpm

Many had circular dependences, and hence the requirement.

Thankx,

warm regards
karthik

···

-----------------------------------------------------------------------
Karthikesh Raju, email: karthik@...181...
Researcher, http://www.cis.hut.fi/karthik
Helsinki University of Technology, Tel: +358-9-451 5389
Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277
Department of Computer Sc.,
P.O Box 5400, FIN 02015 HUT,
Espoo, FINLAND
-----------------------------------------------------------------------

On Thu, 13 May 2004, John Hunter wrote:

Since you are facing multiple issues, let's try and get the simplest
build working and then add stuff in. First though, it would be
helpful if you told me what devel rpms you needed to install so I
recommend these on the web page to other users. BTW, the two pages
most relevant for you with installation information are
http://matplotlib.sf.net/installing.html and
http://matplotlib.sf.net/backends.html. Make sure you give these a
good read.

From reading your email, I see that you are installing everything to
your home dir, is that right?

Step 1: start with a clean matplotlib src tree. I don't want to try
  and work with the one where you have hardcoded information in the
  code because then I don't know what is going on. Just untar the
  tar.gz file in a new dir and start cleanly

Step 2: Edit setup.py and turn all the BUILD flags off, except for
  BUILD_FT2FONT. Let's try and get a working base install and then deal
  with getting the extension code compiled.

Step 3: Edit setupext.py and add any non-standard base dirs in which
  you have installed stuff (eg /home/you/usr, /home/you/usr/local') to
  the basedirs dictionary at the top of that file. Your platform is
  linux2.

Step 4: Install matplotlib with > python setup.py install

Step 5: If the build doesn't finish cleanly (the only reason I can
  think it would fail is if you don't get ft2font built properly.
  This package requires lib freetype so make you have the freetype and
  freetype-devel libs installed. It also requires libz so make sure
  you have zlib and zlib-devel installed. If you have installed these
  to a nonstandard place, make sure you add the basedir to setupext
  basedirs.

Step 6: OK, I'm assuming you have a clean install at this point. If
  you installed with a non-standard prefix, you need to set your
  MATPLOTLIBDATA environment variable. This data should point to the
  dir that contains, for example, all the Vera*.ttf files. Eg,
  /your/install/prefix/share/matplotlib. If you add this to your rc
  file, make sure you resource your rc or open a new shell.

Step 7: At this point, if you have numarray and pygtk installed
(1.99.16 or later), you should be able to import matplotlib. Open up
python shell and make sure you can do

   >>> import pygtk
   >>> pygtk.require('2.0')
   >>> import gtk
   >>> import numarray
   >>> import matplotlib

  If not, let us know what error you are getting. You should now be
  able to run python simple_plot.py -dGTK

Step 8: Edit setup.py and add the other build flags back in. You can
  set the ones you want to build to 'auto', which will try and build
  an extension if the python dependencies are found. If you still
  have problems with arrayobject.h, let me know. You can add the
  include path to that file in the build_image method in setupext.py
  by doing

      module.include_dirs.append('/your/path/to/numerix/headers')

  ie, /home/karthik/usr/include/python/numarray

We do want to improve the build process for people who have stuff in
non-default locations, and it would be very helpful for us if you tell
us explicitly what you had to add and change in the steps above so we
can incorporate as much as possible into the default.

Good luck!
JDH

-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options