Thread: Postgres 7.3 from source --with-tcl : Errors again...

Postgres 7.3 from source --with-tcl : Errors again...

From
Andrew Klimov
Date:

Hi,All!

Just I'd tried to compile Postgres 7.3.1 from source with --with-tcl.

Steps:

1.CC=gcc-2 ./configure --with-tcl --with-tclconfig=/lib --with-tkconfig=/lib This goes OK.

2. make

Here what I got from make:

pgtcl.o(.text+0x13d):pgtcl.c: undefined reference to `_Tcl_GetVar'
pgtcl.o(.text+0x147):pgtcl.c: undefined reference to `_Tcl_GetDouble'
pgtcl.o(.text+0x186):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
pgtcl.o(.text+0x1a0):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
pgtcl.o(.text+0x1ba):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
pgtcl.o(.text+0x1d4):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
pgtcl.o(.text+0x1ee):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
pgtcl.o(.text+0x208):pgtcl.c: more undefined references to `_Tcl_CreateCommand' follow

... ... ... ... ...
collect2: ld returned 1 exit status
dllwrap: gcc exited with status 1
make[3]: *** [libpgtcl.a] Error 1
make[3]: Leaving directory `/usr/src/postgresql-7.3.1/src/interfaces/libpgtcl'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/postgresql-7.3.1/src/interfaces'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/postgresql-7.3.1/src'
make: *** [all] Error 2

The errors are different from those I've got from Postgres 7.2 but still present.

Any help would be very appreciated.

Andrew.



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
Jason Tishler
Date:
Andrew,

On Tue, Jan 14, 2003 at 07:29:32AM -0800, Andrew Klimov wrote:
> 2. make
>
> Here what I got from make:
>
> pgtcl.o(.text+0x13d):pgtcl.c: undefined reference to `_Tcl_GetVar'
> pgtcl.o(.text+0x147):pgtcl.c: undefined reference to `_Tcl_GetDouble'
> pgtcl.o(.text+0x186):pgtcl.c: undefined reference to `_Tcl_CreateCommand'
> [snip]

What is the link line?

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
s0lao@netscape.net (S. L.)
Date:
Jason,

[...]
>BTW, I'm wondering if PostgreSQL's autoconf stuff (i.e., config/tcl.m4)
>should be modified to find Cygwin's tclsh (i.e., tclsh83.exe)?  I
>believe that this should obviate the need to configure --with-tclconfig.
[...]

As far as I recalled cgf's announcement about 20021218-1 tcltk release (
http://www.cygwin.com/ml/cygwin/2002-12/msg00992.html) and the thread you've taken part, there _still_ are problems
withtcl/tk autoconf stuff. They were emphasized by Chuck Wilson, and cgf admitted to discuss them only on insight
mail-list.

The lack of tcl/tk autoconf (which includes the presence of non-standard paths in tclConfig.sh/tkConfig.sh) for cygwin,
leadsto wrong Makefile/Makefile.tcldefs for pltcl. I usually managed to bypass this by manually running gcc linking
lineand completing the missing parts. 

SLao

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
Jason Tishler
Date:
SLao,

On Wed, Jan 15, 2003 at 04:31:06AM -0500, S. L. wrote:
> The lack of tcl/tk autoconf (which includes the presence of
> non-standard paths in tclConfig.sh/tkConfig.sh) for cygwin, leads to
> wrong Makefile/Makefile.tcldefs for pltcl.

Nevertheless, PostgreSQL's autoconf does a very good job of getting
things right for Cygwin with the exception of the need to configure
--with-tclconfig.  Essentially all of my patch deals with supplying
missing libraries and the DLLIMPORT name clash problem.  Note that I am
just supplying libraries that were already determined by the autoconf
process.

BTW, what is "Makefile/Makefile.tcldefs"?

> I usually managed to bypass this by manually running gcc linking line
> and completing the missing parts.

The need for the above has been obviated by my patch.  IMO, it makes
more sense to polish my patch and get it accepted, than run manual links
over and over again.  Now that Cygwin has upgraded to a more modern
Tcl/Tk, shouldn't we take advantage of this?

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
s0lao@netscape.net (S. L.)
Date:
Jason,

[...]
>--with-tclconfig.  Essentially all of my patch deals with supplying
>missing libraries and the DLLIMPORT name clash problem.  Note that I am
[...]

I do appreciate your (huge!) effort for fixing a clean port to cygwin. See below.

[...]
>BTW, what is "Makefile/Makefile.tcldefs"?
[...]

It's a shortcut (SIC) for "Makefile and/or Makefile.tcldefs".

[...]
>The need for the above has been obviated by my patch.  IMO, it makes
>more sense to polish my patch and get it accepted, than run manual links
>over and over again.  Now that Cygwin has upgraded to a more modern
>Tcl/Tk, shouldn't we take advantage of this?
[...]

To be honest, my main intention was to point you back to the cygwin's tcltk last release announcement and to quicken
youto join Chuck's replies to cgf.  As you maintain 2 large ports to cygwin, both depending on tcltk (python and
postgresql),I thought you didn't push enough hard cgf about the remaining problems of his port. 

SLao

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
Jason Tishler
Date:
SLao,

On Fri, Jan 17, 2003 at 02:03:51AM -0500, S. L. wrote:
> I do appreciate your (huge!) effort for fixing a clean port to cygwin.

Thanks.

> >BTW, what is "Makefile/Makefile.tcldefs"?
> It's a shortcut (SIC) for "Makefile and/or Makefile.tcldefs".

Doh!  I thought it was a full pathname.

Is it a Tcl/Tk file?  I cannot find it under the PostgreSQL source tree:

    $ # cd to top of PostgreSQL source tree
    $ find . -name Makefile.tcldefs
    $

> To be honest, my main intention was to point you back to the cygwin's
> tcltk last release announcement and to quicken you to join Chuck's
> replies to cgf.

See below...

> As you maintain 2 large ports to cygwin, both depending on tcltk
> (python and postgresql)

I'm still wondering why I did this to myself. :,)

> I thought you didn't push enough hard cgf about the remaining problems
> of his port.

Unfortunately, due to time constraints, one has to choose their battles.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
s0lao@netscape.net (S. L.)
Date:
Jason,

[...]
>Is it a Tcl/Tk file?  I cannot find it under the PostgreSQL source tree:
>
>    $ # cd to top of PostgreSQL source tree
>    $ find . -name Makefile.tcldefs
>    $
[...]

Actually it has this name after configure -- it's generated by "src/pl/tcl/mkMakefile.tcldefs.sh" file.

[...]
>Unfortunately, due to time constraints, one has to choose their battles.
[...]

Agreed.

SLao

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
Jason Tishler
Date:
SLao,

On Mon, Jan 20, 2003 at 01:31:30AM -0500, S. L. wrote:
> [...]
> >Is it a Tcl/Tk file?  I cannot find it under the PostgreSQL source tree:
> >
> >    $ # cd to top of PostgreSQL source tree
> >    $ find . -name Makefile.tcldefs
> >    $
> [...]
>
> Actually it has this name after configure -- it's generated by
> "src/pl/tcl/mkMakefile.tcldefs.sh" file.

Huh?  Under what version?  I cannot find this file in my CVS working
directory even after configuring.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
Peter Eisentraut
Date:
Jason Tishler writes:

> > Actually it has this name after configure -- it's generated by
> > "src/pl/tcl/mkMakefile.tcldefs.sh" file.
>
> Huh?  Under what version?  I cannot find this file in my CVS working
> directory even after configuring.

Maybe I could clear this up by telling you that this file was removed in
7.3.

--
Peter Eisentraut   peter_e@gmx.net


Re: Postgres 7.3 from source --with-tcl : Errors again...

From
Jason Tishler
Date:
Peter,

On Mon, Jan 20, 2003 at 10:21:36PM +0100, Peter Eisentraut wrote:
> Jason Tishler writes:
> > > Actually it has this name after configure -- it's generated by
> > > "src/pl/tcl/mkMakefile.tcldefs.sh" file.
> >
> > Huh?  Under what version?  I cannot find this file in my CVS working
> > directory even after configuring.
>
> Maybe I could clear this up by telling you that this file was removed
> in 7.3.

Thanks for the above.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
s0lao@netscape.net (S. L.)
Date:
Jason,

[this is just a digression from the main subject, but not off topic]

Anyway, if plTcl is harder to manage to compile, I think a more usefull tcl approach would be to have a cygwin
autotoolsenabled pgtcl binding library. In my opinion a lot of users come to pl/Tcl as a quick way to have graphical
interfacesto postgresql, not necessary because of their better skills in tcl than e.g. pl/pgSQL. 

As I said, I manually built pl/Tcl, but I must confess I didn't test whether it worked or not. But pgTcl with its
pgAccessas a main purpose does. 

SLao

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
Jason Tishler
Date:
SLao,

On Wed, Jan 22, 2003 at 01:59:29AM -0500, S. L. wrote:
> Anyway, if plTcl is harder to manage to compile, I think a more
> usefull tcl approach would be to have a cygwin autotools enabled pgtcl
> binding library. In my opinion a lot of users come to pl/Tcl as a
> quick way to have graphical interfaces to postgresql, not necessary
> because of their better skills in tcl than e.g. pl/pgSQL.

I will leave it to others to address the above.

Anyway, I started to debug the PL/Tcl problem.  These are my
observations:

1. pltcl.dll is successfully loaded by postgres
2. pltcl.dll is successfully loading cygtcl83.dll (which is not
   surprising since the Windows loader does this)
3. pltcl.dll is failing in pltcl_init_all() (which is very early in the
   initialization process)
4. Tcl_CreateInterp() succeeds (so at least one Tcl function seems to
   work)
5. Tcl_CreateSlave() fails (unfortunately, I could not determine why
   with a limited amount of effort)

I will leave it to those who have the interest to continue
debugging this problem.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
Jason Tishler
Date:
On Thu, Jan 23, 2003 at 07:51:21AM -0500, Jason Tishler wrote:
> Anyway, I started to debug the PL/Tcl problem.  These are my
> observations:
>
> 1. pltcl.dll is successfully loaded by postgres
> 2. pltcl.dll is successfully loading cygtcl83.dll (which is not
>    surprising since the Windows loader does this)
> 3. pltcl.dll is failing in pltcl_init_all() (which is very early in the
>    initialization process)
> 4. Tcl_CreateInterp() succeeds (so at least one Tcl function seems to
>    work)
> 5. Tcl_CreateSlave() fails (unfortunately, I could not determine why
>    with a limited amount of effort)
>
> I will leave it to those who have the interest to continue
> debugging this problem.

I believe that I have figured out why Tcl_CreateSlave() failed above.
Since Cygwin Tcl/Tk is a hybrid Cygwin/Win32 it needs TCL_LIBRARY (and
possibly TK_LIBRARY) set with Win32 paths:

    export TCL_LIBRARY=$(cygpath -w /usr/share/tcl8.4) TK_LIBRARY=$(cygpath -w /usr/share/tk8.4)

This seems to get PL/Tcl much further.  However, it now fails during the
first insert with the following:

LOG:  server process (pid 2960) exited with exit code 128
LOG:  terminating any other active server processes
LOG:  all server processes terminated; reinitializing shared memory and semaphores
IpcMemoryCreate: shmget(key=5432001, size=638976, 03600) failed: Not enough core

This error usually means that PostgreSQL's request for a shared
memory segment exceeded available memory or swap space.
To reduce the request size (currently 638976 bytes), reduce
PostgreSQL's shared_buffers parameter (currently 16) and/or
its max_connections parameter (currently 4).

The PostgreSQL Administrator's Guide contains more information about
shared memory configuration.

Unfortunately, the standard fix of increasing

    HKCU\Software\Cygnus Solutions\Cygwin\heap_chunk_in_mb

doesn't seem to help. :,(

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
s0lao@netscape.net (S. L.)
Date:
Jason,

[...]
>    HKCU\Software\Cygnus Solutions\Cygwin\heap_chunk_in_mb
>
>doesn't seem to help. :,(
[...]

Dunno if it's a real hint (I still don't have a 7.3 distro available, yet), but:
1. In my previous experiences with interfaces/libpgtcl and pl/tcl I had to comment out the Tcl_CreateChannelHandler and
Tcl_DeleteChannelHandlerin pgtclId.c from interfaces/libpgtcl. And pgtcl.dll worked. 
2. Actually pltcl.c didn't need this "patch", but as I've verified now, there are pltcl_[*]_handler functins that can
relyon the two functions above, that are not (or are defective) present in libtcl. 

SLao

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

Re: Postgres 7.3 from source --with-tcl : Errors again...

From
Jason Tishler
Date:
On Mon, Feb 03, 2003 at 02:40:01AM -0500, S. L. wrote:
> [...]
> >    HKCU\Software\Cygnus Solutions\Cygwin\heap_chunk_in_mb
> >
> >doesn't seem to help. :,(

The above problem was not due to exhausting the Cygwin heap.  Instead,
it was cygipc's shmget() returning ENOMEM because /tmp/cygipc_0 was open
and mmap-ed in another backend:

    (libcygipc) newseg : LBuff = /tmp/cygipc_0, errno = 13, return -ENOMEM (2)

See the following thread for the root cause analysis:

    http://cygwin.com/ml/cygwin/2003-02/msg00255.html

I'm amazed that (so far) only PL/Tcl has triggered this problem.

Does anyone have any ideas on how to workaround this problem?  Is it
time to switch to the Win32 version? :,)

Thanks,
Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6