The Julia Language: A fresh approach to technical computing.
Switch branches/tags
KristofferC-patch-1 KristofferC-patch-2 KristofferC-patch-3 KristofferC-patch-4 KristofferC-patch-5 KristofferC-patch-6 KristofferC-patch-7 aa/aggressive-remove_linenums aa/dotted-tilde aa/extrema-function aa/glibc aa/join-function aa/peek-a-boo aa/1.1.0-rc1 aa/1.2.0-DEV adr/snapshot ajf/broadcast-dicts ajf/cartesianrange-array ajf/deprecatemultivaluenonscalarindexedassignment ajf/dict-iterate-values ajf/hasindex ajf/mappedarray ajf/no-pure-adjoint ajf/only ajf/pairs2 ajf/propage_inbounds_broadcast ajf/redundant-dict-code ajf/sets ajf/tuplekeys ajf/vectortranspose2 ajf/view-of-range amitm/cachingpool amitm/parfor2 amitm/threading amp-ref an/I an/In anj/gees anj/genlu anj/map anj/nosuitesparse anj/novals anj/smallmul anj/static backport-1.0.3 backport-1.1.0 breakmore cjf/fpe-exceptions cjf/line-continuation cjf/runtime-logging cjf/show-exception-stacks cjh/doxygen cjh/fix-4774 cjh/hess cjh/parallel-bench cjh/perftip-fixup cv/bigfloat-trunc cv/dates-replace cv/invalid-rational cv/libgit2-experiment cv/pkg-test-evalfile fe/default-environment fe/hermsym-matrixfunc fe/integer-construction fe/loggerstream fe/numbered-docs fe/structured-matrix-constructor fe/trueorfalse fix9475 gpu-broadcast id_norm ihn/fix12806 ihnorton-patch-fnlz-doc ird/substrcon jb/anyeltype jb/arraygcperf jb/braceshcat jb/cgroots jb/codeinfostuff jb/convertmissingnothing jb/depyieldto jb/dotcolon jb/fastercat jb/fix14106 jb/fix29059 jb/fix29501 jb/fix29594 jb/fix30335 jb/hash0 jb/implicitssa jb/interpreter_opt jb/interpretmore jb/jr/tuplelattice jb/latency3 jb/latency10 jb/lessinferenceinfo jb/lexproduct jb/modprefixshow jb/ordereddict jb/precompile_check jb/r5rs jb/rethrow jb/serializeperf jb/typemap jb/typemap0 jb/warnmissingcode jb/zeroarrays jb/06_compiler_perf jcb/arrayviews jcb/debugdocs jcb/evalmacrocallthrows jcb/genfunreflect jcb/juliarepl jcb/pkg_casesensitive jcb/pkgerror jcb/randchar jcb/rm04deps jcb/simdmdloop jh/float-colon jh/keys-and-vals jh/setops jmm/repl_hooks jmm/select jmm/string_rename jmw/null-syntax jn/Fusion jn/StructRet_abi jn/apply_type_error_message jn/backedge-fixup jn/cg-class jn/channel-mt jn/check_sadd jn/codegen-norecursion jn/codegen_rewrite jn/compile-all-0.6 jn/compile_all_generic_box jn/condition-mt jn/drop-inexact jn/eschnett/clang-format jn/fix-macro-scope-design jn/fixup-pty-and-precompile jn/frontend-cl-closure-perf jn/gc-pool-lazy jn/gc_stack jn/generalized-LOAD_PATH-compilecache jn/iddict jn/in-isequal jn/infer-Const-cache jn/iocolor jn/iocolor2 jn/iterate jn/jb-subtype-const-type-fix jn/jb-subtype-faster-isa-Type jn/jb-subtype jn/jl_bitszero jn/jlinterpreter jn/kf-linecolstr jn/kf/iterate-wip jn/kf/newlocs jn/kwcall jn/lazydoc jn/less-at-generated jn/license-committers jn/llvmcall_jl_value_t jn/llvmcall2 jn/loading-plus jn/loading-refactoring-docs jn/loading-refactoring jn/localize-multiversioning jn/lower-inline_cost_threshold jn/ml-match-opt jn/modulecoalescing jn/msvclink jn/newir-test-fixes jn/opt-makefile-compile-take2 jn/release-0.5-faster-front jn/release0.6-26833 jn/simple-scope jn/slot-type-infer-optimize jn/stagedfail jn/steprange jn/subtype-sig-equal jn/test-warn-repr jn/topmodule jn/travis-test jn/tune_whos jn/tuplecc jn/type-construction-normalization jn/typemap-name jn/typename_hide_null_svec jn/unhandled_exception_handler jn/union-bits-layout jn/update-precompile-heuristic jn/warn_dllist jn/widen_method_matchs jn/win32_debug_julia_got jn/26512 jn/29872-compare jn/30344 jq/array-union-bits2 jq/buffer jq/mmap2 jq/mmqp jq/namedtuplepatch jq/namedtuples jq/parsing jq/union-bits-layout-rebased jr/betterspoof jr/cinfoworldbounds jr/cinfoworldboundstmp jr/compiledebug jr/doasyouaretold jr/ptupleprop jr/testlog jr/tmp2 jr/tupleconst jr/tuplekindtypefix jr/tuplelatticeold jr/wip kc/JULIA_ENV kc/TM kc/anonymous kc/break_linalg kc/cache_available kc/callbacks kc/check_overwritten kc/code_loading_hook kc/codepoint_to_utf8 kc/copyto_inline kc/debug_partr_precompile kc/debug_precompile kc/debug kc/doctest_meta2 kc/doctests_CI kc/dom_err_msgs kc/edit_symbol kc/err_msg_invalid_help_query kc/exception_trait kc/excise_libgit2_v2 kc/fix_doctests kc/fix_init kc/fix_loading_top_level kc/ggwp kc/gimp_precompile kc/ident kc/immut_dict kc/index_sparse_column kc/inference_regression kc/inline_print kc/loading_debug_error kc/mod_bind_name kc/move_dates_anub kc/no_top_level_scope_frame_repl kc/ohnohedidn kc/online_with_the_rest kc/outline_log kc/parse_simple kc/perf_ident kc/pkg3_documenter kc/pkg3_patch kc/pkg3 kc/pkgstdlib kc/precomp_pkg3 kc/precompile_overhead kc/precompile_with_pkg3 kc/relax_strided_sparse_matmul kc/repl_fast kc/robustness kc/search_str_perf kc/seed_fast kc/set_threads kc/simpler_copyto kc/so_long_and_thanks_for_the_packages kc/sparse_check kc/split_testhelpers kc/stdlib_loadpath_buildtest kc/stdlib_markdown kc/stdlib_printing kc/stdlib kc/test_inline kc/test_linfo kc/test kc/trim_load_path_on_sysimg_load kc/whatdocstoshow kf/abstractstringit kf/aliasscopes kf/_apply_apply_type kf/assertegal kf/bigsroa kf/cfgsimp kf/cfgwip kf/clangsa kf/clangwinround kf/cmdlineargstimeout kf/codegen kf/codetypedconst kf/dsymutil kf/effectfree2 kf/eps kf/filestdio kf/gallium kf/gcrootdeleter kf/gotoifnottrap kf/hashpreserve kf/inferencecomplexity kf/iter kf/iteratewip kf/jb/rm_deps_3 kf/jn/26512 kf/latesplitting kf/limitdoc kf/llvm38cmake kf/llvmpasstests kf/magiccompilerdustforceleste2 kf/magiccompilerdustforceleste3 kf/magiccompilerdustforceleste4 kf/mimedata kf/mmap kf/msys2cmd kf/multiany kf/mutatingimmutables kf/newdinfo kf/newinline kf/newoptselectvalue kf/permuteddimssimilar kf/piperedirect kf/powovf kf/pzip kf/refactortodo kf/reinterpretredux kf/replfixes kf/sanitizerbuild kf/sanitizermake kf/segvjl_ kf/stdioredirect kf/symimmut kf/tbaaipo kf/topush kf/tpu kf/tpu2 kf/tpu3 kf/uncolon kf/unionpenalties kf/unionsplit2 kf/unwindagain kf/uvint32 kf/wasm kf/winfix kf/wip kf/xlademo kf/11902 kms/c_fortran_doc_updates kms/find_extrema kp/old_partr kp/partr kp/schedtask ksh/basicstring ksh/concatex ksh/doccandp ksh/docmacros ksh/errshow ksh/linalgtests ksh/lineup ksh/manmod ksh/nt ksh/nwaiter ksh/pinvtri ksh/pkgtestset ksh/svds ksh/uschol master mb/NEWSupdate mb/broadcasterable mb/cartesiansubarray mb/consttypefields mb/deprecatemultivaluenonscalarindexedassignment mb/doctake! mb/extensible-method-error mb/inbounds-expression mb/indexed-eltype mb/intsetrefactor mb/native-bounds mb/recursive-cat mb/reductioneeze mb/remotehashall mb/reverseunsignedrange mb/sparsefinders mb/stridedtransposes mb/thisshouldhaveoccurredtome mb/transpose mb/unaliascopy-reinterprets mb/value-based-BroadcastStyle mb/viewdefault mb/whisperdownthelane mbauman-patch-1 mh/divrem_u128_i686 mh/fix_25430 mh/patch_rdims mh/specialize_similar_for mh/tmerge_to_union_more_often mji/zygote mn/3150 mn/5333 mn/8828 moon/hygienic-macros nl/cat nl/firstlast nl/fpsort nl/is nl/length nl/mapreducedim nl/mbedtls nl/repeated nl/setindex! nl/sleep nl/sort nl/strmissing ob/aepsf ob/cov ob/cttx ob/fixdispatch ob/fty ob/goodbye-type_goto ob/ibit ob/infsplat ob/interp_call ob/mapfl ob/mmapquota ob/ptrfree ob/rref ob/stackmaps ob/stknew ob/stkw ob/stp release-0.1 release-0.2 release-0.3 release-0.4 release-0.5 release-0.6 release-0.7 release-1.0 release-1.1 revert-22049-kf/memcpyopt revert-26854-kc/bump_pkg3_6 revert-28319-kc/precompiler_build2 revert-29494-kf/uncolon_recursion rf/Bit rf/MT-show rf/autoindentpaste rf/big-init2 rf/bigint-native rf/count-etc rf/deepcopy rf/defaults rf/digits-unsigned-nonrecur rf/digits-unsigned rf/doc-push rf/doc-remove-stacktraces rf/hex2num-deprecate rf/iter-access rf/ndigits-bases rf/pure-push rf/rand-distrib rf/rand-f16-shift rf/rand/RANDOM_DEVICE rf/rand/fast rf/rand/frompair rf/rand/genpair rf/rand/ndl rf/rand/range-bool rf/rand/unleash rf/randn-fillarray rf/regexp-concat rf/repl/iocontext rf/repl/simplify rf/set-ctor rf/str-pred-case rf/switch-GLOBAL_RNG rf/union-fix-max_values rf/union-immutable-set rf/unmerge-merge rf/0x-BigInt sb/abstractcomplex sb/accumulate sb/callsuper sb/div12 sb/dllist sb/dmg-bg sb/doc-select sb/enumset sb/exit sb/fastmath sb/firstday sb/foldr sb/irrational-bigfloat sb/libgit2/peel sb/pipelineerror sb/qr2 sb/rearrange sb/reduce-and sb/reduce-empty sb/reduce sb/roundbool sb/suitesparse-news sb/triangular sc_mtime sf/JULIA_CPU_TARGET sf/background_output_prepending sf/gfortran4 sf/http_parser sf/httpbin sf/matrix_conversions sf/memprofiler sf/openblas_no_patches sf/sticky_shells_and_ringing_bells sf/suitesparse_ldflags sf/testing sf/travisosx sf/which_doesnt_throw sjk/int-print sjk/spqr sk/bytes sk/chop sk/copynothing sk/depsload sk/highlander.alt sk/highlander.alt1 sk/highlander.alt2 sk/libgit2-discover sk/linspace sk/lockfile sk/markdown sk/median-fix sk/my-precious sk/newchar sk/next-to-nothing sk/pkg3up sk/pkg3 sk/precompile-blacklist sk/reqfrom sk/str sk/strdiv sk/stringstate sk/trig sk/void sk/winpaths sk/x-init sk/xchar srp/repl-undo staging stevengj-patch-1 stevengj-patch-2 tan/readdlm2 tb/codegen-norecursion tb/cuda tb/ext_langimpl tb/fnattrs tb/hotfix tb/inference_hooks tb/log_nothing tb/loglevels tb/pmb_test tb/poison tb/strip_as teh/better_errors2 teh/c_callgraph teh/depbind_module_rebased teh/dict_empty teh/disable_inline_macros teh/ducktype_functions teh/find_cleanup teh/findfirst_next teh/index_with_numbers teh/inlining_unreachable teh/linspace4 teh/method_exists teh/printf teh/reshapedarrays teh/shareindexes teh/splatting_numbers_inference teh/sub_inference teh/tuple_limit teh/tupleutils teh/type_redefinition teh/unitstrides teh/valen teh/valen3 teh/workermodules test_testset_overhead tk/checkdeps tk/fix20925 tk/geev tk/pkgsubtract tk/shell-quotes-windows tk/sparsediv0 vc/aligned_bitstype vc/asan_tasks vc/compiler-rt vc/distloading vc/float16_intrinsics vc/float16 vc/float128_basic vc/float128 vc/int128_atomics vc/irshow vc/jlrt vc/llvm_undef vc/no_copy_stacks vc/pool_alignment vc/power_openblas vc/ppc-llvm6 vc/ppc_unix_signals vc/restored-1.0.1 vc/revert28449 vc/smallints vc/tapir vc/tsan_nort vc/tsan vc/vsts vc/win_poolalignment vc/x86low vc/7prep vs/arm-delete-readme vs/macports yyc/arm/crc32c yyc/arm/fenv-0.5 yyc/banner yyc/bigint yyc/build/doc yyc/build/llvm yyc/call-site-cache yyc/cmake yyc/codegen/alloc2 yyc/codegen/eh yyc/codegen/local-push yyc/codegen/wb2 yyc/const-jlcall yyc/dft_split yyc/dftnew_rebase yyc/fieldcall-0.7 yyc/fieldcall yyc/gc-alloc yyc/gc-debug-env yyc/gc/safepoint-rt yyc/gc/thread-DO-NOT-merge yyc/less-getfield yyc/ovldot yyc/show-new yyc/test/release-0.6 yyc/tests/appveyor yyc/tests/arm yyc/tests/llvm39 yyc/tests/master yyc/travis-test yyc/typeinf/pure yyc/undef_sig
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci delete OldPkg (#27930) Aug 6, 2018
.github Move CONTRIBUTING.md back to root. Feb 1, 2018
base Expand and fix documentation of BitArray (#30340) Dec 11, 2018
contrib Remove contrib/build_sysimg.jl (#30225) Dec 11, 2018
deps Upgrade Pkg to version 1.1. (#30342) Dec 11, 2018
doc use non Pkg for workflow (#30194) Dec 11, 2018
etc fix write_base_cache to be consistend with the reader byte order (#26569 Mar 22, 2018
src Use `JL_AArch64_crc` instead of `HWCAP_CRC32` (#30324) Dec 9, 2018
stdlib Adding rtol and atol for pinv and nullspace (#29998) Dec 11, 2018
test Test for islocked(::ReentrantLock) (#30243) Dec 10, 2018
ui Add exception stack system to runtime Oct 5, 2018
.freebsdci.sh delete OldPkg (#27930) Aug 6, 2018
.gitattributes Revert #27291 (force Git to use LF instead of CRLF) (#28280) Jul 26, 2018
.gitignore Add pid to malloc log (#29969) Nov 26, 2018
.mailmap update mailmap Nov 16, 2018
.travis.yml Install `ccache` on OSX Travis (#30111) Nov 21, 2018
CONTRIBUTING.md Compat admonitions and NEWS for Julia 1.1 (#30230) Dec 5, 2018
DISTRIBUTING.md ARPACK is no longer included (#29758) Oct 29, 2018
HISTORY.md move 1.0 news to HISTORY file; prepare NEWS file for 1.1 (#29490) Oct 3, 2018
LICENSE.md Don't bundle busybox with Windows (#30022) Nov 20, 2018
Make.inc libuv: upgrade to v2 master fork Nov 30, 2018
Makefile Fix makefile not removing libjulia-debugon windows (#30059) Dec 8, 2018
NEWS.md Adding rtol and atol for pinv and nullspace (#29998) Dec 11, 2018
README.arm.md Remove ARPACK and derived functions from julia repo (#27616) Jun 18, 2018
README.md Add sh color syntaxing in README (#30081) Nov 19, 2018
README.windows.md update link to ConEmu terminal (#28578) Aug 11, 2018
VERSION Set VERSION to 1.1.0-DEV (#28532) Aug 10, 2018
Windows.inc Makefile: DEBUG -> JL_DEBUG_BUILD to avoid LLVM conflict May 18, 2014
appveyor.yml Don't bundle busybox with Windows (#30022) Nov 20, 2018

README.md

Build status: travis appveyor

Code coverage: coveralls codecov

The Julia Language

Julia is a high-level, high-performance dynamic language for technical computing. The main homepage for Julia can be found at julialang.org. This is the GitHub repository of Julia source code, including instructions for compiling and installing Julia, below.

Resources

New developers may find the notes in CONTRIBUTING helpful to start contributing to the Julia codebase.

External Resources

Currently Supported Platforms

Julia is built and tested regularly on the following platforms:

Operating System Architecture CI Binaries Support Level
Linux 2.6.18+ x86-64 (64-bit) Official
i686 (32-bit) Official
ARM v7 (32-bit) Official
ARM v8 (64-bit) Community
PowerPC (64-bit) Community
PTX (64-bit) External
macOS 10.8+ x86-64 (64-bit) Official
Windows 7+ x86-64 (64-bit) Official
i686 (32-bit) Official
FreeBSD 11.0+ x86-64 (64-bit) Official

All systems marked with ✓ for CI are tested using continuous integration for every commit. Systems with ✓ for binaries have official binaries available on the downloads page and are tested regularly. The PTX backend needs the CUDAnative.jl package. The systems listed here with neither CI nor official binaries are known to build and work, but ongoing support for those platforms is dependent on community efforts. It is possible that Julia will build and work on other platforms too, and we're always looking to improve our platform coverage. If you're using Julia on a platform not listed here, let us know!

Source Download and Compilation

First, make sure you have all the required dependencies installed. Then, acquire the source code by cloning the git repository:

git clone git://github.com/JuliaLang/julia.git

(If you are behind a firewall, you may need to use the https protocol instead of the git protocol:

git config --global url."https://".insteadOf git://

Be sure to also configure your system to use the appropriate proxy settings, e.g. by setting the https_proxy and http_proxy variables.)

By default you will be building the latest unstable version of Julia. However, most users should use the most recent stable version of Julia, which is currently the 1.0 series of releases. You can get this version by changing to the Julia directory and running

git checkout v1.0.2

Now run make to build the julia executable. To perform a parallel build, use make -j N and supply the maximum number of concurrent processes. (See Platform Specific Build Notes for details.) When compiled the first time, it will automatically download and build its external dependencies. This takes a while, but only has to be done once. If the defaults in the build do not work for you, and you need to set specific make parameters, you can save them in Make.user, and place the file in the root of your Julia source. The build will automatically check for the existence of Make.user and use it if it exists. Building Julia requires 5GiB of disk space and approximately 2GiB of virtual memory.

You can create out-of-tree builds of Julia by specifying make O=<build-directory> configure on the command line. This will create a directory mirror, with all of the necessary Makefiles to build Julia, in the specified directory. These builds will share the source files in Julia and deps/srccache. Each out-of-tree build directory can have its own Make.user file to override the global Make.user file in the top-level folder.

If you need to build Julia on a machine without internet access, use make -C deps getall to download all the necessary files. Then, copy the julia directory over to the target environment and build with make.

Note: The build process will fail badly if any of the build directory's parent directories have spaces or other shell meta-characters such as $ or : in their names (this is due to a limitation in GNU make).

Once it is built, you can run the julia executable after you enter your julia directory and run

./julia

To run julia from anywhere you can:

  • add an alias (in bash: echo "alias julia='/path/to/install/folder/bin/julia'" >> ~/.bashrc && source ~/.bashrc), or

  • add a soft link to the julia executable in the julia directory to /usr/local/bin (or any suitable directory already in your path), or

  • add the julia directory to your executable path for this shell session (in bash: export PATH="$(pwd):$PATH" ; in csh or tcsh: set path= ( $path $cwd ) ), or

  • add the julia directory to your executable path permanently (e.g. in .bash_profile), or

  • write prefix=/path/to/install/folder into Make.user and then run make install. If there is a version of Julia already installed in this folder, you should delete it before running make install.

Now you should be able to run Julia like this:

julia

If everything works correctly, you will see a Julia banner and an interactive prompt into which you can enter expressions for evaluation. (Errors related to libraries might be caused by old, incompatible libraries sitting around in your PATH. In this case, try moving the julia directory earlier in the PATH). Note that most of the instructions above apply to unix systems.

Your first test of Julia determines whether your build is working properly. From the UNIX/Windows command prompt inside the julia source directory, type make testall. You should see output that lists a series of running tests; if they complete without error, you should be in good shape to start using Julia.

You can read about getting started in the manual.

If you are building a Julia package for distribution on Linux, OS X, or Windows, take a look at the detailed notes in DISTRIBUTING.md.

Updating an existing source tree

If you have previously downloaded julia using git clone, you can update the existing source tree using git pull rather than starting anew:

cd julia
git pull && make

Assuming that you had made no changes to the source tree that will conflict with upstream updates, these commands will trigger a build to update to the latest version.

General troubleshooting

  1. Over time, the base library may accumulate enough changes such that the bootstrapping process in building the system image will fail. If this happens, the build may fail with an error like

     *** This error is usually fixed by running 'make clean'. If the error persists, try 'make cleanall' ***

    As described, running make clean && make is usually sufficient. Occasionally, the stronger cleanup done by make cleanall is needed.

  2. New versions of external dependencies may be introduced which may occasionally cause conflicts with existing builds of older versions.

    a. Special make targets exist to help wipe the existing build of a dependency. For example, make -C deps clean-llvm will clean out the existing build of llvm so that llvm will be rebuilt from the downloaded source distribution the next time make is called. make -C deps distclean-llvm is a stronger wipe which will also delete the downloaded source distribution, ensuring that a fresh copy of the source distribution will be downloaded and that any new patches will be applied the next time make is called.

    b. To delete existing binaries of julia and all its dependencies, delete the ./usr directory in the source tree.

  3. If you've updated OS X recently, be sure to run xcode-select --install to update the command line tools. Otherwise, you could run into errors for missing headers and libraries, such as ld: library not found for -lcrt1.10.6.o.

  4. If you've moved the source directory, you might get errors such as CMake Error: The current CMakeCache.txt directory ... is different than the directory ... where CMakeCache.txt was created., in which case you may delete the offending dependency under deps

  5. In extreme cases, you may wish to reset the source tree to a pristine state. The following git commands may be helpful:

     git reset --hard #Forcibly remove any changes to any files under version control
     git clean -x -f -d #Forcibly remove any file or directory not under version control

    To avoid losing work, make sure you know what these commands do before you run them. git will not be able to undo these changes!

Uninstalling Julia

Julia does not install anything outside the directory it was cloned into. Julia can be completely uninstalled by deleting this directory. Julia packages are installed in ~/.julia by default, and can be uninstalled by deleting ~/.julia.

Platform-Specific Build Notes

Linux

General

  • GCC version 4.7 or later is required to build Julia.
  • To use external shared libraries not in the system library search path, set USE_SYSTEM_XXX=1 and LDFLAGS=-Wl,-rpath,/path/to/dir/contains/libXXX.so in Make.user.
    • Instead of setting LDFLAGS, putting the library directory into the environment variable LD_LIBRARY_PATH (at both compile and run time) also works.
  • The USE_SYSTEM_* flags should be used with caution. These are meant only for troubleshooting, porting, and packaging, where package maintainers work closely with the Julia developers to make sure that Julia is built correctly. Production use cases should use the officially provided binaries. Issues arising from the use of these flags will generally not be accepted.
  • See also the external dependencies.

Architecture Customization

Julia can be built for a non-generic architecture by configuring the ARCH Makefile variable. See the appropriate section of Make.inc for additional customization options, such as MARCH and JULIA_CPU_TARGET.

For example, to build for Pentium 4, set MARCH=pentium4 and install the necessary system libraries for linking. On Ubuntu, these may include lib32gfortran-6-dev, lib32gcc1, and lib32stdc++6, among others.

You can also set MARCH=native for a maximum-performance build customized for the current machine CPU.

Ubuntu

The julia-deps PPA contains updated packages for Julia dependencies if you want to use system libraries instead of having them downloaded and built during the build process. See System Provided Libraries.

RHEL/CentOS 6

On RHEL/CentOS 6 systems, the default compiler (gcc 4.4) is too old to build Julia.

Install or contact your systems administrator to install a more recent version of gcc. The Scientific Linux Developer Toolset works well.

Linux Build Troubleshooting

Problem Possible Solution
OpenBLAS build failure Set one of the following build options in Make.user and build again:
  • OPENBLAS_TARGET_ARCH=BARCELONA (AMD CPUs) or OPENBLAS_TARGET_ARCH=NEHALEM (Intel CPUs)
      Set OPENBLAS_DYNAMIC_ARCH = 0 to disable compiling multiple architectures in a single binary.
  • OPENBLAS_NO_AVX2 = 1 disables AVX2 instructions, allowing OpenBLAS to compile with OPENBLAS_DYNAMIC_ARCH = 1 using old versions of binutils
  • USE_SYSTEM_BLAS=1 uses the system provided libblas
    • Set LIBBLAS=-lopenblas and LIBBLASNAME=libopenblas to force the use of the system provided OpenBLAS when multiple BLAS versions are installed.

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)

Illegal Instruction error Check if your CPU supports AVX while your OS does not (e.g. through virtualization, as described in this issue).

OS X

You need to have the current Xcode command line utilities installed: run xcode-select --install in the terminal. You will need to rerun this terminal command after each OS X update, otherwise you may run into errors involving missing libraries or headers. You will also need a 64-bit gfortran to compile Julia dependencies. The gfortran-4.7 (and newer) compilers in Brew, Fink, and MacPorts work for building Julia.

Clang is now used by default to build Julia on OS X 10.7 and above. On OS X 10.6, the Julia build will automatically use gcc. On current systems, we recommend that you install the command line tools as described above. Older systems do not have a separate command line tools package from Apple, and will require a full Xcode install. On these, you will need at least Xcode 4.3.3. In Xcode prior to v5.0, you can alternatively go to Preferences -> Downloads and select the Command Line Utilities. These steps will ensure that clang v3.1 is installed, which is the minimum version of clang required to build Julia.

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.

When building Julia, or its dependencies, libraries installed by third party package managers can redirect the compiler to use an incompatible version of the software it is looking for. One example of this happening is when a piece of software called the "linker" gives an error involving "Undefined symbols." If that happens, you can usually figure out what software package is causing the error from the names in the error text. This sort of error can be bypassed by, temporarily, uninstalling the offending package. If the offending package cannot be uninstalled by itself, it may be possible to just uninstall the development headers (for example: a package ending in "-dev" in Fink).

FreeBSD

Clang is the default compiler on FreeBSD 11.0-RELEASE and above. The remaining build tools are available from the Ports Collection, and can be installed using pkg install git gcc gmake cmake pkgconf. To build Julia, simply run gmake. (Note that gmake must be used rather than make, since make on FreeBSD corresponds to the incompatible BSD Make rather than GNU Make.)

As mentioned above, it is important to note that the USE_SYSTEM_* flags should be used with caution on FreeBSD. This is because many system libraries, and even libraries from the Ports Collection, link to the system's libgcc_s.so.1, or to another library which links to the system libgcc_s. This library declares its GCC version to be 4.6, which is too old to build Julia, and conflicts with other libraries when linking. Thus it is highly recommended to simply allow Julia to build all of its dependencies. If you do choose to use the USE_SYSTEM_* flags, note that /usr/local is not on the compiler path by default, so you may need to add LDFLAGS=-L/usr/local/lib and CPPFLAGS=-I/usr/local/include to your Make.user, though doing so may interfere with other dependencies.

Note that the x86 architecture does not support threading due to lack of compiler runtime library support, so you may need to set JULIA_THREADS=0 in your Make.user if you're on a 32-bit system.

Windows

In order to build Julia on Windows, see README.windows.

Vagrant

Julia can be developed in an isolated Vagrant environment. See the Vagrant README for details.

Required Build Tools and External Libraries

Building Julia requires that the following software be installed:

  • GNU make — building dependencies.
  • gcc & g++ (>= 4.7) or Clang (>= 3.1, Xcode 4.3.3 on OS X) — compiling and linking C, C++.
  • libatomic — provided by gcc and needed to support atomic operations.
  • python (>=2.7) — needed to build LLVM.
  • gfortran — compiling and linking Fortran libraries.
  • perl — preprocessing of header files of libraries.
  • wget, curl, or fetch (FreeBSD) — to automatically download external libraries.
  • m4 — needed to build GMP.
  • awk — helper tool for Makefiles.
  • patch — for modifying source code.
  • cmake (>= 3.4.3) — needed to build libgit2.
  • pkg-config — needed to build libgit2 correctly, especially for proxy support.

On Debian-based distributions (e.g. Ubuntu), you can easily install them with apt-get:

sudo apt-get install build-essential libatomic1 python gfortran perl wget m4 cmake pkg-config

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 (6.0 + patches) — compiler infrastructure (see note below).
  • FemtoLisp — packaged with Julia source, and used to implement the compiler front-end.
  • libuv (custom fork) — portable, high-performance event-based I/O library.
  • OpenLibm — portable libm library containing elementary math functions.
  • DSFMT — fast Mersenne Twister pseudorandom number generator library.
  • OpenBLAS — fast, open, and maintained basic linear algebra subprograms (BLAS) library, based on Kazushige Goto's famous GotoBLAS (see note below).
  • LAPACK (>= 3.5) — 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.
  • SuiteSparse (>= 4.1) — library of linear algebra routines for sparse matrices.
  • PCRE (>= 10.00) — Perl-compatible regular expressions library.
  • GMP (>= 5.0) — GNU multiple precision arithmetic library, needed for BigInt support.
  • MPFR (>= 4.0) — GNU multiple precision floating point library, needed for arbitrary precision floating point (BigFloat) support.
  • libgit2 (>= 0.23) — Git linkable library, used by Julia's package manager.
  • curl (>= 7.50) — libcurl provides download and proxy support for Julia's package manager.
  • libssh2 (>= 1.7) — library for SSH transport, used by libgit2 for packages with SSH remotes.
  • mbedtls (>= 2.2) — library used for cryptography and transport layer security, used by libssh2
  • utf8proc (>= 2.1) — a library for processing UTF-8 encoded Unicode strings.
  • libosxunwind — clone of libunwind, a library that determines the call-chain of a program.

Notes for distribution package maintainers

We understand that package maintainers will typically want to make use of system libraries where possible. Please refer to the above version requirements and additional notes below. It is strongly advised that package maintainers apply the patches included in the Julia repo for LLVM and other libraries, should they choose to use SYSTEM versions. A list of maintained Julia packages for various platforms is available at https://julialang.org/downloads/platform.html.

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.

LLVM

The most complicated dependency is LLVM, for which we require additional patches from upstream (LLVM is not backward compatible).

For packaging Julia with LLVM, we recommend either:

  • bundling a Julia-only LLVM library inside the Julia package, or
  • adding the patches to the LLVM package of the distribution.
    • A complete list of patches is available in deps/llvm.mk, and the patches themselves are in deps/patches/.
    • The only Julia-specific patch is the lib renaming (llvm-symver-jlprefix.patch), which should not be applied to a system LLVM.
    • The remaining patches are all upstream bug fixes, and have been contributed into upstream LLVM.

Using an unpatched or different version of LLVM will result in errors and/or poor performance. Though Julia can be built with newer LLVM versions, support for this should be regarded as experimental and not suitable for packaging.

libuv

Julia uses a custom fork of libuv. It is a small dependency, and can be safely bundled in the same package as Julia, and will not conflict with the system library. Julia builds should not try to use the system libuv.

BLAS and LAPACK

As a high-performance numerical language, Julia should be linked to a multi-threaded BLAS and LAPACK, such as OpenBLAS or ATLAS, which will provide much better performance than the reference libblas implementations which may be default on some systems.

Intel MKL

For a 64-bit architecture, the environment should be set up as follows:

# bash
source /path/to/intel/bin/compilervars.sh intel64

Add the following to the Make.user file:

USE_INTEL_MKL = 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 the Base module (part of Julia's standard library)
stdlib/        source code for other standard library packages
contrib/       editor support for Julia source, miscellaneous scripts
deps/          external dependencies
doc/src/manual source for the user manual
doc/src/stdlib source for standard library function reference
src/           source for Julia language core
test/          test suites
ui/            source for various front ends
usr/           binaries and shared libraries loaded by Julia's standard libraries

Binary Installation

If you would rather not compile the latest Julia from source, platform-specific tarballs with pre-compiled binaries are also available for download.

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 in the manual.

Note: Although some system package managers provide Julia, such installations are neither maintained nor endorsed by the Julia project. They may be outdated and/or unmaintained. We recommend you use the official Julia binaries instead.

Editor and Terminal Setup

Currently, Julia editing mode support is available for a number of editors. While Julia modes for Emacs, Sublime Text, and Vim have their own repos, others such as Textmate, Notepad++, and Kate, are in contrib/.

Two major IDEs are supported for Julia: Juno which is based on Atom and julia-vscode based on VS Code. A Jupyter notebooks interface is available through IJulia.

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 the Julia REPL for more details.