On Thu, Jan 21, 2010 at 04:28:33AM -0500, John Wiegley wrote:
> ...
> Check the config.log file and see where it thinks Python should be.
>
> John
I am pasting some bits of my config.log - the ones that seem
relevant to me, see (1) below - Python related error messages continue
forever, so I am cutting them at some (arbitrarily chosen) point.
Concerning just the first of those error messages:
pyconfig.h: No such file or directory
patchlevel.h: No such file or directory
Python.h: No such file or directory
I have all those files in /usr/include/python2.5/
So I tried setting
$ export CPPFLAGS=-I/usr/include/python2.5
now before my
./acprep config -- --prefix=/opt/ledger
and this seems to somehow cure the problem, at least there are no
complaints about those files not being found any more.
boost_python is still not recognised on my system:
I am pasting the bits of a second config.log
(with "CPPFLAGS=-I/usr/include/python2.5") below (2).
To me it seems, the decision if boost_python is available, somehow
depends on the fact, if libboost_python-mt.a is available, and indeed:
I have a libboost_python-mt-py25.a but not a libboost_python-mt.a in
my /usr/lib
reule...@atom(/usr/lib)$ ls -l libboost* | grep pyth
lrwxrwxrwx 1 root root 22 28. Nov 17:19 libboost_python.a ->
libboost_python-py25.a
lrwxrwxrwx 1 root root 22 28. Nov 17:18 libboost_python-mt-py24.a ->
libboost_python-py24.a
lrwxrwxrwx 1 root root 30 28. Nov 17:18 libboost_python-mt-py24.so ->
libboost_python-py24.so.1.40.0
lrwxrwxrwx 1 root root 22 28. Nov 17:18 libboost_python-mt-py25.a ->
libboost_python-py25.a
lrwxrwxrwx 1 root root 30 28. Nov 17:18 libboost_python-mt-py25.so ->
libboost_python-py25.so.1.40.0
-rw-r--r-- 1 root root 553214 18. Nov 11:24 libboost_python-py24.a
lrwxrwxrwx 1 root root 30 28. Nov 17:18 libboost_python-py24.so ->
libboost_python-py24.so.1.40.0
-rw-r--r-- 1 root root 310924 18. Nov 11:24 libboost_python-py24.so.1.40.0
-rw-r--r-- 1 root root 553186 18. Nov 11:24 libboost_python-py25.a
lrwxrwxrwx 1 root root 30 28. Nov 17:18 libboost_python-py25.so ->
libboost_python-py25.so.1.40.0
-rw-r--r-- 1 root root 310924 18. Nov 11:24 libboost_python-py25.so.1.40.0
lrwxrwxrwx 1 root root 23 28. Nov 17:19 libboost_python.so ->
libboost_python-py25.so
reule...@atom(/usr/lib)$
So I am trying now to set a symbolic link (in /usr/lib):
# ln -s libboost_python-mt-py25.a libboost_python-mt.a
This seems to indeed do it, config messages seem to indicate, that
boost_python is available now:
checking if boost_regex is available... true
checking if boost_regex w/ICU is available... true
checking if boost_date_time is available... true
checking if boost_filesystem is available... true
checking if boost_iostreams is available... true
checking if boost_serialization is available... true
checking for a Python interpreter with version >= 2.4... python
checking for python... /usr/bin/python
checking for python version... 2.5
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.5/site-packages
checking for python extension module directory...
${exec_prefix}/lib/python2.5/site-packages
checking if boost_python is available... true
checking if cppunit is available... false
And I am pasting the bits of a third config.log
(with "CPPFLAGS=-I/usr/include/python2.5" and
symbolic link libboost_python-mt.a set) below (3).
So I am compiling/installing now ("make; make install") and...
...tata!
$ ledger python
Python 2.5.4 (r254:67916, Nov 19 2009, 19:43:43)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
works now. And
reule...@atom(~/work/myledger)$ ledger python ~/tmp/ledger/python/demo.py
Welcome to the Ledger.Python demo!
Demo completed successfully.
reule...@atom(~/work/myledger)$
So to summerize: I had to
* configure with CPPFLAGS=-I/usr/include/python2.5
* set a symbolic link in /usr/lib
ln -s libboost_python-mt-py25.a libboost_python-mt.a
Not sure if those things should be handled by ledger/config
or maybe reported as Debian bugs.
-Andreas
(1) config.log (without "CPPFLAGS=-I/usr/include/python2.5" set)
-----
...
configure:20520: checking for a Python interpreter with version >= 2.4
configure:20537: python -c import sys # split strings by '.' and convert to
numeric. Append some zeros # because we need at least 4 digits for the hex
conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver =
list(map(int, '2.4'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not
present in Python 3.0 and range returns an iterator for i in list(range(0, 4)):
minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)
configure:20540: $? = 0
configure:20546: result: python
configure:20554: checking for python
configure:20572: found /usr/bin/python
configure:20584: result: /usr/bin/python
configure:20602: checking for python version
configure:20609: result: 2.5
configure:20621: checking for python platform
configure:20628: result: linux2
configure:20635: checking for python script directory
configure:20656: result: ${prefix}/lib/python2.5/site-packages
configure:20665: checking for python extension module directory
configure:20686: result: ${exec_prefix}/lib/python2.5/site-packages
configure:20708: checking if boost_python is available
configure:20737: g++ -o conftest -fpch-deps -Wconversion -pthread -g -pipe
-isystem /usr/local/include -isystem /usr/include/boost -g -L/usr/local/lib
-L/usr/lib conftest.cpp -lboost_python-mt -lpython2.5 -lboost_serialization-mt
-lboost_iostreams-mt -lboost_system-mt -lboost_filesystem-mt -lboost_system-mt
-lboost_date_time-mt -licuuc -lboost_regex-mt -lmpfr -lgmp >&5
In file included from /usr/include/boost/python/detail/prefix.hpp:13,
from /usr/include/boost/python/args.hpp:8,
from /usr/include/boost/python.hpp:11,
from conftest.cpp:101:
/usr/include/boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No
such file or directory
/usr/include/boost/python/detail/wrap_python.hpp:75:24: error: patchlevel.h: No
such file or directory
/usr/include/boost/python/detail/wrap_python.hpp:78:2: error: #error Python 2.2
or higher is required for this version of Boost.Python.
/usr/include/boost/python/detail/wrap_python.hpp:142:21: error: Python.h: No
such file or directory
In file included from /usr/include/boost/python/cast.hpp:13,
from /usr/include/boost/python/handle.hpp:10,
from /usr/include/boost/python/args_fwd.hpp:10,
from /usr/include/boost/python/args.hpp:10,
from /usr/include/boost/python.hpp:11,
from conftest.cpp:101:
/usr/include/boost/python/base_type_traits.hpp:24: error: 'PyObject' was not
declared in this scope
/usr/include/boost/python/base_type_traits.hpp:24: error: template argument 1
is invalid
/usr/include/boost/python/base_type_traits.hpp:30: error: 'PyTypeObject' was
not declared in this scope
/usr/include/boost/python/base_type_traits.hpp:30: error: template argument 1
is invalid
/usr/include/boost/python/base_type_traits.hpp:36: error: 'PyMethodObject' was
not declared in this scope
/usr/include/boost/python/base_type_traits.hpp:36: error: template argument 1
is invalid
In file included from /usr/include/boost/python/handle.hpp:11,
from /usr/include/boost/python/args_fwd.hpp:10,
from /usr/include/boost/python/args.hpp:10,
from /usr/include/boost/python.hpp:11,
from conftest.cpp:101:
/usr/include/boost/python/errors.hpp:51: error: expected constructor,
destructor, or type conversion before '*' token
In file included from /usr/include/boost/python/handle.hpp:13,
from /usr/include/boost/python/args_fwd.hpp:10,
from /usr/include/boost/python/args.hpp:10,
from /usr/include/boost/python.hpp:11,
from conftest.cpp:101:
/usr/include/boost/python/handle_fwd.hpp:12: error: expected type-specifier
before 'PyObject'
/usr/include/boost/python/handle_fwd.hpp:12: error: expected '>' before
'PyObject'
In file included from /usr/include/boost/python/handle.hpp:14,
from /usr/include/boost/python/args_fwd.hpp:10,
from /usr/include/boost/python/args.hpp:10,
from /usr/include/boost/python.hpp:11,
from conftest.cpp:101:
/usr/include/boost/python/refcount.hpp: In function 'T*
boost::python::incref(T*)':
/usr/include/boost/python/refcount.hpp:16: error: 'PyObject' was not declared
in this scope
/usr/include/boost/python/refcount.hpp: In function 'T*
boost::python::xincref(T*)':
/usr/include/boost/python/refcount.hpp:23: error: 'PyObject' was not declared
in this scope
/usr/include/boost/python/refcount.hpp: In function 'void
boost::python::decref(T*)':
/usr/include/boost/python/refcount.hpp:30: error: 'PyObject' was not declared
in this scope
/usr/include/boost/python/refcount.hpp: In function 'void
boost::python::xdecref(T*)':
/usr/include/boost/python/refcount.hpp:36: error: 'PyObject' was not declared
in this scope
...
-----
(2) config.log (with "CPPFLAGS=-I/usr/include/python2.5" set)
-----
...
configure:20520: checking for a Python interpreter with version >= 2.4
configure:20537: python -c import sys # split strings by '.' and convert to
numeric. Append some zeros # because we need at least 4 digits for the hex
conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver =
list(map(int, '2.4'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not
present in Python 3.0 and range returns an iterator for i in list(range(0, 4)):
minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)
configure:20540: $? = 0
configure:20546: result: python
configure:20554: checking for python
configure:20572: found /usr/bin/python
configure:20584: result: /usr/bin/python
configure:20602: checking for python version
configure:20609: result: 2.5
configure:20621: checking for python platform
configure:20628: result: linux2
configure:20635: checking for python script directory
configure:20656: result: ${prefix}/lib/python2.5/site-packages
configure:20665: checking for python extension module directory
configure:20686: result: ${exec_prefix}/lib/python2.5/site-packages
configure:20708: checking if boost_python is available
configure:20737: g++ -o conftest -fpch-deps -Wconversion -pthread -g -pipe
-I/usr/include/python2.5 -isystem /usr/local/include -isystem
/usr/include/boost -g -L/usr/local/lib -L/usr/lib conftest.cpp
-lboost_python-mt -lpython2.5 -lboost_serialization-mt -lboost_iostreams-mt
-lboost_system-mt -lboost_filesystem-mt -lboost_system-mt -lboost_date_time-mt
-licuuc -lboost_regex-mt -lmpfr -lgmp >&5
/usr/bin/ld: cannot find -lboost_python-mt
collect2: ld returned 1 exit status
configure:20737: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "ledger"
| #define PACKAGE_TARNAME "ledger"
| #define PACKAGE_VERSION "master-0-gc6873d3"
| #define PACKAGE_STRING "ledger master-0-gc6873d3"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define PACKAGE "ledger"
| #define VERSION "master-0-gc6873d3"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_VISIBILITY 1
| #define HAVE_STDINT_H_WITH_UINTMAX 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_STDLIB_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_GETPAGESIZE 1
| #define HAVE_MMAP 1
| #define INTDIV0_RAISES_SIGFPE 1
| #define HAVE_INTTYPES_H_WITH_UINTMAX 1
| #define HAVE_UNSIGNED_LONG_LONG_INT 1
| #define HAVE_UINTMAX_T 1
| #define HAVE_INTTYPES_H 1
| #define USE_POSIX_THREADS 1
| #define USE_POSIX_THREADS_WEAK 1
| #define HAVE_PTHREAD_RWLOCK 1
| #define HAVE_PTHREAD_MUTEX_RECURSIVE 1
| #define HAVE_BUILTIN_EXPECT 1
| #define HAVE_ARGZ_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_GETCWD 1
| #define HAVE_GETEGID 1
| #define HAVE_GETEUID 1
| #define HAVE_GETGID 1
| #define HAVE_GETUID 1
| #define HAVE_MEMPCPY 1
| #define HAVE_MUNMAP 1
| #define HAVE_STPCPY 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRDUP 1
| #define HAVE_STRTOUL 1
| #define HAVE_TSEARCH 1
| #define HAVE_ARGZ_COUNT 1
| #define HAVE_ARGZ_STRINGIFY 1
| #define HAVE_ARGZ_NEXT 1
| #define HAVE___FSETLOCKING 1
| #define HAVE_DECL_FEOF_UNLOCKED 1
| #define HAVE_DECL_FGETS_UNLOCKED 1
| #define HAVE_ICONV 1
| #define ICONV_CONST
| #define HAVE_NL_LOCALE_NAME 1
| #define HAVE_LONG_LONG_INT 1
| #define HAVE_WCHAR_T 1
| #define HAVE_WINT_T 1
| #define HAVE_INTMAX_T 1
| #define HAVE_POSIX_PRINTF 1
| #define HAVE_STDINT_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_ASPRINTF 1
| #define HAVE_FWPRINTF 1
| #define HAVE_PUTENV 1
| #define HAVE_SETENV 1
| #define HAVE_SETLOCALE 1
| #define HAVE_SNPRINTF 1
| #define HAVE_WCSLEN 1
| #define HAVE_DECL__SNPRINTF 0
| #define HAVE_DECL__SNWPRINTF 0
| #define HAVE_DECL_GETC_UNLOCKED 1
| #define HAVE_LANGINFO_CODESET 1
| #define HAVE_LC_MESSAGES 1
| #define ENABLE_NLS 1
| #define DEBUG_MODE 1
| #define USE_PCH 1
| #define HAVE_UNIX_PIPES 1
| #define HAVE_BOOST_REGEX_UNICODE 1
| #define HAVE_BOOST_SERIALIZATION 1
| /* end confdefs.h. */
| #include <boost/python.hpp>
| using namespace boost::python;
| class foo {};
| BOOST_PYTHON_MODULE(samp) {
| class_< foo > ("foo") ;
| }
| int
| main ()
| {
| return 0
| ;
| return 0;
| }
configure:20752: result: false
configure:20799: checking if cppunit is available
...
-----
config.log
(with "CPPFLAGS=-I/usr/include/python2.5" and
symbolic link libboost_python-mt.a set)
-----
...
configure:20520: checking for a Python interpreter with version >= 2.4
configure:20537: python -c import sys # split strings by '.' and convert to
numeric. Append some zeros # because we need at least 4 digits for the hex
conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver =
list(map(int, '2.4'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not
present in Python 3.0 and range returns an iterator for i in list(range(0, 4)):
minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)
configure:20540: $? = 0
configure:20546: result: python
configure:20554: checking for python
configure:20572: found /usr/bin/python
configure:20584: result: /usr/bin/python
configure:20602: checking for python version
configure:20609: result: 2.5
configure:20621: checking for python platform
configure:20628: result: linux2
configure:20635: checking for python script directory
configure:20656: result: ${prefix}/lib/python2.5/site-packages
configure:20665: checking for python extension module directory
configure:20686: result: ${exec_prefix}/lib/python2.5/site-packages
configure:20708: checking if boost_python is available
configure:20737: g++ -o conftest -fpch-deps -Wconversion -pthread -g -pipe
-I/usr/include/python2.5 -isystem /usr/local/include -isystem
/usr/include/boost -g -L/usr/local/lib -L/usr/lib conftest.cpp
-lboost_python-mt -lpython2.5 -lboost_serialization-mt -lboost_iostreams-mt
-lboost_system-mt -lboost_filesystem-mt -lboost_system-mt -lboost_date_time-mt
-licuuc -lboost_regex-mt -lmpfr -lgmp >&5
configure:20737: $? = 0
configure:20752: result: true
configure:20799: checking if cppunit is available
...
-----