Build Error (Win): Compiling with MinGW/MSYS2 from source

Could you tell me how to solve this problems, please?
I tried to compile the Julia from source code on Windows 8.1. I followed the instructions for README.windows.md and by the way “Compiling with MinGW/MSYS2”. I’m changed version on 0.5 with command git checkout release-0.5 and I followed step by step instructions. When I run the build command
make -j 4
I got the following error make: *** [Makefile:81: julia-deps] Error 2 with a piece of first error in the console

 rm -f fftwf-wisdom
checking for clock... Making clean in m4
/bin/sh: line 1: /C/Program: No such file or directory
make[1]: *** [/home/martin.florek/julia/deps/mbedtls.mk:40: build/mbedtls-2.3.0/Makefile] Error 127
make[1]: *** Waiting for unfinished jobs....
  CC       src/libpcre2_8_la-pcre2_match_data.lo
rm -f ./so_locations

For the whole output from the console see link.
Thanks.

I’m also not entirely clear how to run building version of Julia by the way “Compiling with MinGW/MSYS2”, as it is not described in README.windows.md. I would expect something like julia.exe??

The MSYS2 build is not tested, likely broken, and should probably be removed from that document unless someone wants to submit a pull request to fix it. Cross-compilation from Cygwin is the supported method for building Julia from source on Windows right now.

2 Likes

Thank you @tkelman for your quick reply I really appreciate it.
Now I tried to compile the Julia with Cygwin, but compilation fell down and I got error in Makefile:215

    LINK usr/bin/julia.exe
    JULIA usr/lib/julia/inference.ji
C:/Users/martin.florek/Develop/Programs/cygwin64/home/martin.florek/julia/usr/bin/julia.exe: error while loading shared libraries: libgcc_s_seh-1.dll: cannot open shared object file: No such file or directory
make[1]: *** [Makefile:215: /home/martin.florek/julia/usr/lib/julia/inference.ji] Error 127
make: *** [Makefile:96: julia-inference] Error 2

This DLL is in the bin when I run usr/ bin/julia.exe give me popup window with the message:
“The program can’t start because libwinpthread-1.dll is missing from your computer. Try reinstalling the program to fix this problem”.

I had to copy libwinpthread-1.dll from .../Programs/cygwin64/usr/x86_64-w64-mingw32/sys-root/mingw/bin/ to usr/bin to solve the problem and re-run a command make -j 4. Then Julia works. Is it a correct solution?

That should be fine for now. It’s fixed on master and I’ll be backporting the fix to release-0.5.

I can get the msys2 build working but it takes quite a bit of effort.
c_check from openblas needs to be updated to the latest version
Ninja needs to be used to build mbedtls
Common.mk needs to remove the workaround of which cc

Even then there are still test failures!

Once openblas is bumped again I will be happy to fix the rest while also allowing for cmake_generator to be used for more than llvm. It isn’t really necessary though as the Cygwin build works perfectly fine.

I do dream of #11754 making building on windows easier!

2 Likes