If you get an error that looks like ```../kernel/x86_64/dgemm_kernel_4x4_haswell.S:1709: Error: no such instruction: `vpermpd $ 0xb1,%ymm0,%ymm0'```, then you need to set `OPENBLAS_DYNAMIC_ARCH = 0` or `OPENBLAS_NO_AVX2 = 1`, or you need a newer version of `binutils` (2.18 or newer). ([Issue #7653](https://github.com/JuliaLang/julia/issues/7653)) Illegal Instruction error | Check if your CPU supports AVX while your OS does not (e.g. through virtualization, as described in [this issue](https://github.com/JuliaLang/julia/issues/3263)), and try installing LLVM 3.3 instead of LLVM 3.2. ### OS X It is essential to use a 64-bit gfortran to compile Julia dependencies. The gfortran-4.7 (and newer) compilers in brew and MacPorts work for building Julia. Clang is now used by default to build Julia on OS X (10.7 and above). It is recommended that you upgrade to the latest version of Xcode (at least 4.3.3.). You need to have the Xcode command line utilities installed (and updated): run `xcode-select --install` in the terminal (in Xcode prior to v5.0, you can alternatively go to Preferences -> Downloads and select the Command Line Utilities). This will ensure that clang v3.1 is installed, which is the minimum version of `clang` required to build Julia. On OS X 10.6, the Julia build will automatically use `gcc`. If you have set `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` in your `.bashrc` or equivalent, Julia may be unable to find various libraries that come bundled with it. These environment variables need to be unset for Julia to work. If you see build failures in OpenBLAS or if you prefer to experiment, you can use the Apple provided BLAS in vecLib by building with `USE_SYSTEM_BLAS=1`. Julia does not use the Apple provided LAPACK, as it is too old. ### FreeBSD On *FreeBSD Release 9.0*, install the `gcc46`, `git`, and `gmake` packages/ports, and compile Julia with the command: $ gmake FC=gfortran46 You must use the `gmake` command on FreeBSD instead of `make`. ### Windows In order to build Julia on Windows, see [README.windows](https://github.com/JuliaLang/julia/blob/master/README.windows.md). ### Vagrant Julia can be developed in an isolated Vagrant environment. See [the Vagrant README](https://github.com/JuliaLang/julia/blob/master/contrib/vagrant/README.md) for details. ## Required Build Tools and External Libraries Building Julia requires that the following software be installed: - **[GNU make]** — building dependencies. - **[gcc & g++][gcc]** (>= 4.4) or **[Clang][clang]** (>= 3.1, Xcode 4.3.3 on OS X) — compiling and linking C, C++ - **[gfortran][gcc]** — compiling and linking fortran libraries - **[git]** — version control and package management (version 1.7.3+ required) - **[perl]** — preprocessing of header files of libraries. - **[wget]**, **[curl]**, or **[fetch]** (FreeBSD) — to automatically download external libraries. - **[m4]** — needed to build GMP. - **[patch]** — for modifying source code. - **[cmake]** — needed to build libgit2. Julia uses the following external libraries, which are automatically downloaded (or in a few cases, included in the Julia source repository) and then compiled from source the first time you run `make`: - **[LLVM]** (>= 3.3) — compiler infrastructure. - **[FemtoLisp]** — packaged with Julia source, and used to implement the compiler front-end. - **[libuv]** — portable, high-performance event-based I/O library - **[OpenLibm]** — a portable libm library containing elementary math functions. - **[OpenSpecFun]** (>= 0.4) — a library containing Bessel and error functions of complex arguments. - **[DSFMT]** — a fast Mersenne Twister pseudorandom number generator library. - **[OpenBLAS]** — a fast, open, and maintained [basic linear algebra subprograms (BLAS)](http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) library, based on [Kazushige Goto's](http://en.wikipedia.org/wiki/Kazushige_Goto) famous [GotoBLAS](http://www.tacc.utexas.edu/tacc-projects/gotoblas2/). The system provided BLAS and LAPACK are used on OS X. - **[LAPACK]** (>= 3.4) — a library of linear algebra routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems. - **[MKL]** (optional) – OpenBLAS and LAPACK may be replaced by Intel's MKL library. - **[AMOS]** — subroutines for computing Bessel and Airy functions. - **[SuiteSparse]** — a library of linear algebra routines for sparse matrices. - **[ARPACK]** — a collection of subroutines designed to solve large, sparse eigenvalue problems. - **[FFTW]** (>= 3.3) — library for computing fast Fourier transforms very quickly and efficiently. - **[PCRE]** (>= 8.31) — Perl-compatible regular expressions library. - **[GMP]** (>= 5.0) — the GNU multiple precision arithmetic library, needed for bigint support. - **[MPFR]** (>= 3.0) — the GNU multiple precision floating point library, needed for arbitrary precision floating point support. - **[libgit2]** (>= 0.21) — the Git linkable library, used by Julia's package manager For a longer overview of Julia's dependencies, see these [slides](https://github.com/tkelman/BAJUtalk-Dec2014/blob/master/BAJUtalkDec2014.pdf?raw=true). [GNU make]: http://www.gnu.org/software/make/ [patch]: http://www.gnu.org/software/patch/ [wget]: http://www.gnu.org/software/wget/ [m4]: http://www.gnu.org/software/m4/ [gcc]: http://gcc.gnu.org/ [clang]: http://clang.llvm.org/ [curl]: http://curl.haxx.se/ [fetch]: http://www.freebsd.org/cgi/man.cgi?fetch(1) [git]: http://git-scm.com/ [perl]: http://www.perl.org/ [cmake]: http://www.cmake.org/ [OpenLibm]: https://github.com/JuliaLang/openlibm [OpenSpecFun]: https://github.com/JuliaLang/openspecfun [DSFMT]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/#dSFMT [OpenBLAS]: https://github.com/xianyi/OpenBLAS [LAPACK]: http://www.netlib.org/lapack/ [MKL]: http://software.intel.com/en-us/articles/intel-mkl/ [SuiteSparse]: http://faculty.cse.tamu.edu/davis/suitesparse.html [AMOS]: http://netlib.org/amos [ARPACK]: http://forge.scilab.org/index.php/p/arpack-ng/ [FFTW]: http://www.fftw.org/ [PCRE]: http://www.pcre.org/ [LLVM]: http://www.llvm.org/ [FemtoLisp]: https://github.com/JeffBezanson/femtolisp [GMP]: http://gmplib.org/ [MPFR]: http://www.mpfr.org/ [double-conversion]: http://double-conversion.googlecode.com/ [libuv]: https://github.com/JuliaLang/libuv [libgit2]: https://libgit2.github.com/ ### System Provided Libraries If you already have one or more of these packages installed on your system, you can prevent Julia from compiling duplicates of these libraries by passing `USE_SYSTEM_...=1` to `make` or adding the line to `Make.user`. The complete list of possible flags can be found in `Make.inc`. Please be aware that this procedure is not officially supported, as it introduces additional variability into the installation and versioning of the dependencies, and is recommended only for system package maintainers. Unexpected compile errors may result, as the build system will do no further checking to ensure the proper packages are installed. ### SuiteSparse SuiteSparse is a special case, since it is typically only installed as a static library, while `USE_SYSTEM_SUITESPARSE=1` requires that it is a shared library. Running the script `contrib/repackage_system_suitesparse4.make` will copy your static system SuiteSparse installation into the shared library format required by Julia. `make USE_SYSTEM_SUITESPARSE=1` will then use the SuiteSparse that has been copied into Julia's directory, but will not build a new SuiteSparse library from scratch. ### Intel compilers and Math Kernel Libraries To use the Intel [MKL] BLAS and LAPACK libraries, make sure that MKL version 10.3.6 or higher is installed. For a 64-bit architecture, the environment should be set up as follows: # bash source /path/to/mkl/bin/mklvars.sh intel64 ilp64 export MKL_INTERFACE_LAYER=ILP64 It is recommended that Intel compilers be used to build julia when using MKL. Add the following to the `Make.user` file: USEICC = 1 USEIFC = 1 USE_INTEL_MKL = 1 USE_INTEL_MKL_FFT = 1 USE_INTEL_LIBM = 1 It is highly recommended to start with a fresh clone of the Julia repository. ## Source Code Organization The Julia source code is organized as follows: base/ source code for Julia's standard library contrib/ editor support for Julia source, miscellaneous scripts deps/ external dependencies doc/manual source for the user manual doc/stdlib source for standard library function help text examples/ example Julia programs src/ source for Julia language core test/ test suites test/perf benchmark suites ui/ source for various front ends usr/ binaries and shared libraries loaded by Julia's standard libraries ## Binary Installation Because of the rapid pace of development at this point, we recommend installing the latest Julia from source, but platform-specific tarballs with pre-compiled binaries are also [available for download](http://julialang.org/downloads/). You can either run the `julia` executable using its full path in the directory created above, or add that directory to your executable path so that you can run the Julia program from anywhere (in the current shell session): export PATH="$(pwd)/julia:$PATH" Now you should be able to run Julia like this: julia On Windows, double-click `usr/bin/julia.exe`. If everything works correctly, you will see a Julia banner and an interactive prompt into which you can enter expressions for evaluation. You can read about [getting started](http://julialang.org/manual/getting-started) in the manual. The following distributions include julia, but the versions may be out of date due to rapid development: * [Arch Linux](https://www.archlinux.org/packages/community/i686/julia/) * [Debian GNU/Linux](http://packages.debian.org/sid/julia) * [Fedora Linux](https://admin.fedoraproject.org/pkgdb/package/julia/), RHEL/CentOS/OEL/Scientific Linux (EPEL) * [Current stable release for Fedora/EPEL](https://copr.fedoraproject.org/coprs/nalimilan/julia/) * [Nightly builds for Fedora/EPEL](https://copr.fedoraproject.org/coprs/nalimilan/julia-nightlies/) * [Gentoo Linux](https://packages.gentoo.org/package/dev-lang/julia) * Git Package in the [Science overlay](https://wiki.gentoo.org/wiki/Project:Science/Overlay) * openSUSE * Stable package for openSUSE: [OBS page](https://build.opensuse.org/package/show/science/julia), [1 Click Install](http://software.opensuse.org/download.html?project=science&package=julia) * Git package for openSUSE: [OBS page](https://build.opensuse.org/package/show/science/julia-unstable), [1 Click Install](http://software.opensuse.org/download.html?project=science&package=julia-unstable) * Ubuntu * [Ubuntu 13.04 (Raring Ringtail)](http://packages.ubuntu.com/raring/julia) * [Nightly builds PPA](https://launchpad.net/~staticfloat/+archive/julianightlies) (depends on the [julia-deps PPA](https://launchpad.net/~staticfloat/+archive/julia-deps/)) * [OS X Homebrew Tap](https://github.com/staticfloat/homebrew-julia/) ## Editor and Terminal Setup Currently, Julia editing mode support is available for Emacs, Vim, Textmate, Sublime Text, Notepad++, and Kate, in `contrib/`. There is early support for IDEs such as [Juno](http://junolab.org/), [Eclipse (LiClipse)](http://brainwy.github.io/liclipse/). A notebook interface is available through [IJulia](https://github.com/JuliaLang/IJulia.jl), which adds Julia support to [IPython](http://ipython.org). The [Sublime-IJulia](https://github.com/quinnj/Sublime-IJulia) plugin enables interaction between IJulia and Sublime Text. In the terminal, Julia makes great use of both control-key and meta-key bindings. To make the meta-key bindings more accessible, many terminal emulator programs (e.g., `Terminal`, `iTerm`, `xterm`, etc.) allow you to use the alt or option key as meta. See the section in the manual on [interacting with Julia](http://docs.julialang.org/en/latest/manual/interacting-with-julia/) for more details.