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.
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 https://code.google.com/p/julialang/downloads/list
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:
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.
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)
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
cd julia
make
Avoid using the-j
argument 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.make run-julia
)- Launching the julia.bat script in usr/bin
If you prefer to cross-compile, the following steps should get you started:
First, you will need to ensure your system has the required dependencies. Note that I build on an Ubuntu system, so the make dist
may not be fully functional on other systems. On Ubuntu 12.04, the following command will install the required build dependencies.
apt-get install \
mingw-w64 \
gfortran-mingw-w64 \
g++-mingw-w64 \
gdb-mingw-w64 \
mingw-w64-tools \
binutils-mingw-w64 \
gcc-mingw-w64 \
wine
Unfortunately, the version of gcc installed by Ubuntu is currently 4.6, which does not compile OpenBLAS correctly. So first we need to replace it. Most binary packages appear to not include gfortran, so we will need to compile it from source. This is typically quite a bit of work, so we will use this script to make it easier.
apt-get install wine subversion cvs
svn checkout http://mingw-w64-dgn.googlecode.com/svn/trunk/ mingw-w64-dgn
cd mingw-w64-dgn
- edit
rebuild_cross.sh
and make the following two changes: (a) uncommentexport MAKE_OPT="-j 2"
, if appropriate for your machine (b) addfortran
to the end of--enable-languages=c,c++,objc,obj-c++
bash update_source.sh
bash rebuild_cross.sh
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! Then we can essentially just repeat these steps for the 32-bit compiler:cd ..
cp -a mingw-w64-dgn mingw-w32-dgn
cd 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!
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 environment.
Finally, the build and install process:
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 -j4
- (optional)
mkdir dist-extras && make win-extras
(actually, you probably want to hand execute the steps in this recipe since they may be inaccurate) make dist
- move the julia-* directory/zipfile 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.
-
Do not use GCC 4.6 or earlier
-
LLVM doesn't build with the newly released 4.8 SEH gcc for 64-bit Windows because of an incorrect preprocessor definition. In deps/llvm-3.2/lib/ExecutionEngine/JIT/JIT.cpp, find the section that defines HAVE_EHTABLE_SUPPORT and replace it with an unconditional 0
-
While building on native windows, MPFR tests fail. To fix this, edit deps/Makefile and add
MPFR_OPTS += --disable-thread-safe CFLAGS="-DNPRINTF_L -DNPRINTF_T -DNPRINTF_J"
somewhere