MOTHBALLED-graphviz icon indicating copy to clipboard operation
MOTHBALLED-graphviz copied to clipboard

linking against lua5.1

Open gborghesan opened this issue 8 years ago • 4 comments

Hi, I am trying to specify to link against liblua5.1 in a ubuntu 14.04 where both 5.1 and 5.2 are installed i tried to configure with

> ./configure --disable-perl LUA_VERSION=5.1

after making

i get:

> ldd /home/gb/temp/graphviz/tclpkg/gv/.libs/libgv_lua.so
...
	liblua5.2.so.0 => /usr/lib/x86_64-linux-gnu/liblua5.2.so.0 
...

any help is welcome!

gborghesan avatar Dec 08 '16 15:12 gborghesan

There is a demo lua program in the source tree:

 tclpkg/gv/demo/modgraph.lua

also installed by the graphviz-lang-lua rpm for Centos or Fedora at:

 /usr/share/graphviz/demo/modgraph.lua

Basically, your lua program starts with:

 #!/usr/bin/lua

 require('gv')

There is no need to link to this lua extension library,

That being said, it looks like there has been some bit-rot - probably lua has changed, I'm getting

$ /usr/share/graphviz/demo/modgraph.lua /usr/bin/lua: /usr/share/graphviz/demo/modgraph.lua:25: attempt to call a nil value (field 'gfind') stack traceback: /usr/share/graphviz/demo/modgraph.lua:25: in main chunk [C]: in ?

$

John

On December 8, 2016 at 10:22 AM Gianni [email protected] wrote:

Hi,
I am trying to specify to link against liblua5.1 in a ubuntu 14.04 where both 5.1 and 5.2 are installed
i tried to configure with

./configure --disable-perl LUA_VERSION=5.1

after making

i get:

ldd /home/gb/temp/graphviz/tclpkg/gv/.libs/libgv_lua.so
...
liblua5.2.so.0 => /usr/lib/x86_64-linux-gnu/liblua5.2.so.0
...

any help is welcome!

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/ellson/graphviz/issues/1182 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABcTPXM7Je-TFKWz4LsJCoGS-9o2fkveks5rGCDQgaJpZM4LH77D .

 

ellson avatar Dec 09 '16 04:12 ellson

Lua-5.2 renamed string.gfind to string.gmatch

Demo updated in GIT. Should be in next build.

John

On December 8, 2016 at 11:40 PM John Ellson [email protected] wrote:

There is  a demo lua program in the source tree:

     tclpkg/gv/demo/modgraph.lua


also installed by the graphviz-lang-lua  rpm for Centos or Fedora at:

     /usr/share/graphviz/demo/modgraph.lua


Basically, your  lua program starts with:


     #!/usr/bin/lua

     require('gv')


There is no need to link to this lua extension library,



That being said,  it looks like there has been some bit-rot -  probably lua has changed,  I'm getting


$ /usr/share/graphviz/demo/modgraph.lua
/usr/bin/lua: /usr/share/graphviz/demo/modgraph.lua:25: attempt to call a nil value (field 'gfind')
stack traceback:
/usr/share/graphviz/demo/modgraph.lua:25: in main chunk
[C]: in ?

$


John

    > > On December 8, 2016 at 10:22 AM Gianni <[email protected]> wrote:
    Hi,
    I am trying to specify to link against liblua5.1 in a ubuntu 14.04 where both 5.1 and 5.2 are installed
    i tried to configure with

    ./configure --disable-perl LUA_VERSION=5.1

    after making

    i get:

    ldd /home/gb/temp/graphviz/tclpkg/gv/.libs/libgv_lua.so
    ...
    liblua5.2.so.0 => /usr/lib/x86_64-linux-gnu/liblua5.2.so.0
    ...

    any help is welcome!

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub https://github.com/ellson/graphviz/issues/1182 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABcTPXM7Je-TFKWz4LsJCoGS-9o2fkveks5rGCDQgaJpZM4LH77D .

     

> 

ellson avatar Dec 09 '16 04:12 ellson

Dear John,

My problem is that i want to use 5.1, and since in the configure phase it takes automatically 5.2 as version to use, if i require ('gv') in lua 5.1, after setting up the LUA_CPATH, lua has a segmentation fault (since it loads a library which is linked against liblua5.2 ) So the question is:there is a way to force the configure command to link against lua version 5.1?

gborghesan avatar Dec 09 '16 09:12 gborghesan

It links against whatever is installed on the build machine ... Perhaps you could build graphviz on a host that only has lua-5.1 installed?

Or maybe you can over-ride the lua pkg-config file, which on Fedora is in:

  /usr/lib64/pkgconfig/lua.pc

copy and modify to point to your lua-5.1 libs and includes, then prepend PKG_CONFIG_PATH with the the directory containing your modified lua.pc

On December 9, 2016 at 4:07 AM Gianni [email protected] wrote:

Dear John,

My problem is that i want to use 5.1, and since in the configure phase it takes automatically 5.2 as version to use, if i require ('gv') in lua 5.1, after setting up the LUA_CPATH, lua has a segmentation fault (since it loads a library which is linked against liblua5.2 )
So the question is:there is a way to force the configure command to link against lua version 5.1?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/ellson/graphviz/issues/1182#issuecomment-265966651 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABcTPaqBaDBXqYPbTQHLoNoQG5bE0RkYks5rGRpXgaJpZM4LH77D .

 

ellson avatar Dec 09 '16 16:12 ellson