configuring problems

Asked by Georg Holzmann

Hallo!

First I want to say that I find a numpy to octave bridge really useful !
So thanks for your efforts !

OK, now to the problem:
I did not manage to build the code.

First autoconf failed with the following: autoreconf --install
Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 186.
Use of uninitialized value $libtoolize in pattern match (m//) at /usr/bin/autoreconf line 186.
configure.ac:125: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

Then, configure did not find all my libraries: ./configure
[...]
checking for python2.4/Python.h... (cached) no
checking for python... (cached) python2.4
checking for main in -lpython2.4... (cached) no
checking for python2.4/Python.h... (cached) no
  results of the Python check:
    Binary: python2.4
    Library: no
    Include Dir: no
checking whether the Boost::Python library is available... no
configure: WARNING: Linking to Octave failed.
configure: WARNING: Cannot find Boost::Python lib.
configure: error: Configuration failed. Halt.

I am using Ubuntu Intrepid and Python 2.5 - maybe this is the problem ?
(libboost-python-dev and octave-3.0 is installed)

Thanks for any hints, I am looking forward to test this package !
LG
Georg

Question information

Language:
English Edit question
Status:
Solved
For:
Pytave Edit question
Assignee:
No assignee Edit question
Solved by:
qwertitis
Solved:
Last query:
Last reply:
Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :
#1

This is a known problem that I've fixed on my working repository, at least for Ubuntu 8.04. Just forgot to push it to trunk. So thanks for the reminder. :) Don't have access to the changes right now, expect a commit later today though.

Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :
#2

Hmm, seems like I have my fixes already committed. Make sure you have build-essentials, libtool, libboost, python-dev and octave-dev packages installed (not actual names listed). Notice that you need the development tools from Octave/Python, complementing the binary package.

Revision history for this message
Georg Holzmann (grh-mur) said :
#3

Okay, installing libtool solved the problem with autoconf, but configure still does not recognize libboost, python and octave:
[...]
  results of the Python check:
    Binary: python2.4
    Library: no
    Include Dir: no
checking whether the Boost::Python library is available... no
configure: WARNING: Linking to Octave failed.
configure: WARNING: Cannot find Boost::Python lib.
configure: error: Configuration failed. Halt.

Could you tell me which exact packages you have installed (if you also have ubuntu) ?
Because I think I have the development packages selected ...

Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :
#4

This should work:

sudo apt-get install bzr autoconf libtool build-essential octave3.0-headers libboost-python-dev
sudo updatedb
bzr co lp:pytave
cd pytave
autoreconf --install
./configure
make
PYTHONPATH=.libs:package python test/test.py
PYTHONPATH=.libs:package python test/exceptions.py

NOTICE, I've recently committed changes to the trunk that fixes a compile error introduced with the newer compiler in 8.10.

Revision history for this message
Georg Holzmann (grh-mur) said :
#5

Hallo!

First many thanks for your answer !
Now the octave dependencies are fulfilled - however, I still have problems with boost-python, although I installed the packages:

checking for python2.4/Python.h... (cached) no
  results of the Python check:
    Binary: python2.4
    Library: no
    Include Dir: no
checking whether the Boost::Python library is available... no
configure: WARNING: Cannot find Boost::Python lib.
configure: error: Configuration failed. Halt.

I have the following versions of boost-python available and tried both:
sudo aptitude search libboost-python
p libboost-python-dev - Boost.Python Library development files
c libboost-python1.34.1 - Boost.Python Library
i libboost-python1.35-dev - Boost.Python Library development files
i libboost-python1.35.0 - Boost.Python Library

So maybe this is a problem with the configure script ? Or do I need any other packages ?

Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :
#6

I constructed the instructions by running on a fresh install of Ubuntu 8.10. One must not get `no' for any of the Python checks, since they are needed to pass the Boost::Python checks later on. The ax_python.m4 script (unfortunately) depends on a fresh `locate' database to find the Python include dirs, so make sure to run sudo updatedb.

Revision history for this message
Georg Holzmann (grh-mur) said :
#7

OK, I am getting closer and closer ... ;)

First:
It seems that you only check for python2.4 ?
Because 2.5 is standard now on Ubuntu 8.10 and by installing also the python2.4-dev package, the python check was finally successful.

But:
Now it has again a problem with BoostPython.
It is installed, but I guess this only works now for python2.5 and you try to use python2.4 ?

./configure:
checking whether the Boost::Python library is available... yes
checking for exit in -lboost_python... no
checking for exit in -lboost_python... (cached) no
configure: WARNING: Cannot find Boost::Python lib.

So is it possible to force pytave to use python2.5 ?

Many Thanks !

Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :
#8

Post a link to pastebin.ca with your config.log and I'll have a look.

Revision history for this message
Georg Holzmann (grh-mur) said :
#9

You can find the config.log here:
http://grh.mur.at/config.log

Revision history for this message
Best qwertitis (qwertitis-deactivatedaccount) said :
#10

configure:5504: checking for exit in -lboost_python
configure:5539: g++ -o conftest -g -O2 conftest.cpp -lboost_python -lpython2.4 >&5
/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/libboost_python.so: undefined reference to `PyErr_WarnEx'
collect2: ld returned 1 exit status
configure:5545: $? = 1

I think libboost_python requires python2.5, but is linked to the python2.4 library where PyErr_WarnEx isn't to be found. This is my best guess since PyErr_WarnEx seems to be a recent addition to Python.

Try editing your m4/ax_python.m4 script and reorder so that 2.5 is checked for first.

To be really sure, change
for python in python2.4 python2.5 python2.3 python2.2 python2.1 python; do
to
for python in python2.5; do

Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :
#11

And oh, don't forget to autoreconf.

Revision history for this message
Florent J. (florenj) said :
#12

I had the same problem under Ubuntu hardy, and the described modification of m4/ax_python.m4 solved the problem, thanks.

Revision history for this message
Georg Holzmann (grh-mur) said :
#13

Thanks individ, that solved my question.

Revision history for this message
Georg Holzmann (grh-mur) said :
#14

Thanks individ and Florent - now it compiled !

One more minor thing:
when doing a "make install" without declaring a path, it will create a "/invalidpath," directory and puts the files there ... is this intended ?

Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :
#15

make install won't work correctly since autoconf and friends aren't really aware of Python packaging, and I haven't looked into it any further than that. That invalidpath stuff is just an ugly hack to make sure no one actually installs files (incorrectly) on their system. I guess it is unfortunate that invalidpath really is a valid path, though. The configuring in general could use some love.

Revision history for this message
Andrea Spadaccini (a-spadaccini) said :
#16

Another small bug: due to dependance on locate, if there are multiple copies of Python.h (like in my setup, where I have a sage installation lying in my home dir) it fails. I'd like to help, but I'm not an autotools user. :( I simply forced the correct path in configure

Revision history for this message
Robert Layton (robertlayton) said :
#17

I have just installed pytave on (K)Ubuntu 9.04, which had python 2.6 installed on it.

Instead of changing this line:
for python in python2.4 python2.5 python2.3 python2.2 python2.1 python; do
to
for python in python2.5; do
As decribed above, change it to:
for python in python2.6

With the above instructions for building on Ubuntu 8.10, this should all 'just work'.
Also, run :
sudo python setup.py install
at the end, so that you don't need to mess with the path when starting python (see the readme file)

Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :
#18

Revision 9 is now pushed to lp:pytave. Among other modifications, the ac_python.m4 script has been replaced with a completely different script. I hope this remedies the problem with multiple Python installations. If you are running from an previous checkout/branch, don't forget to run autoreconf && ./configure before building.