pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.62k stars 518 forks source link

64 Bit Version for Windows #816

Closed RoyiAvital closed 7 years ago

RoyiAvital commented 7 years ago

Hello,

Is there a 64 Bit Windows version?

Thank You.

pkulchenko commented 7 years ago

@RoyiAvital, no, but you can still debug 64bit apps on Windows. See https://studio.zerobrane.com/doc-remote-debugging#debugging-of-64bit-applications for details and #756, #766 for earlier discussions.

RoyiAvital commented 7 years ago

You mean I can use 64 Bit LuaJIT with 32 Bit ZeroBraneStudio?

Is there a reason not to have 64 Bit version of ZeroBraneStudio?

Thank You.

pkulchenko commented 7 years ago

You mean I can use 64 Bit LuaJIT with 32 Bit ZeroBraneStudio?

Yes; you can launch and debug 64bit application from 32bit ZeroBrane Studio (you'll need to configure the luasocket paths to make sure that 64bit libraries are loaded before 32bit libraries included with the IDE)

Is there a reason not to have 64 Bit version of ZeroBraneStudio?

All the libraries need to be recompiled for 64bit, tested, bundled, and distributed and since any interpreter can be used and debugged with it, I don't see a pressing need to provide 64bit version on Windows.

RoyiAvital commented 7 years ago

Working with SciLua on Data Analysis requires a lot of memory. It would be nice to have it working out of the box.

Thank You.

pkulchenko commented 7 years ago

It should be fairly easy to configure by using 64bit LuaJIT and setting paths as described in #500. I also provided luasocket libraries for 64bit Lua 5.1, so you can use those: https://download.zerobrane.com/misc/luasec-0.6-openssl-1.0.2o-luasocket-3.0-win64.zip

dcanoh commented 6 years ago

You can provide me 64bit version of wxLua?

pkulchenko commented 6 years ago

No, however you can compile it yourself using the build scripts included with the ide. You just need to have a toolchain that support 64bit compilation and the scripts should work without modification. You should be able to run (cd build; bash build-win32.sh all) to build the require modules.

dcanoh commented 6 years ago

Oh thanks I'll try to compile the library using your build script, I'm using mingw64, thanks for the reply.

pkulchenko commented 6 years ago

Sounds good; let us know the results. I noticed that lexlpeg library is not included in when all option is specified, so you may add lexlpeg after all to the build-win32.sh command (I already fixed it in the script). I'll also do a bit of optimization to avoid cloning wxwidgets two times, but the script should still work as it is. You may want to save some time and comment out rm -rf "$WXWIDGETS_BASENAME" and rm -rf "$WXLUA_BASENAME" in case you run into any errors, as this will allow you to re-run the compilation without re-cloning the repositories.

AliceCryer commented 5 years ago

Hi, the luasocket-win64 link is broken, could you post an updated one please?

pkulchenko commented 5 years ago

@ac20g13, it's available here: https://download.zerobrane.com/misc/luasec-0.6-openssl-1.0.2o-luasocket-3.0-win64.zip. I'll update the link in the earlier comment.

soccerno16 commented 4 years ago

Still having the "Not a valid Win32 application" error trying to run a script to debug wireshark. http://notebook.kulchenko.com/zerobrane/debugging-wireshark-lua-scripts-with-zerobrane-studio As you can see below I downloaded the 64bit core.dll and created another bin directory bin64 with the contents in the ZBS root directory. I ended up having to add the root ZBS\bin directory to my windows path in order to get this far b/c I kept getting an error that it could not fine lua51.dll.

C:\OPF\HandoffLogs>set ZBS=C:\users\Ben\ZeroBraneStudio

C:\OPF\HandoffLogs>set LUA_PATH=.\?.lua;C:\users\Ben\ZeroBraneStudio\lualibs/?/?.lua;C:\users\Ben\ZeroBraneStudio\lualibs/?.lua

C:\OPF\HandoffLogs>set LUA_CPATH=C:\users\Ben\ZeroBraneStudio\bin/?.dll;C:\users\Ben\ZeroBraneStudio\bin/clibs53/?.dll

C:\OPF\HandoffLogs>set LUA_CPATH=C:\users\Ben\ZeroBraneStudio\bin64/clibs/?.dll;C:\users\Ben\ZeroBraneStudio\bin/?.dll;C:\users\Ben\ZeroBraneStudio\bin/clibs53/ ?.dll

C:\OPF\HandoffLogs>tshark -X lua_script:test.lua tshark: Lua: Error during loading: error loading module 'socket.core' from file 'C:\users\Ben\ZeroBraneStudio\bin64/clibs/socket\core.dll': %1 is not a valid Win32 application.

stack traceback: [C]: in ? [C]: in function 'require' C:\users\Ben\ZeroBraneStudio\lualibs/socket.lua:12: in main chunk [C]: in function 'require' C:\users\Ben\ZeroBraneStudio\lualibs/mobdebug/mobdebug.lua:102: in main chunk [C]: in function 'require' test.lua:5: in main chunk Capturing on 'Wireless Network Connection 3'

pkulchenko commented 4 years ago

I ended up having to add the root ZBS\bin directory to my windows path in order to get this far b/c I kept getting an error that it could not fine lua51.dll. error loading module 'socket.core' from file 'C:\users\Ben\ZeroBraneStudio\bin64/clibs/socket\core.dll': %1 is not a valid Win32 application.

If you did add socket/core.dll from the downloaded package (so it's indeed 64bit), I suspect the issue is not with the library, but with lua51.dll it depends on. The entire chain of the libraries and its dependencies has to have the same bitness, so you need to have lua51.dll compiled for 64bit as well to make it all work (and it looks like you referenced one from ZBS/bin directory, which is compiled for 32bit architecture).

Let me know if you are not setup to compile 64bit version and I'll compile and provide 64bit lua51.dll

soccerno16 commented 4 years ago

I suspected it was likely something along those lines.
I am not setup to compile the 64 bit version. I would most appreciate your assistance.

pkulchenko commented 4 years ago

@soccerno16, it looks like there is already one available here: https://github.com/moteus/lua-windows-environment/blob/master/Lua/5.1/x64/v140/bin/lua51.dll. See if that works for you. It uses a different compiler from the one used to compile luasocket; while I don't expect it to cause the issues, let me know if you still get an error on load.

soccerno16 commented 4 years ago

I pulled down the 3, 64bit lua files and put them in the bin64 directory and updated my script to include that location but still seeing errors.

set ZBS=C:\users\Ben\ZeroBraneStudio set LUA_PATH=.\?.lua;%ZBS%\lualibs/?/?.lua;%ZBS%\lualibs/?.lua

set LUA_CPATH=%ZBS%\bin/?.dll;%ZBS%\bin/clibs/?.dll set LUA_CPATH=%ZBS%\bin64/?.dll;%ZBS%\bin64/clibs/?.dll;%LUA_CPATH%

set PATH=%ZBS%\bin64/;%PATH% echo %PATH%

tshark -X lua_script:test.lua

image

image

pkulchenko commented 4 years ago

@soccerno16, try this one: https://download.zerobrane.com/misc/lua-515-win64.zip

soccerno16 commented 4 years ago

That one runs, but wireshark crashes immediately. I'm guessing there's still some kind of mismatch. image

pkulchenko commented 4 years ago

@soccerno16, I won't be able to help with this one unfortunately, but one thing that may help is to run wireshark under dependency walker (make sure to get the 64bit version) and use its "profile" feature (you'll see it in the top menu), as it will show you in detail any issue with loading dlls (and will trace all the calls that load those libraries). It will also likely provide a specific error number that you can search for to get more details.

soccerno16 commented 4 years ago

Thanks for your assistance anyway.