TeXmacs s7 Windows build with msys64

Hi! I have spent some time compiling the s7 port of TeXmacs on Windows and would like to share some information here for TeXmacs hackers:

I have always found compilation under Windows to be quite frustrating. Last time around, I felt it was virtually impossible. It still took me two full days this time… The only thing that worked was slowphil’s solution. The frustration usually comes from Guile, which is why I choose to go for the s7 branch here. I have successfully compiled the s7 (https://github.com/mgubi/texmacs/tree/s7) branch of TeXmacs under Windows, using MSYS2’s minw-w64 toolchain. This attempt was largely inspired by slowphil’s solution here (https://github.com/slowphil/texmacs-win-builder), which currently doesn’t work out of the box due to maintainers dropping support for 32bit (https://www.msys2.org/news/#2020-05-17-32-bit-msys2-no-longer-actively-supported). To date, the official build of TeXmacs under Windows is still a 32bit application with reasons highlighted here https://github.com/slowphil/mingw-w64-guile1.8/blob/master/X86_64_building.md. It seems to require a lot of works to patch Guile-1.8.8 for this platform (and with maintainers of msys2 dropping supports for 32bit, we will need to pivot to 64bit at some point). Of course another option is Guile3 or Guile2. But I don’t think there’s existing package for guile3 at the moment and I would assume that it is not easy to build on our own.

For those who are interested, please checkout this fork (https://github.com/326623/texmacs-1/tree/s7) of s7 branch for the patching I did to get it working. Note, it’s not meant to be for production — still some unknown bugs to figure out/test out.

To compile it:

  1. Get the latest msys2 and the code.
  2. Open the MINGW64 terminal and install libs: “pacman -S --noconfirm mingw-w64-x86_64-qt5 base-devel mingw-w64-x86_64-freetype mingw-w64-x86_64-toolchain mingw-w64-x86_64-ntldd-git rsync”
  3. ./configure --enable-debug && make PACKAGE

There’s still bug in “src/Scheme/S7/s7_tm.cpp”. I haven’t figured it out yet. (The built-in library for strings or array doesn’t work great in gdb. I can’t even view a string in gdb, which makes debugging kind of tough.) If you compile it with optimisation flags like “-O3/2/1”, TeXmacs will encounter segmentation fault upon launching. So enabling debug here is actually necessary. (You can compile all other files with “-O3”, but not this one.)

BTW, I hope that TeXmacs can provide an official up-to-date pre-built environment for Windows. I can’t seem to make the ones in FTP work :frowning:

Also, on Windows, I cannot find an IDE that works with TeXmacs (no workable CMake means that VS/CLion can’t work nicely). I feel that TeXmacs works the best (either using or hacking) on Mac because the main devs are on Mac (it’s both good and bad).

4 Likes

Cool. I will try your branch using MXE in December. (I’m really busy in October and November)

Guile 3 on Windows is not mature enough yet. We might need to spend some time contributing the Windows support for Guile 3.

Thanks! I will try to see if I can fix up the bugs for this branch (if I have time :frowning: ).

In case Guile3 on Windows doesn’t work out in the short run, at least we have s7 as a fallback plan :slight_smile: .

Well, TeXmacs with S7 works fine using MXE on Windows.

The latest of the TeXmacs with S7 fork is Mogan v1.1.0:

Are you interested on developing on it?

Thanks! I will try to take a look when I have time :slightly_smiling_face:

1 Like