General Information for Windows
Please see the README at https://github.com/JuliaLang/julia/blob/master/README.md for more complete information about Julia. This is intended to only include information specific to using Julia on Windows.
Julia runs on Windows XP SP2 or later (including Windows Vista, Windows 7, and Windows 8). Both the 32-bit and 64-bit versions are supported. The 32-bit i686 binary will run on either 32-bit and 64-bit operating systems. The 64-bit x86_64 binary will only run on 64-bit Windows.
Downloading additional libraries (Tk, Cairo, etc) is not necessary. Julia's package manager will acquire them as needed. For this to work, you must have
7z installed (not the command-line version / 7za) (see below), and it must be on your path.
Julia requires that the lib and lib/julia directories be part of your
%PATH% variable to startup. The
julia.bat script will attempt to do this for you and is the recommended way of running julia on your system. The julia.bat file can be given arguments (e.g.
julia.bat -p 2 script.jl for running script.jl on two processors) which will be passed directly to julia.exe.
Download the latest version of Julia from the downloads page at http://julialang.org/downloads/
Unzip the download to a folder. Do not attempt to run Julia without extracting the zip archive first (hint: it won't work). Double-click the file Julia.BAT to launch Julia.
Explore and have fun!
Recommended external libraries (essential, if you use binary-only or source distribution, without batteries-included):
Optional external libraries
- MinGW/MSYS (as described below)
There are a few environments you can use to build julia. Making this easy requires getting the right environment.
Important Build Errata
- You must use win32 threads version of MinGW. Do not use a POSIX threads version of MinGW.
- Do not use GCC 4.6 or earlier or gcc-dw2, stuff will be broken.
- Julia uses a patched version of GNU Readline (this should be downloaded automatically by the build script).
make win-extrasto download additional runtime dependencies not provided by default in MinGW.
On Windows, do not use the mingw/msys environment from http://www.mingw.org as it will miscompile the OpenBLAS math library
The recommended way to setup your environment follows:
- Download and extract MinGW (e.g. x64-4.8.0-release-win32-seh-rev2.7z) to C:/MinGW (or similar location) from MinGW-builds 32-bit or 64-bit
- Download and extract MSYS (e.g. msys+7za+wget+svn+git+mercurial+cvs-rev12.7z) to C:/MinGW/msys/1.0 (or similar location) from MinGW-w64/MSYS
- Add the line "C:/MinGW /mingw" to C:/MinGW/msys/1.0/etc/fstab (create the file if it doesn't exist)
- You will need to replace C:/MinGW/msys/1.0/bin/make.exe with C:/MinGW/msys/1.0/bin/make-old.exe or with a copy of make.exe extracted from mingw-msys (e.g. make-3.81-3-msys-1.0.13-bin.tar.lzma)
Before proceeding, verify that python.exe from Python 2.7 is available in the MSYS PATH. If Python is not installed on your computer, download Python 2.7 and install with default options (Python 2.7 is required to build LLVM; Python 3.3 will not work).
If you plan to build Cairo (for graphics), you'll also need to install CMake.
These sections assume you are familiar with building code. If you are not, you should stop reading now and go the the section on binaries. Regardless of which set of steps you followed above, you are now ready to compile julia. Open a unix shell by launching C:/MinGW/msys/1.0/msys.bat (or your favorite shortcut to that file).
Run the following commands in your build directory ($HOME at C:/MinGW/msys/1.0/home/your_name is fine)
git clone https://github.com/JuliaLang/julia.git
makeAvoid using the
-jargument to make. Windows will sometimes corrupt your build files. Additionally, make will probably lock up several times during the process, using 100% cpu, but not show progress. The only solution appears to be to kill make from the Task Manager and rerunning make. It should pickup where it left off. Expect this to take a very long time (dozens of hours is not uncommon).
Running julia can be done in two ways:
make run-julia[-release|-debug] [DEFAULT_REPL=(basic|readline)](e.g.
- Launching the julia.bat script in usr/bin
If you prefer to cross-compile, the following steps should get you started.
Ubuntu and Mac Dependencies (these steps will work for almost any linux platform)
First, you will need to ensure your system has the required dependencies. We need wine, a system compiler, and some downloaders.
apt-get install wine subversion cvs gcc wget p7zip-full
Unfortunately, the version of gcc installed by Ubuntu is currently 4.6, which does not compile OpenBLAS correctly. On Mac, the situation is the same: the version in MacPorts is very old and Homebrew does not have it. So first we need to get a cross-compile version of gcc. Most binary packages appear to not include gfortran, so we will need to compile it from source (or ask @vtjnash to send you a tgz of my build). This is typically quite a bit of work, so we will use this script to make it easy.
svn checkout http://mingw-w64-dgn.googlecode.com/svn/trunk/ mingw-w64-dgn
rebuild_cross.shand make the following two changes: a. uncomment
export MAKE_OPT="-j 2", if appropriate for your machine b. add
fortranto the end of
mv cross ~/cross-w64
export PATH=$HOME/cross-w64/bin:$PATH# NOTE: it is important that you remember to always do this before using make in the following steps!, you can put this line in your .profile to make it easy
Then we can essentially just repeat these steps for the 32-bit compiler, reusing some of the work:
cp -a mingw-w64-dgn mingw-w32-dgn
rm -r cross build
bash rebuild_cross.sh 32r
mv cross ~/cross-w32
export PATH=$HOME/cross-w32/bin:$PATH# NOTE: it is important that you remember to always do this before using make in the following steps!, you can put this line in your .profile to make it easy
Note: for systems that support rpm-based package managers, the OpenSUSE build service appears to contain a fully up-to-date versions of the necessary dependencies.
Arch Linux Dependencies
- Install the following packages from the official Arch repository:
sudo pacman -S cloog gcc-ada libmpc p7zip ppl subversion zlib
- The rest of the prerequisites consist of the mingw-w64 packages, which are available in the AUR Arch repository. They must be installed exactly in the order they are given or else their installation will fail. The
yaourtpackage manager is used for illustration purposes; you may instead follow the Arch instructions for installing packages from AUR or may use your preferred package manager. To start with, install
mingw-w64-binutilsvia the command
yaourt -S mingw-w64-binutils
yaourt -S mingw-w64-headers-svn
yaourt -S mingw-w64-headers-bootstrap
yaourt -S mingw-w64-gcc-base
yaourt -S mingw-w64-crt-svn
mingw-w64-headers-bootstrapwithout removing its dependent mingw-w64 installed packages by using the command
yaourt -Rdd mingw-w64-headers-bootstrap
yaourt -S mingw-w64-winpthreads
mingw-w64-gcc-basewithout removing its installed mingw-w64 dependencies:
yaourt -Rdd mingw-w64-gcc-base
- Complete the installation of the required
yaourt -S mingw-w64-gcc
Finally, the build and install process for Julia:
git clone https://github.com/JuliaLang/julia.git julia-win32
echo override XC_HOST = i686-w64-mingw32 >> Make.user
echo override DEFAULT_REPL = basic >> Make.user
make win-extras(Necessary before running
- move the julia-* directory / zip file to the target machine
If you are building for 64-bit windows, the steps are essentially the same. Just replace i686 in XC_HOST with x86_64. (note: on Mac, wine only runs in 32-bit mode)