Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows build recipe #18

Closed
glycerine opened this issue Jan 29, 2018 · 6 comments
Closed

windows build recipe #18

glycerine opened this issue Jan 29, 2018 · 6 comments

Comments

@glycerine
Copy link
Contributor

glycerine commented Jan 29, 2018

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

@glycerine glycerine changed the title windows build recipie windows build recipe Jan 29, 2018
@glycerine
Copy link
Contributor Author

glycerine commented Feb 14, 2018

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]

@glycerine
Copy link
Contributor Author

glycerine commented Feb 15, 2018

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

@glycerine
Copy link
Contributor Author

Since this is solved, closing issue.

@jordan4ibanez
Copy link

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

@glycerine
Copy link
Contributor Author

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.

@glycerine
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants