mob-i-l
Posts: 315
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Google+ Twitter YouTube

Tk (Tkx) for Perl installation problems

Sat Feb 28, 2015 11:48 pm

I found a way to install Tkx using cpanm. The installation runs fine with windows popping up to test functions, but then the programs I write fail with segmentation fault. I installed it in Raspbian with these command lines:

Code: Select all

###
sudo apt-get update && sudo apt-get install gcc-4.7 tcl8.5-dev
sudo curl -L http://cpanmin.us | perl - --sudo App::cpanminus
wget http://www.cpan.org/authors/id/V/VK/VKON/Tcl-1.02.tar.gz
tar xvf Tcl-1.02.tar.gz
cd Tcl-1.02/
perl Makefile.PL
sed -i 's|#include <tcl.h>|#include "tcl-core/include/tcl.h"|' Tcl.xs
make
sudo make install
sudo cpanm Tkx   # <-- Installs successfully with windows in #
# the self-test. #
cd ..
rm -rf Tcl-1.02
perl -MTkx -e 'print Tkx::info("patchlevel");'   # <-- Fails with #
# segmentation fault. #
###
I also tried some other tcl.h:s on my system, but with the same segmentation fault.

Example Perl-program from http://www.tkdocs.com/tutorial/install.html:

Code: Select all

use Tkx;
Tkx::grid( Tkx::ttk__button(".b", -text => "Hello, world" ) );
Tkx::MainLoop();
Run with:

Code: Select all

perl hello.pl # Causes segmentation fault.
The Python-program and Tcl program from the same page both work in Raspbian out-of-the-box:

Code: Select all

python3 hello.py
wish hello.tcl
The ruby-program doesn't work with:

Code: Select all

ruby hello.rb
Tkx works without problems and didn't need patching in Ubuntu 14.04 LTS for x86-32, but then I installed it using the most updated cpan, and not cpanm. I can't use cpan in Raspberry Pi A with 256MB RAM of which 32MB is graphics memory, e.g. I can't update CPAN to latest version.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

Return to “Other programming languages”