gijit / gi

gijit is a just-in-time trace-compiled golang REPL. Standing on the shoulders of giants (GopherJS and LuaJIT).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

windows build recipe

glycerine opened this issue · comments

todo: figure out how to get gijit to build on windows

Update NB: there are binaries available, at least since v1.0.9, here https://github.com/gijit/gi/releases so if you want to try gijit on windows, you don't need to compile it.

Update: Also binaries for Windows at v1.3.2: https://github.com/gijit/gi/releases/tag/v1.3.2

I built gijit on windows, successfully.

There was windows branch with the changes; it has been merged.

Notes:

install mingw64, which is a port of the gcc compiler to windows. While LuaJIT builds fine with gcc or with microsoft compilers, CGO only supports gcc. (msvc not supported, clang not supported, links in this SO https://stackoverflow.com/questions/48541882/cgo-flags-and-cgo-ldflags-for-msvc-cl-exe )

to extract mingw64 binary above, you'll need an 7z extractor, which is here
http://www.7-zip.org/

command to extract the mingw64 .7z archive:

"\Program Files\7-Zip\7z.exe" x .\x64-4.8.1-release-posix-seh-rev5.7z

I installed gcc as

C:\mingw64\bin\gcc.exe

then added

C:\mingw64\bin to my %PATH% (system, advanced settings, environment vars)

then re-open the command prompt window.

also gnu make installed from
https://phoenixnap.dl.sourceforge.net/project/gnuwin32/make/3.81/make-3.81.exe

to
C:\GnuWin32\bin\make.exe

and add C:\GnuWin32\bin to %PATH%

At the moment, the "make onetime" target doesn't work:
I had to manually cd over to %GOPATH%\src\github.com\gijit\gi\vendor\LuaJIT\LuaJIT\src and run make and make libluajit.a because gnu make was stumbling on windows paths contains spaces and parenthesis.
[update: moving GnuWin32\bin\make from C:\Program Files (x86) to C:\GnuWin32\bin\make should fix this]

Be sure to install gnuwin32/make in path that does not have spaces or parenthesis in it. So the default is bad. "C:\Program Files (x86)\GnuWin32\bin\make.exe" is bad. Instead use "C:\GnuWin32\bin\make.exe" or similar. The spaces and parenthesis will give gnu make problems on windows.

iamantony/qtcsv#19

Since this is solved, closing issue.

So when the windows build gets to this part C:\Users\jordan\Desktop\gi\vendor\github.com\LuaJIT\LuaJIT\src>make gijit_luajit make: *** No rule to make targetgijit_luajit'. Stop.
` it gives up, but if I cd to it, I can manually run make and it works

Yeah, I see that too. I had hacked the makefile to produce a differently named luajit, namely gijit_luajit, to keep it separate from any other luajit, as gijit_luajit has some additional patches, and it seemed nice to keep them separate. So I can see from reading the Makefile that on Windows the LuaJIT/src/Makefile line 514 is overridden by line 536. It doesn't really matter since the .a is the only thing we're really after to link against.

@jordan4ibanez just by-the-by, gi isn't something I'm putting effort into. If you want a pretty functional go interpreter, https://github.com/cosmos72/gomacro is much more complete. Its only drawback I would say is the MPL license.