Re: [code] Shared objects

From: Mitchell <m.att.foicica.com>
Date: Mon, 2 Apr 2012 16:17:14 -0400 (Eastern Daylight Time)

Hi Anton,

On Mon, 2 Apr 2012, Verbitsky Anton wrote:

> Hi all,
>
> three days ago I finally updated Arch on my laptop
> and my rather old (3.9) version of TA ceased to function.
> So, I updated the last (5.2) version and started to customize
> it to the new interfaces.
> Here's where I need some help from smarter folks like you ;)
>
> I want to use the lua binding for Hunspell from Michal Kottman
> In the old interpreter it works just fine (spell.so in the current directory)
> [anton@~/.textadept/modules/anton/spellchecker]% lua
> Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> > spell = require 'spell'
> > print(spell)
> function: 0x1b23290
> > spellchecker = spell("/usr/share/myspell/en_US.aff",
> "/usr/share/myspell/en_US.dic")
> > print(spellchecker:spell("cumbersome"))
> true
> > print(spellchecker:spell("cumbersame"))
> false
>
> The new version (default settings from AUR) gives me this
> [anton@~/.textadept/modules/anton/spellchecker]% lua5.2
> Lua 5.2.0 Copyright (C) 1994-2011 Lua.org, PUC-Rio
> > spell = require 'spell'
> error loading module 'spell' from file './spell.so':
> dynamic libraries not enabled; check your Lua installation
> stack traceback:
> [C]: in ?
> [C]: in function 'require'
> stdin:1: in main chunk
> [C]: in ?

You do not need Lua installed on your system to use Textadept. Textadept
has it's own version of Lua that should allow you to load dynamic
libraries. This error specific to your Archlinux install of Lua and does
not have anything to do with Textadept.

> If I try to invoke this shared library from TextAdept
> -- .textadept/init.lua
> package.path = table.concat({
> _USERHOME..'/modules/anton/spellchecker/init.lua',
> package.path
> }, ';');
>
> package.cpath = table.concat({
> _USERHOME..'/modules/anton/spellchecker/spell.so',
> package.cpath
> }, ';');
>
> local M = {}
> _M.textadept = M
>
> -- other modules
> M.spellchecker = require 'anton.spellchecker'
> M.keys = require 'textadept.keys'
> M.menu = require 'textadept.menu'
> return M
>
> -- in /anton/spellchecker/init.lua
> local M = {}
> M.spell = require 'spell'
> return M
>
> I get
> error loading module 'spell' from file '/home/anton/.textadept/modules/anton/spellchecker/init.lua':
> /home/anton/.textadept/modules/anton/spellchecker/init.lua:1: too many C levels (limit is 200) in main function near '{'
>
> Where's the problem:
> 1. There was some change in the binding interface, and I need to
> modify the binding *.cpp file and recompile everything against Lua 5.2.
> and then everything will be ok.

My guess is that the changes made to the library for Lua 5.2 are causing
this problem. It appears that some sort of infinite recursion is going on,
maybe in the C-library?

What happens when you run the JIT version of Textadept (which still uses
Lua 5.1) with the unmodified version of the library? . Do you get the same
error?

Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 02 Apr 2012 - 16:17:14 EDT

This archive was generated by hypermail 2.2.0 : Tue 03 Apr 2012 - 06:34:52 EDT