-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Building SILE on MinGW32/Windows8.1 #82
Comments
Hello! Great to hear that you have it working; getting SILE working (and packaged) on Windows is an important goal. I want to see this happen as easily as possible, but I don't have much experience with mingw32 myself. I have just downloaded MXE (http://mxe.cc/) and have been playing with it. This contains packages for harfbuzz, fontconfig, etc. and so should help to get these statically built. I have committed a patch to I am also looking into using luabuild (https://github.com/stevedonovan/luabuild) to package up SILE into a Windows executable. We'll use this bug to track progress, and then hopefully make a Wiki page when we know how to do it properly. |
I am now repeating the process of building SILE. I don't yet understand what is significant for getting SILE working on my MinGW32/Windows8.1 though, I will report on my process of building SILE. I omit the process of installing Lua and LuaRocks as I can't remind it well, however, I just followed instruction found by searching internet with keywords "lua mingw luarocks". I am not familiarized with autotools thus I got various troubles in creating configure script. I spent much time to find out that I need to pass option "-I/usr/local/share/aclocal" for pkg-config specific macros to aclocal. For executing configure script, I simply tried
but it could not find harfbuzz library installed under /usr/local. Then I must do
to create Makefile. Next, building libtexpdf failed due to some missing declaration and I needed to fix it as mentioned in the first post. The problem still remains in creating shared library; libtool complained as
and failed to creating libtexpdf shared library. (actually there are undefined symbols) I defined various functions which is indeed undefined:
but libtool still complained about undefined symbols and won't build shared library. Then, I added
option to "libtexpdf_la_LDFLAGS" in libtexpdf/Makefile.am and recreated Makefile.(I am not sure if it is proper solution) To build justenough*.dll, I needed to add "-no-undefined" flag to "justenough*_la_LDFLAGS" and " -llua" to "justenough*_la_LIBADD" in src/Makefile.am. I also changed ".so" suffix to ".dll" as suited for Windows paltform in src/Makefile.am. Finally, I must modify "sile" Lua script. Modifications I made is changing ".so" to ".dll" and replacing "/usr" to "/mingw/msys/1.0" in all search path string. Actually, "/mingw/msys/1.0" is mounted to "/usr" but Lua interpreter doesn't understand it. Now just
There might be something missing but SILE is working at least on my system. |
Here are some notes from my experiments so far:
Anyway, Hirata-san, if you try updating your SILE and libtexpdf repositories, you should find it a little bit easier to build now. |
Thank you for updating. However, I got another problem; stringapiset.h included from dpxfile.c is not found in my mingw32 system. According to Microsoft's site: http://msdn.microsoft.com/en-us/library/dd319072.aspx MultiByteToWideChar and CP_UTF8 seems to be declared in stringapiset.h in Windows8 but it was declared in winnls.h before Windows8. Maybe my mingw32 environment emulates older versions of Windows. Including windows.h instead may work but another problem such as redefinition of ERROR arises. I will consult with the person who implemented that part in kpathsea library. And ftello and fseeko is still not defined. kpathsea library has definition
in mingw32.h so it must be OK to have the same definition. For determining the shared library extension, I tried adding
and
to configure.ac and replacing "so" with "@SHARED_LIB_EXT@" in sile.in and src/Makefile.am. I made some research on the internet. Maybe the above solution is only reasonable one. |
Some more experiments that I need to just leave here for now; this time, on Windows itself:
libxtexpdf builds fine, but configuring SILE fails because of incorrectly escaping/passing the spaces in the Luawindows path names when testing for include files. |
Simon, are you missing For some reason I'm still running into a problem with libtoolize and autoconf, even though I followed almost exactly the same process (and my msys installation is only one day old). I'll try again tomorrow on a clean instance of msys2. Here are the errors I'm getting:
Running the same command the second time:
Running configure:
The only difference I can think of is that I'm building with |
pkulchenko, Maybe a development file of pkg-config is not installed? Simon, Now I got
At first sight, there are no conflicting type, but off_t is actually defined differently in different palces. I think
should be placed in mfileio.h. I am using Lua installed via mingw-get and LuaRocks installed in /C/Lua/5.2/LuaRocks/. Find no problems. |
@shirat74, thank you for taking a look at this; I did have pkg-config installed, but it didn't help. @simoncozens, I got this resolved with running I can run
|
@simoncozens, here is updated #!/bin/sh
git submodule update --init --recursive --remote
autoreconf --install
libtoolize
aclocal
automake --force-missing --add-missing
autoreconf
(cd libtexpdf; autoreconf -I m4)
sed 's/rm -f core/rm -f/' configure > config.cache
mv config.cache configure
chmod x configure I added the four lines after I still have the configure failure on |
OK. I think the reason of failure is that aclocal can' t find pkg.m4 file; PKG_CHECK_MODULES is defined in that. I got exactly same error before installing pkg.m4 (which is part of pkg-config dev package) and adding -I option to point the location of it. |
ok, I managed to build it on windows and even got some PDF files generated (although they seem to be a bit different from the expected results, but at least I got the output). Here is the list of my instructions for those who want to follow:
All the following runs from
#!/bin/sh
git submodule update --init --recursive --remote
autoreconf --install
libtoolize
aclocal
automake --force-missing --add-missing
autoreconf
(cd libtexpdf; autoreconf -I m4)
sed 's/rm -f core/rm -f/' configure > config.cache
mv config.cache configure
chmod x configure
This generates |
SILE defaults to the Gentium font, which you can pick up from here: http://scripts.sil.org/cms/scripts/page.php?item_id=Gentium |
It turned out I installed Gentium Plus instead of the basic one. Looks good now, except Irene's letter in test.pdf. |
Simon, just want to mention one more thing; I was building this with a mix of 32bit and 64bit environment (even though I expected to only use 32bit-one) and didn't run into the compilation issue @shirat74 mentioned. I did run into some other issues and decided to rebuild from scratch with a cleaner environment and that's what I got the same compilation error, which was fixed by adding diff --git a/mfileio.h b/mfileio.h
index 1a795c7..c37d84b 100644
--- a/mfileio.h
b/mfileio.h
@@ -52,6 52,7 @@ extern long tell_position (FILE *file);
extern long file_size (FILE *file);
#define off_t off64_t
#define xseek_absolute(file, pos, name) fseeko (file, (off_t)(pos), SEEK_SET)
#define xseek_relative(file, pos, name) fseeko (file, (off_t)(pos), SEEK_CUR)
#define xseek_end(file, name) fseeko (file, (off_t)0, SEEK_END) You may want to incorporate that change. The rest of the process worked find with my changes to |
I've been stalling on this because that |
@simoncozens, I actually built and ran it in a 32-bit environment and it works as expected for me. I'm not sure about the implications, but the error is clear and one of the places has to change as the signature is shown as |
Is there a easy and clear way to get a windows binary of sile ? |
I just tried to follow the instructions here without success. |
Is there any specific step where it's failing for you? I've done this a while ago, so not sure if the current process is any different from the one I followed last year. I may have some time to try in few days if you still have issues... |
|
@Queueless, I think you are missing running |
@pkulchenko k, added that step- hit next road block; hoping to put all the steps in one post so that it will be there for others Just to be clear, I'm blocked; the configure script doesn't see a compiler |
Any one else willing to lend a hand? I'm still stuck, as per my previous comment |
sorry if my question may sound stupid. Are you using the |
@anthrotype, no I wasn't using the mingw64 shell- thanks for pointing that out, that got me past the missing compiler. Now I'm stuck with the configure script looking the Lua and not finding it. I'v run both:
and restarted mingw64.exe, but the configure script still doesn't see the a lua instance installed. |
@Queueless, I ran into the same issue; look at the related step I described earlier in this thread: #82 (comment). |
Thanks. I will spend more time investigating how to pack everything on Windows into binary for a better distribution. There are a few things that need to tune inside Lua building script and the vendoring things. I would try to write a single script to automate all this. |
@simoncozens, @harrysummer, I think it's a good goal, but it's difficult to achieve and it's definitely not going to be small, given that just ICU libraries are 30Mb. Given the list of libraries I have (listed in #410 (comment) and #410 (comment)), the total size is going to be close to 38Mb (and these are stripped 32bit versions; 64bit versions are going to be a bit larger). |
I've made a bash script to build SILE under MSYS2 MinGW, include building lua and lua packages. ICU has not been included yet. Some dependency libraries such as Some comments regarding the current script:
|
Maybe we could directly copy those dependency's DLL files from /mingw64/bin into the install directory of SILE? |
Could someone please provide me with a tarball/zip with a reasonably working, reasonably recent¹ build of SILE for Windows? (I.e. an already compiled .exe.) It can totally be a one-off archive, though ideally with all dependencies (DLLs, fonts, whatever), or at least mention of what mingw libs (or other files, like fonts, etc., maybe git checkout of SILE repo at some commit) are required. This would significantly help me to continue my effort to finish the math support feature in SILE (#468, #220). ¹ doesn't actually need to be very recent I believe; what I need specifically is that it should successfully build PDFs (on my PC...) and allow me to access the justenoughlibtexpdf API from Lua. I'd be very grateful for help! |
@harrysummer, could you help? |
Obviously a pre-compiled .exe with dependencies would be more convenient, but if you end up waiting too long for that I wanted to point out that I've had very good results running SILE in the Bash for Windows (Windows Subsystem for Linux) environment that comes with Windows 10. You basically need to find a webpage that shows you how to activate that feature of Windows 10, and then just follow the SILE build instructions for Linux (specifically Ubuntu) systems. |
I should be able to provide an archive with the (relatively recent) executable and all its dependencies, but only in 5 days or so, as I'm traveling without access to the machine with the binaries. |
@pkulchenko I'd be very grateful! TIA :) if noone jumps in earlier, then I'll go find myself some other leisure activity over Christmas ;) @mnjames Thanks for the note. By the way, speaking of contraptions, I did part of the work in a NixOS VM hosted in HyperV on Windows 10, and Nix was actually helpful at that stage ;) but now what's left to be done is pure Lua, and I just want to reduce friction, can't push myself to jump through the hoops anymore. In fact, I just realized 2 days ago, that this is the biggest mental obstacle for me now, preventing me to push this forward little by little in stolen bits of free time; but then I remembered about this thread and thought, hey, maybe someone here has something lying around and could help me without much trouble? |
Ok, there were some steps I could still do without the binary (prototyping the rendering in @pkulchenko's ZeroBrane Studio love2d — thanks Paul!); as of today I finished those steps and got fully successful prototype renders in love2d, so if anyone waited to jump in with some link to a nicely archived precompiled Windows binary of SILE, now's a really good time to shed your shyness and go for it! ;) TIA |
@akavel, great to hear about the progress! I'm working on the binary package, but ran into a couple of issues with recompiling |
(@pkulchenko As a side note, if those |
That's what I used previously, but I wanted to make sure that the binaries work on the latest SILE code. Already resolved the issue. Will upload shortly. |
Ok, give this archive a try. Instructions:
|
Do you mean I still need to call bootstrap.sh and configure? So I need to install MSYS anyway? :/ Also, by "SILE folder" do you mean clone of the git archive? (if yes, what commit?) or just an empty folder? |
You can skip the steps, but you need to generate the If you are using the latest SILE master branch, the first several lines of the package.path = '?.lua;./?.lua;./lua-libraries/?.lua;./lua-libraries/?/init.lua;lua-libraries/?.lua;lua-libraries/?/init.lua;' .. package.path
local pathvar = os.getenv("SILE_PATH")
if pathvar then
for path in string.gmatch(pathvar, "[^;] ") do
package.path = path .. "/?.lua;" .. package.path
end
end
package.cpath = package.cpath .. ";core/?.dll;./?.dll;"
Yes, the clone of the git archive; I've tested on the latest commit, but any recent (from Sep 2017) should work. |
Ok, it worked, thanks! :) For the record, I edited the .bat a bit (had lua in path, so also simplified the last line):
and got output like below:
Probably have to install the Gentium Plus font from somewhere, but still got some reasonably looking PDF in Big thanks @pkulchenko ! |
Looks good; I updated the file in the archive and re-uploaded (in case someone else wants to use it)
Great! Yes, you'll need Gentium Plus; check the readme for the download link. |
Ok, FTR I confirm I installed the Gentium Plus EXE via the link; didn't change the default directory from "Program Files", but it anyway properly copied the TTFs into |
(For the record, I managed to implement the final step of the prototype pipeline for asciimath rendering in SILE — thanks again to @pkulchenko for help with the binary! A screenshot of the first results is available in #468. A lot of integration work and polishing remains, but I just wanted to post a quick update and thank you here, and to notify that I'll stop hijacking this thread now and will continue posting updates in #220 in case anybody's interested.) |
@akavel, looks great! Thank you for the update; I'm definitely interested! |
Update on this issue. I managed to build windows binary and setup a CI for it. All dependencies are put together with SILE. Here is the CI link wher eyou can download the latest artifact. https://xiarui.visualstudio.com/personal/_build?definitionId=1 |
This is all kinds of amazing. Is it ready for a pull request? |
@simoncozens I think I will be ready for that in several days after I clean some dirty changes in libtexpdf. Will create a PR once it's done. |
Anybody with an interest in compiling SILE under MinGW ... please see my comments on the Windows binary distribution issue, it seems to me this is obsolete but if I'm mistaken somebody should probably tell me so before I rip it out. |
@alerque, for the record, I do use SILE on windows with MinGW binaries. In fact, I recently recompiled them and tested with the current SILE master branch without issues. |
I have tried to build and run SILE on my Windows8.1 machine.
To build libtexpdf, I needed to add the following
to libtexpdf/libtexpdf.h (I'm not very sure what I'm doing though) and
to libtexpdf/agl.c. By doing so I can successfully compile but I need to build justenoughharfbuzz.so and justenoughlibtexpdf.so manually. Now I have SILE working on Windows but I am stil looking for the way to build SILE on Windows easily. Any advice?
The text was updated successfully, but these errors were encountered: