473,320 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

MacOS X, Postgresql and Aqua Tcl/Tk

Here is how I spent the last couple of days...

Using aqua tcl/tk with postgresql seems to take a bit
of extra work.

With clues from Dan Steffen, I think I have it working...

Here is the contents of my postgresql config command:

../configure --bindir=/usr/local/bin --mandir=/usr/local/share/man \
--enable-recode --with-CXX --enable-odbc --enable-syslog \
--enable-unicode-conversion --enable-multibyte --with-perl --with-tcl
\
--with-tk --with-openssl --with-java \
--with-tclconfig=/Library/Frameworks/Tcl.framework \
--with-tkconfig=/Library/Frameworks/Tk.framework

Starting pgtksh opens the pgtksh window but clicking on the
rascal gives and error message:

set front process failed, -606

The maintainer of the Aqua tcl/tk suggested that I review the
mac-tcl list, and indeed the answer was sorta located therein.

The problem is evidently that OS X does not believe that pgtksh
is a mac application.

A solution is to create a mac application like directory structure.
Here is what I did:
In /usr/local/bin I created a directory hierarchy

pgtksh.app/Contents/MacOS

and in the MacOS directory I placed the pgtksh executable.

Then in /usr/local/bin I created a file "pgtksh" the contents
of this file :
#!/bin/sh
"/usr/local/bin/pgtksh.app/Contents/MacOS/pgtksh" "$@"

I can then invoke pgtksh by name, the script runs and the
executable is properly started.
This approach more or less mirrors what the Aqua Tk wish
application does.

I thought it would be nice not to have to rely on pgtksh
and simply "load" the libpgtcl dynamically into either
wish or tclsh. Regretably there are problems...

The make file that builds libpgtcl uses the "-bundle" directive
in the link step, this builds a Mach O bundle resource which
is not recognized by the "load" command in tcl/wish.

I edited Makefile.shlib and in the darwin part replaced "-bundle"
by "-dynamiclib".
Then in the libpgtcl directory I did a make clean and then make.
This gives a loadable libpgtcl.so file! The desired suffix for
such files is ".dylib". I went back and edited the Makefile.shlib
and arranged that the suffix be ".dylib" and rebuilt the
libpgtcl shared lib. The build produced a libpgtcl.dylib.

When I tried loading libpgtcl.dylib into tclsh I got an error
to effect that libpq.dylib could not be found. I then went
back and built a sharable libpq.dylib and tried again. This
time "loading" libpqtcl.dylib caused a complaint that two entry
points could not be found.

I then tryed building the whole thing with -dynamiclib instead of
-bundle, but soon found out that some components use the bundle
loader.

Finally I rebuilt everything from scratch without using the
-dynamiclib switch and rebuilt by hand the libpgtcl.so file
using the -dynamiclib switch and manually copied the library
to /usr/local/pgsql/lib.

It appears that I can now "load" libpgtcl.so into wish/tclsh
( but I have to specify the full path).

[time passes...]
I did not like the idea of using the full path to load the
postgresql library into tclsh/wish.

After a bit of experimenting I finally did the following
I noticed that the addon packages were stored in /Library/Tcl.
I created a directory libpgtcl2.4 in this directory. I copied
/usr/local/pgsql/lib/libpgtcl.so.2.4 into libpgtcl2.4 and
renamed it to libpgtcl.dylib. I then ran the following command
from tclsh:

pkg_mkIndex /Library/Tcl/libpgtcl2.4

this create a file pkgIndex.tcl in the target directory.
the contents of this file is:
# Tcl package index file, version 1.1
# This file is generated by the "pkg_mkIndex" command
# and sourced either when an application starts up or
# by a "package unknown" script. It invokes the
# "package ifneeded" command to set up package-related
# information so that packages will be loaded automatically
# in response to "package require" commands. When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded Pgtcl 1.4[list load [file join $dir libpgtcl.dylib]]

I was a bit surprised by the appearance of "Pgtcl". However I
can now load the postgresql library by the command:

package require Pgtcl


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
0 1520

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eric | last post by:
I am attempting to install the Zend Studio Server on a normal installation of MacOS X 10.2.8. I have downloaded ZendStudioServer-3.0.0a-Darwin-ppc (evaluation copy) and have gotten part way...
1
by: Daniel | last post by:
Hello I am developing a Java application for MacOS X, Windows and Linux. So far easy with Java. But when it comes to file types, the platfrom-specific handling knocks my application-created...
0
by: Javier Vazquez | last post by:
Hi Pardon me for being a newbie, but how do I install JMF on MacOS X? Does anyone know a website with a nice howto? I had no problem installing and running JMF on Windows, because Sun...
4
by: Michael J. Fromberger | last post by:
Greetings, The following question pertains to a problem I am solving in Python 2.4b2 on a MacOS 10 (Panther) system with an HFS+ filesystem. Given the pathname of a directory in my filesystem,...
0
by: David Simpson | last post by:
..com Solutions Inc. has released FmPro Migrator 1.97 Enterprise Edition with a new FileMaker to PostgreSQL migration feature. Images within FileMaker container fields are automatically migrated to...
1
by: Markus Seibold | last post by:
Hi, I am looking for an open source (free) data modeling tool for PostgreSQL. It should - if possible - support: - E-R-Modelling - relational data model / modeling - (GUI SQL interface to...
17
by: Jim Strickland | last post by:
We currently are running a data intensive web service on a Mac using 4D. The developers of our site are looking at converting this web service to PostgreSQL. We will have a backup of our three...
4
by: dmsbox2000-list1 | last post by:
I am running Mac OS X. I have Tcl/Tk installed. I can run the Aqua version (TkAqua) of wish by typing 'wish' at a terminal prompt. I can run the X11 version (TkX11) of wish by typing...
0
by: Mathieu Prevot | last post by:
2008/9/24 Jaime Huerta Cepas <jhuerta@cipf.es>: IMHO this is too complex to commit. Macport is a way to do what you want, but packages may not be up to date enough. Maybe the easiest and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.