Thread: tcl on Mac OS X

tcl on Mac OS X

From
Jeremy Buchmann
Date:
I've been experimenting with Mac OS X lately and would like to get 
pgaccess running on it.  The database itself is on another machine, but  
I built the libpq and libpgtcl interfaces on OS X and installed them to 
/usr/local/pgsql/lib.  The version of tcl that comes with OS X doesn't 
support dynamic loading, so I rebuilt tcl/tk 8.3.3 with a patch that 
enables dynamic loading on OS X.  After installing that, I downloaded 
pgaccess and gave it a shot...and I got the following error message:

Error in startup script: dyld: permission denied    while executing
"load libpgtcl[info sharedlibextension]"    (procedure "main" line 3)    invoked from within
"main $argc $argv"    (file "/usr/local/pgaccess/main.tcl" line 249)

I'm not quite sure what that means...my only guess was the permissions 
were wrong on either libpq or libpgtcl, but they look ok to me:

[localhost:local/pgsql/lib] root# ll
total 1856
drwxr-xr-x  10 root  wheel     296 Aug 30 16:55 .
drwxr-xr-x   4 root  wheel      92 Aug 30 16:32 ..
-rw-r--r--   1 root  wheel  201368 Aug 30 16:32 libpgtcl.a
lrwxr-xr-x   1 root  wheel      15 Aug 30 16:55 libpgtcl.so -> 
libpgtcl.so.2.1
lrwxr-xr-x   1 root  wheel      15 Aug 30 16:55 libpgtcl.so.2 -> 
libpgtcl.so.2.1
-rwxr-xr-x   1 root  wheel  243396 Aug 30 16:32 libpgtcl.so.2.1
-rw-r--r--   1 root  wheel  306044 Aug 30 16:55 libpq.a
lrwxr-xr-x   1 root  wheel      12 Aug 30 16:55 libpq.so -> libpq.so.2.1
lrwxr-xr-x   1 root  wheel      12 Aug 30 16:55 libpq.so.2 -> 
libpq.so.2.1
-rwxr-xr-x   1 root  wheel  174228 Aug 30 16:55 libpq.so.2.1

I'm in XDarwin when I'm running it, so it shouldn't be an X Windows 
related problem.  Does anyone else have any ideas?

--Jeremy  [jeremy@wellsgaming.com]


Re: tcl on Mac OS X

From
Constantin Teodorescu
Date:
Jeremy Buchmann wrote:
> 
> I've been experimenting with Mac OS X lately and would like to get
> pgaccess running on it.  The database itself is on another machine, but
> I built the libpq and libpgtcl interfaces on OS X and installed them to
> /usr/local/pgsql/lib.  The version of tcl that comes with OS X doesn't
> support dynamic loading, so I rebuilt tcl/tk 8.3.3 with a patch that
> enables dynamic loading on OS X.  After installing that, I downloaded
> pgaccess and gave it a shot...and I got the following error message:
> 
> Error in startup script: dyld: permission denied
>      while executing
> "load libpgtcl[info sharedlibextension]"
>      (procedure "main" line 3)
>      invoked from within
> "main $argc $argv"
>      (file "/usr/local/pgaccess/main.tcl" line 249)
> 
> I'm not quite sure what that means...my only guess was the permissions
> were wrong on either libpq or libpgtcl, but they look ok to me:

1. try to run pgaccess as root 
2. try to change the source instead of

load libpgtcl[info sharedlibextension]

to a more direct pointing to

load /usr/local/pgsql/lib/libpgtcl.so ... or whatever extension the
libpgtcl file has ...

Teo


Re: tcl on Mac OS X

From
Jeremy Buchmann
Date:
On Friday, August 31, 2001, at 08:21 AM, Constantin Teodorescu wrote:

> Jeremy Buchmann wrote:
>>
>> I've been experimenting with Mac OS X lately and would like to get
>> pgaccess running on it.  The database itself is on another machine, but
>> I built the libpq and libpgtcl interfaces on OS X and installed them to
>> /usr/local/pgsql/lib.  The version of tcl that comes with OS X doesn't
>> support dynamic loading, so I rebuilt tcl/tk 8.3.3 with a patch that
>> enables dynamic loading on OS X.  After installing that, I downloaded
>> pgaccess and gave it a shot...and I got the following error message:
>>
>> Error in startup script: dyld: permission denied
>>      while executing
>> "load libpgtcl[info sharedlibextension]"
>>      (procedure "main" line 3)
>>      invoked from within
>> "main $argc $argv"
>>      (file "/usr/local/pgaccess/main.tcl" line 249)
>>
>> I'm not quite sure what that means...my only guess was the permissions
>> were wrong on either libpq or libpgtcl, but they look ok to me:
>
> 1. try to run pgaccess as root

Tried this and got the same error as above.

> 2. try to change the source instead of
>
> load libpgtcl[info sharedlibextension]
>
> to a more direct pointing to
>
> load /usr/local/pgsql/lib/libpgtcl.so ... or whatever extension the
> libpgtcl file has ...

Tried this and got a new error message:

[localhost:~] buchmann% /usr/local/pgaccess/pgaccess
Error in startup script: couldn't find procedure .dylib_Init    while executing
"load /usr/local/pgsql/lib/libpgtcl.so [info sharedlibextension]"    (procedure "main" line 3)    invoked from within
"main $argc $argv"    (file "/usr/local/pgaccess/main.tcl" line 249)

Still looks like some dyn lib stuff.  While going over the process in my 
head, I remembered that Tk wasn't patched, so it probably didn't compile 
with dynamic loading...do you think this could be the problem?

Thanks,

Jeremy Buchmann  [jeremy@wellsgaming.com]


Re: tcl on Mac OS X

From
Constantin Teodorescu
Date:
Jeremy Buchmann wrote:
> 
> > load /usr/local/pgsql/lib/libpgtcl.so ... or whatever extension the
> > libpgtcl file has ...
> 
> Tried this and got a new error message:
> 
> [localhost:~] buchmann% /usr/local/pgaccess/pgaccess
> Error in startup script: couldn't find procedure .dylib_Init
>      while executing
> "load /usr/local/pgsql/lib/libpgtcl.so [info sharedlibextension]"
>      (procedure "main" line 3)
>      invoked from within
> "main $argc $argv"
>      (file "/usr/local/pgaccess/main.tcl" line 249)
> 
> Still looks like some dyn lib stuff.  While going over the process in my
> head, I remembered that Tk wasn't patched, so it probably didn't compile
> with dynamic loading...do you think this could be the problem?

I think that Tcl does the library loading, so Tk might not be a problem!

Why don't you try to build from sources "pgtclsh" and skip that dynamic
loading?

Teo