Skip to content

Instantly share code, notes, and snippets.

@heetbeet
Last active January 11, 2021 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heetbeet/89d34a50c6541d238f680971a1555152 to your computer and use it in GitHub Desktop.
Save heetbeet/89d34a50c6541d238f680971a1555152 to your computer and use it in GitHub Desktop.
Lazy guide for compiling Julia on Windows

Setup your environment

Get cygwin portable

  • Download and place cygwin-portable-installer.cmd in the base directory.
  • Edit cygwin-portable-installer.cmd and add the following line (for additional Cygwin dependencies) after line set CYGWIN_PACKAGES=bash-completion,...:

    set CYGWIN_PACKAGES=%CYGWIN_PACKAGES%,cmake,gcc-g++,git,make,patch,curl,m4,python3,p7zip,mingw64-i686-gcc-g++,mingw64-i686-gcc-fortran,mingw64-x86_64-gcc-g++,mingw64-x86_64-gcc-fortran
    (The list of packages is taken from build-windows.md and might need updating in the future.)
  • Run cygwin-portable-installer.cmd for a completely automatic installation

Compile Julia

  • Create a file make-julia.cmd in your base directory and add the following content:
@echo 'XC_HOST = x86_64-w64-mingw32' > "%~dp0\julia\Make.user"
@call "%~dp0\cygwin-portable.cmd" -c "make -C '%~dp0\julia'" %*

     

  • You can now compile Julia by opening the directory in the terminal and run make-julia -j4
  • This may take a while...

Run Julia

  • After successfully compiling Julia, you find Julia in \julia\usr\bin\julia.exe


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment