I did the following but still getting error. I could not find the file platform.sh anywhere in the cloned directory. What am i still missing . Thanks.
.mgit/bundle.sh: line 423: .mgit/platform.sh: No such file or directory
Unable to set platform.
Bundle doesn't know how how to find libraries outside of the luapower tree. All dependencies must be included. In your case it looks like mysql.so is a Lua/C library and so you need to put it (or link it) in
Btw, if that module was compiled against Lua 5.2 then it might not work with luajit (not sure)
bin/linux64/clib/luasql/mysql.sogosh talk about love for hierarchy :)
Oh and if it's for mysql, there's a libmysql binding and there's binaries for libmysql and libmariadb.
Yes. I was working with lua in the beginning and most people point me to luasql so there is where i build my modules.
How about socket, mime and ltn12? do I need to move the library to the /bin/linux64/clib ?
There's a LP package for luasocket:
mgit clone socket
I did a ln -s /usr/lib/x86_64-linux-gnu/liblua5.1-sql-mysql.so.2.0.0 mysql.so in the bin/linux64/clib/ directory. Compiled again but still getting the same error. What else do I need to do? Thanks.
Hm, the error was from windows but now you're talking about Linux. I'm confused...
If you run
./luajit -lluasql.mysqldoes it work?
For your information, I am running all the commands in Ubuntu 14.04 64bit machine.
LuaJIT 2.1.0-alpha -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/
JIT: ON SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse
Ah crud. Wait. You wanna bundle a dynamic lib? :) That's not possible, you need to bundle the .a file (the static lib).
./mgit bundle --list-lua-modulesand
mgit bundle --list-alibsand see if you can find your lib in there. It should be in the alibs list.
And lemme guess, luasql doesn't come with static libs (most of them don't), so you need to compile. Probably need to make a build script too cuz most makefiles don't generate static libs.
Note that with bundle you can have both bundled libs and dynamic libs. So if you don't have mysql.a you can put
clib/luasql/mysql.soin the directory of your exe and it should work. But it won't be a single exe deployment quite obviously :)
It seems very wired that the compiled luajit is looking for the library named mysql.dll instead of mysql.so. I renamed it form extension so to dll it worked. FYI, I am running this in Ubuntu Linux x64. Can you please check if it is indeed looking up the wrong extension via a via OS platform. Thanks.
no field package.preload['luasql.mysql']
no file './luasql/mysql.lua'
no file './luasql/mysql/init.lua'
no file './clib/luasql/mysql.dll'
no file './clib/luasql.dll'
no symbol 'Blua_luasql_mysql'
no symbol 'luaopen_luasql_mysql'
Aha. That's why I was confused about windows/linux. Looks like you found a bug, it's here: https://github.com/luapower/bundle/blob/master/bundle_loader.lua
I'l go fix it.
Done. Please try again (haven't tested the change).
I would like to ask, How do I pull in the new update? I tried ./mgit pull bundle, well that is a no go. Thanks.
./mgit <repo> <git command>so
./mgit bundle pull
./mgit - bundle pull
The command does not work
./mgit bundle pull
Invalid option: pull
Compile and link together LuaJIT, Lua modules, Lua/C modules, C libraries,
and other static assets into a single fat executable.
Tested with mingw, gcc and clang on Windows, Linux and OSX respectively.
Written by Cosmin Apreutesei. Public Domain.
USAGE: mgit bundle options...
-o --output FILE Output executable (required
For when there's name clashes, there's a
./mgit - bundle pull, otherwise
./mgit bundle ...runs the bundle script.
Thanks. That fixed the problem.. I have compiled and the changes you have made works.