[oe-users] (Somewhat urgent) build problem
Yang
c17mswr02 at sneakemail.com
Thu Sep 20 05:59:14 UTC 2007
I modified pygresql's setup.py to print out the PATH environment
variable, which showed
/data2/yang/oe/tmp/staging/i686-linux/bin/i486-linux:/data2/yang/oe/tmp/staging/i686-linux/bin:/data2/yang/oe/tmp/cross/bin:/data2/yang/oe/bitbake/bin:...
So I did:
cp postgresql/usr/bin/pg_config /data2/yang/oe/tmp/staging/i686-linux/bin/
cp -r postgresql-dev/usr/* /data2/yang/oe/tmp/staging/i686-linux/
However, that still doesn't work. pygresql's setup.py still complains that
| Traceback (most recent call last):
| File "setup.py", line 84, in <module>
| pg_include_dir = pg_config('includedir')
| File "setup.py", line 54, in pg_config
| raise Exception, "pg_config tool is not available."
| Exception: pg_config tool is not available.
On 9/19/07, Yang c17mswr02-at-sneakemail.com |openembedded|
<...> wrote:
> With psycopg2, it doesn't seem to fail due to a missing pg_config, but
> it does complain about it, and fails later because it can't find the
> postgresql header files:
>
> ERROR: function do_compile failed
> ERROR: log data follows
> (/data2/yang/oe/tmp/work/i486-linux/psycopg-1.0-r1/temp/log.do_compile.32705)
> | running build
> | running build_py
> | running build_ext
> | Warning: /bin/sh: pg_config: command not found
> | NOTE: sysconfig.get_config_h_filename() altered for OpenEmbedded
> | NOTE: sysconfig.get_config_h_filename() altered for OpenEmbedded
> | building 'psycopg2._psycopg' extension
> | ccache i486-linux-gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
> -isystem/data2/yang/oe/tmp/staging/i486-linux/include
> -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2
> -isystem/data2/yang/oe/tmp/staging/i486-linux/include -fPIC
> -DPY_MAJOR_VERSION=2 -DPY_MINOR_VERSION=5 -DHAVE_PYBOOL=1
> -DHAVE_DECIMAL=1 -DHAVE_PYDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1
> -DPSYCOPG_VERSION="2.0.6 (dec dt ext pq3)" -DPSYCOPG_EXTENSIONS=1
> -DPSYCOPG_DISPLAY_SIZE=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1
> -DHAVE_PQPROTOCOL3=1
> -I/data2/yang/oe/tmp/staging/i486-linux/include/python2.5 -I. -c
> psycopg/psycopgmodule.c -o
> build/temp.linux-i686-2.5/psycopg/psycopgmodule.o
> | In file included from psycopg/psycopgmodule.c:29:
> | ./psycopg/connection.h:27:22: error: libpq-fe.h: No such file or directory
> | In file included from psycopg/psycopgmodule.c:29:
> | ./psycopg/connection.h:56: error: expected specifier-qualifier-list
> before 'PGconn'
> | In file included from psycopg/psycopgmodule.c:30:
> | ./psycopg/cursor.h:56: error: expected specifier-qualifier-list
> before 'PGresult'
> | psycopg/psycopgmodule.c: In function '_psyco_connect_fill_exc':
> ....
>
> I noticed that the files I'm interested in are mostly under a
> postgresql-dev directory:
>
> $ find . -name 'libpq*h'
> ./work/i486-linux/postgresql-8.2.4-r0/postgresql-8.2.4/src/include/libpq/libpq-be.h
> ./work/i486-linux/postgresql-8.2.4-r0/postgresql-8.2.4/src/include/libpq/libpq-fs.h
> ./work/i486-linux/postgresql-8.2.4-r0/postgresql-8.2.4/src/include/libpq/libpq.h
> ./work/i486-linux/postgresql-8.2.4-r0/postgresql-8.2.4/src/interfaces/libpq/libpq-fe.h
> ./work/i486-linux/postgresql-8.2.4-r0/postgresql-8.2.4/src/interfaces/libpq/libpq-int.h
> ./work/i486-linux/postgresql-8.2.4-r0/install/postgresql-dev/usr/include/libpq-fe.h
> ./work/i486-linux/postgresql-8.2.4-r0/install/postgresql-dev/usr/include/libpq/libpq-fs.h
> ./work/i486-linux/postgresql-8.2.4-r0/install/postgresql-dev/usr/include/postgresql/internal/libpq-int.h
> ./work/i486-linux/postgresql-8.2.4-r0/install/postgresql-dev/usr/include/postgresql/server/libpq/libpq-be.h
> ./work/i486-linux/postgresql-8.2.4-r0/install/postgresql-dev/usr/include/postgresql/server/libpq/libpq-fs.h
> ./work/i486-linux/postgresql-8.2.4-r0/install/postgresql-dev/usr/include/postgresql/server/libpq/libpq.h
>
> 'postgresql-dev' sounds interesting, but I'm not sure what to do with
> it. I tried adding postgresql-dev as a DEPENDS but that didn't seem to
> do anything. I also tried 'bitbake postgresql-dev' but that failed,
> saying that "ERROR: No providers of build target postgresql-dev (for
> [])."
>
> I saw that other packages sometimes have -dev mentioned in lines that look like:
>
> PACKAGES = "${PN}-doc ${PN}-dev"
>
> but when I tried to add this into the postgresql .bb, nothing happened.
>
> On 9/19/07, Yang c17mswr02-at-sneakemail.com |openembedded|
> <...> wrote:
> > Update: I see the exact same problem with psycopg2, an alternative
> > python-postgresql binding.
> >
> > On 9/19/07, Yang c17mswr02-at-sneakemail.com |openembedded|
> > <...> wrote:
> > > Hi, I'm trying to get pygresql into my image. pygresql is a Python C
> > > module that provides bindings to Postgres. Here is my package for
> > > pygresql (pgdb.bb):
> > >
> > > SECTION = "network"
> > > DESCRIPTION = "PGDB"
> > > LICENSE ="GPL"
> > > PR="r1"
> > > DEPENDS = "postgresql"
> > > RDEPENDS = "postgresql"
> > > SRC_URI = "ftp://ftp.pygresql.org/pub/distrib/PyGreSQL.tgz"
> > > S = "${WORKDIR}/PyGreSQL-3.8.1"
> > > inherit distutils
> > >
> > > It fails, however, with the following:
> > >
> > > NOTE: package pgdb-1.0: started
> > > NOTE: package pgdb-1.0-r1: task do_compile: started
> > > ERROR: function do_compile failed
> > > ERROR: log data follows
> > > (/data2/yang/oe/tmp/work/i486-linux/pgdb-1.0-r1/temp/log.do_compile.32140)
> > > | sh: pg_config: command not found
> > > | Traceback (most recent call last):
> > > | File "setup.py", line 81, in <module>
> > > | pg_include_dir = pg_config('includedir')
> > > | File "setup.py", line 51, in pg_config
> > > | raise Exception, "pg_config tool is not available."
> > > | Exception: pg_config tool is not available.
> > > | FATAL: python setup.py build_ext execution failed.
> > > NOTE: Task failed:
> > > /data2/yang/oe/tmp/work/i486-linux/pgdb-1.0-r1/temp/log.do_compile.32140
> > >
> > > This is because pygresql's setup.py runs 'pg_config' to get
> > > information about the postgresql installation. I see pg_config in the
> > > following places under tmp/:
> > >
> > > ./work/i486-linux/postgresql-8.2.4-r0/postgresql-8.2.4/src/bin/pg_config
> > > ./work/i486-linux/postgresql-8.2.4-r0/postgresql-8.2.4/src/bin/pg_config/pg_config
> > > ./work/i486-linux/postgresql-8.2.4-r0/install/postgresql-dbg/usr/bin/.debug/pg_config
> > > ./work/i486-linux/postgresql-8.2.4-r0/install/postgresql/usr/bin/pg_config
> > > ./rootfs/usr/bin/pg_config
> > >
> > > I'm not sure how to make this visible to the distutil class'
> > > do_compile(). So that's the first problem.
> > >
> > > The second (potential) problem: later on down the line the build
> > > process will also require the postgres development headers (eg
> > > postgres.h). These are only available at the following locations:
> > >
> > > ./work/i486-linux/postgresql-8.1.8-r0/postgresql-8.1.8/src/include/postgres.h
> > > ./work/i486-linux/postgresql-8.2.4-r0/postgresql-8.2.4/src/include/postgres.h
> > > ./work/i486-linux/postgresql-8.2.4-r0/install/postgresql-dev/usr/include/postgresql/server/postgres.h
> > > ./work/i486-linux/pgdb-1.0-r1/PyGreSQL-3.8.1/include/postgres.h
> > >
> > > I have no idea how that last instance of postgres.h got there; it was
> > > not part of the original PyGreSql.tgz, and when I build on my host
> > > machine, an include directory is never created. If this is all a sign
> > > that finding the headers won't be a problem down the line, then great
> > > - otherwise, how do I ensure that the headers are visible (like
> > > pg_config)?
> > >
> > > Any guidance would be tremendously appreciated. Thanks a lot!
> > >
> > > Yang
> > >
> > > _______________________________________________
> > > Openembedded-users mailing list
> > > Openembedded-users at lists.openembedded.org
> > > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-users
> > >
> >
> > _______________________________________________
> > Openembedded-users mailing list
> > Openembedded-users at lists.openembedded.org
> > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-users
> >
>
> _______________________________________________
> Openembedded-users mailing list
> Openembedded-users at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-users
>
More information about the Openembedded-users
mailing list