[Phoenix-pm] Bob Lindley's Question

Robert Lindley bob at brogmoid.com
Mon Sep 6 15:35:37 PDT 2010


Thanks, that allowed cpan to do the installation of both Tcl and Tks and 
run the tests successful.
I would not have guessed to try that. New lesson learned.

Here is a sample program tkx-hello.pl...
-------------------------------------------------------------
#!/usr/bin/perl -w
use strict;
use Tkx;

my $mw = Tkx::widget->new(".");
$mw->g_wm_title("Hello, world");
$mw->g_wm_minsize(300, 200);

my $b;
$b = $mw->new_button(
     -text => "Hello, world",
     -command => sub {
         $b->m_configure(
             -text => "Goodbye, cruel world",
         );
         Tkx::after(1500, sub { $mw->g_destroy });
     },
);
$b->g_pack(
     -padx => 10,
     -pady => 10,
);

Tkx::tk___messageBox(
    -parent => $mw,
    -icon => "info",
    -title => "Tip of the Day",
    -message => "Please be nice!",
);
-------------------------------------------------------------

When I ran it, I got:
root at bob:/home/bob/work/Tkx# which perl
/usr/bin/perl
root at bob:/home/bob/work/Tkx# ./tkx-hello.pl
Segmentation fault
root at bob:/home/bob/work/Tkx# perl -d ./tkx-hello.pl

Loading DB routines from perl5db.pl version 1.32
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

Signal SEGV at /usr/local/lib/perl/5.10.1/Tcl.pm line 420
         require Tcl.pm called at /usr/local/share/perl/5.10.1/Tkx.pm 
line 215
         Tkx::i::BEGIN() called at /usr/local/lib/perl/5.10.1/Tcl.pm line 0
         eval {...} called at /usr/local/lib/perl/5.10.1/Tcl.pm line 0
         require Tkx.pm called at ./tkx-hello.pl line 3
         main::BEGIN() called at /usr/local/lib/perl/5.10.1/Tcl.pm line 0
         eval {...} called at /usr/local/lib/perl/5.10.1/Tcl.pm line 0
Aborted
No clue what is wrong even from the debugger!
Well, it does say to look at line 420 of Tcl.pm and the analysis is left 
to the student.

When I ran it with ActivePerl, I got:
root at bob:/home/bob/work/Tkx# which aperl
/usr/local/bin/aperl
root at bob:/home/bob/work/Tkx# aperl ./tkx-hello.pl
root at bob:/home/bob/work/Tkx#
This works as expected.

On 09/05/2010 10:54 PM, Douglas E. Miles wrote:
> I was getting the "NpLoadLibrary: could not find Tcl dll" error until 
> I installed the dev package for Tcl. It may actually be looking for 
> header files or something. Make sure you have that installed on your 
> system and try again.
>
> On 09/05/2010 05:49 PM, Robert Lindley wrote:
>> Doug,
>>
>> I followed your link to the Perl Testers report. I have not looked at 
>> Perl Testers for a very long time. The last time that I looked all I 
>> found was an incomprehensible information overload. That chart that 
>> they have now tells you what you want to know.   I looks like Tkx 
>> worked on 5.10.0 and not on 5.10.1. Clicking on the bar at version 
>> 5.10.1 and Linux the report show a pass for i686 and a fail for s390. 
>> So it should work on i686 Perl 5.10.1.
>>
>> Tried again, cpan will not install Tkx because it lacks prerequisite 
>> Tcl.
>>
>> Tried again to install Tcl.
>>
>> cpan output:
>>
>> CPAN.pm: Going to build V/VK/VKON/Tcl-0.98.tar.gz
>>
>> LIBS   = -Ltcl-core/linux-i686 -ltclstub8.4
>> INC    = -Itcl-core/include
>> DEFINE =  -DUSE_TCL_STUBS
>> Checking if your kit is complete...
>> Looks good
>> Warning: -Ltcl-core/linux-i686 changed to 
>> -L/root/.cpan/build/Tcl-0.98-Ip73er/tcl-core/linux-i686
>> Writing Makefile for Tcl
>> cp Tcl.pm blib/lib/Tcl.pm
>> /usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp  -typemap 
>> /usr/share/perl/5.10/ExtUtils/typemap -typemap typemap  Tcl.xs > 
>> Tcl.xsc && mv Tcl.xsc Tcl.c
>> Please specify prototyping behavior for Tcl.xs (see perlxs manual)
>> cc -c  -Itcl-core/include -D_REENTRANT -D_GNU_SOURCE -DDEBIAN 
>> -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include 
>> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   
>> -DVERSION=\"0.98\" -DXS_VERSION=\"0.98\" -fPIC 
>> "-I/usr/lib/perl/5.10/CORE"  -DUSE_TCL_STUBS Tcl.c
>> Tcl.xs: In function 'NpLoadLibrary':
>> Tcl.xs:210: warning: format not a string literal and no format arguments
>> Tcl.xs: In function 'NpInitialize':
>> Tcl.xs:396: warning: format not a string literal and no format arguments
>> Tcl.xs: In function 'Tcl_EvalInPerl':
>> Tcl.xs:782: warning: format '%d' expects type 'int', but argument 2 
>> has type 'I32'
>> Tcl.xs: In function 'Tcl_PerlCallWrapper':
>> Tcl.xs:862: warning: format '%d' expects type 'int', but argument 2 
>> has type 'I32'
>> Tcl.xs: In function 'XS_Tcl_Eval':
>> Tcl.xs:1026: warning: format not a string literal and no format 
>> arguments
>> Tcl.xs: In function 'XS_Tcl_EvalFile':
>> Tcl.xs:1087: warning: format not a string literal and no format 
>> arguments
>> Tcl.xs: In function 'XS_Tcl_EvalFileHandle':
>> Tcl.xs:1112: warning: format not a string literal and no format 
>> arguments
>> Tcl.xs: In function 'XS_Tcl_invoke':
>> Tcl.xs:1246: warning: format not a string literal and no format 
>> arguments
>> Tcl.xs: In function 'XS_Tcl_icall':
>> Tcl.xs:1313: warning: format not a string literal and no format 
>> arguments
>> Tcl.xs: In function 'XS_Tcl_Init':
>> Tcl.xs:1388: warning: format not a string literal and no format 
>> arguments
>> Running Mkbootstrap for Tcl ()
>> chmod 644 Tcl.bs
>> rm -f blib/arch/auto/Tcl/Tcl.so
>> cc  -shared -O2 -g -L/usr/local/lib -fstack-protector Tcl.o  -o 
>> blib/arch/auto/Tcl/Tcl.so      \
>>            -L/root/.cpan/build/Tcl-0.98-Ip73er/tcl-core/linux-i686 
>> -ltclstub8.4       \
>>
>> chmod 755 blib/arch/auto/Tcl/Tcl.so
>> cp Tcl.bs blib/arch/auto/Tcl/Tcl.bs
>> chmod 644 blib/arch/auto/Tcl/Tcl.bs
>> Manifying blib/man3/Tcl.3pm
>>   VKON/Tcl-0.98.tar.gz
>>   /usr/bin/make -- OK
>> Running make test
>> PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" 
>> "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
>> t/call.t ....... NpLoadLibrary: could not find Tcl dll
>> Failed to load Tcl dll! at /usr/lib/perl/5.10/DynaLoader.pm line 216.
>> Unable to initialize Tcl at /usr/lib/perl/5.10/DynaLoader.pm line 216.
>> Compilation failed in require at t/call.t line 6.
>> BEGIN failed--compilation aborted at t/call.t line 6.
>> t/call.t ....... Dubious, test returned 2 (wstat 512, 0x200)
>>
>> There was a lot more output but it just repeated the "NpLoadLibrary: 
>> could not find Tcl dll" for each test module.
>>
>> As I recall I got the same result when I tried to install Tkx from 
>> cpan for perl 5.10.1 on Novell SLES 11.0.
>>
>> Ran Google and looked for the Tcl message "NpLoadLibrary: could not 
>> find Tcl dll" and found two queries and neither had an answer as to 
>> what the cause was.
>>
>> Perl Testers shows that Tkx works with all version 5.12 or perl. 
>> Tried to upgrade Ubuntu 10.4 to have Perl 5.12. But, it is not in 
>> their program repository.
>>
>> ActivePerl Perl/Tkx works fine on Ubuntu 10.4 installed in the users 
>> directory.
>>
>>
>>
>> ----------------------------------------------------------------------------------------------- 
>>
>>
>> Perl/Tk was great!
>>
>> Trouble is that Nick Ing-Simmons lead a one man band. He did a 
>> wonderful job of porting Tcl/Tk into Perl/Tk. He basically recoded 
>> the underlying C code into C code for Perl. Thus the interface fit 
>> very closely into Perl. When he died a few years ago, some folks 
>> tried, but nobody was able to bring his code up to date or maintain 
>> it. So, Perl/Tk was frozen in time. ActivePerl in the upgrade from 
>> 5.8 to 5.10 dropped Perl/Tk. They introduced Perl/Tkx in ActivePerl 5.8.
>>
>> Someone, I believe at ActiveState, really wanted to retain that 
>> functionality in Perl. The result was a very neat methodology. They 
>> created Perl/Tkx. What that is is a very thin syntactic transform of 
>> Perl statements into Tcl/Tk statements. The really neat part about 
>> this is that any upgrades to Tcl/Tk are almost immediately available 
>> to Perl/Tkx without much effort. Thus, eliminating the need for tons 
>> of opaque C code that had a huge learning curve for anybody that 
>> tried to maintain it. Also, you are now able to use all the Tck/Tk 
>> modules that are out there -- and there are plenty of them.
>>
>> Perl/Tkx works super with ActivePerl. ActivePerl is great on Windoze 
>> that I use at Boeing. ActivePerl has a distribution for Linux. 
>> However, if you install it as root, your Linux system has just been 
>> destroyed. Many of the system utilities are in Perl and they all quit 
>> working because various Perl modules have been overlayed by other 
>> modules. I know that from first hand experience! It is only safe to 
>> install it for a single non-root user which I have done at home on my 
>> Ubuntu Linux. I would really like to be able to use Perl/Tkx on our 
>> Novell SLES 11 Linux server at work. The Tcl.pm and Tkx.pm modules 
>> from CPAN will not install (at least last March). Both were seriouly 
>> broken when last I tried.
>>
>> To get arould the problem, I tried to make stand alone Perl 
>> executables that anyone on the server could run, Wow! Making a stand 
>> alone Perl executable is some kind of very black magic. Unfortunately 
>> my magic wand got lost. Spent many hours of time with no result 
>> except for frustration. Somebody told me that Strawberry Perl does it 
>> easily. But that is back to Windows only.
>>
>> One of those things that works on windows, but I can't make it work 
>> on Linux (for all users that is).
>>
>> If you have an ActivePerl installation somewhere, give their Perl 
>> Package Manager a try to see what Perk/Tkx can do.
>>
>>
>>
>> On 09/03/2010 07:17 PM, Douglas E. Miles wrote:
>>> OK, if that's the case, then yes, it failed for me, and there seems 
>>> to be a lot of fail here:
>>>
>>> http://matrix.cpantesters.org/?dist=Tkx+1.08
>>>
>>> On 09/03/2010 06:58 PM, Erik Tank wrote:
>>>> I thought it was Tkx.  I'm running Wubi on my laptop (yes one of 
>>>> these days
>>>> I'll nuke Windows and install real Ubuntu) and I couldn't get it to 
>>>> install
>>>> with a combination of CPAN and apt-get.  I only spent about 30 
>>>> minutes on
>>>> it.  If Bob could post some sample code that might help in figuring 
>>>> out what
>>>> needs to be installed.
>>>>
>>>> Erik
>>>>
>>>> On Fri, Sep 3, 2010 at 6:32 PM, Douglas E. 
>>>> Miles<doug at veritablesoftware.com
>>>>> wrote:
>>>>> Bob,
>>>>>
>>>>> Were you asking about compiling Tk, or did I mis-hear you? If you 
>>>>> were,
>>>>> I just installed it from CPAN on Ubuntu 10.04 under Perl 5.10.1 
>>>>> with no
>>>>> problems. Please let me know if you were asking about something else,
>>>>> and I'll give it a try.
>>>>> _______________________________________________
>>>>> Phoenix-pm mailing list
>>>>> Phoenix-pm at pm.org
>>>>> http://mail.pm.org/mailman/listinfo/phoenix-pm
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Phoenix-pm mailing list
>>>> Phoenix-pm at pm.org
>>>> http://mail.pm.org/mailman/listinfo/phoenix-pm
>>>
>>>
>>> _______________________________________________
>>> Phoenix-pm mailing list
>>> Phoenix-pm at pm.org
>>> http://mail.pm.org/mailman/listinfo/phoenix-pm
>>
>>
>>
>> _______________________________________________
>> Phoenix-pm mailing list
>> Phoenix-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/phoenix-pm
>
>
> _______________________________________________
> Phoenix-pm mailing list
> Phoenix-pm at pm.org
> http://mail.pm.org/mailman/listinfo/phoenix-pm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/phoenix-pm/attachments/20100906/31008148/attachment.html>


More information about the Phoenix-pm mailing list