diff --git a/.travis.yml b/.travis.yml index 9f44a43f0aca86..9b326e8bf7e143 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,38 +1,33 @@ language: cpp sudo: false +dist: trusty matrix: include: - os: linux env: ARCH="i686" - compiler: "g++-5 -m32" + compiler: "g++ -m32" addons: apt: - sources: - - ubuntu-toolchain-r-test packages: + - libssl1.0.0 - bar - time - - binutils - - gcc-5 - - g++-5 - - gcc-5-multilib - - g++-5-multilib + - gcc-multilib + - g++-multilib - make:i386 - libssl-dev:i386 - - gfortran-5 - - gfortran-5-multilib + - gfortran + - gfortran-multilib - os: linux env: ARCH="x86_64" - compiler: "g++-5 -m64" + compiler: "g++ -m64" addons: apt: - sources: - - ubuntu-toolchain-r-test packages: + - libssl1.0.0 - bar - time - - g++-5 - - gfortran-5 + - gfortran - os: osx env: ARCH="x86_64" osx_image: xcode8 @@ -44,7 +39,8 @@ cache: branches: only: - master - - /release-.*/ + - /^release-.*/ + - /^v\d+\.\d+\.\d+$/ notifications: email: false irc: @@ -60,12 +56,6 @@ before_install: - make check-whitespace - if [ `uname` = "Linux" ]; then contrib/travis_fastfail.sh || exit 1; - mkdir -p $HOME/bin; - ln -s /usr/bin/gcc-5 $HOME/bin/gcc; - ln -s /usr/bin/g++-5 $HOME/bin/g++; - ln -s /usr/bin/gfortran-5 $HOME/bin/gfortran; - ln -s /usr/bin/gcc-5 $HOME/bin/x86_64-linux-gnu-gcc; - ln -s /usr/bin/g++-5 $HOME/bin/x86_64-linux-gnu-g++; gcc --version; BAR="bar -i 30"; BUILDOPTS="-j3 VERBOSE=1 FORCE_ASSERTIONS=1 LLVM_ASSERTIONS=1"; @@ -83,7 +73,7 @@ before_install: BUILDOPTS="-j3 USECLANG=1 LLVM_CONFIG=$(brew --prefix llvm39-julia)/bin/llvm-config LLVM_SIZE=$(brew --prefix llvm39-julia)/bin/llvm-size"; BUILDOPTS="$BUILDOPTS VERBOSE=1 USE_BLAS64=0 SUITESPARSE_INC=-I$(brew --prefix suite-sparse-julia)/include FORCE_ASSERTIONS=1"; BUILDOPTS="$BUILDOPTS LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas"; - for lib in LLVM SUITESPARSE ARPACK BLAS FFTW LAPACK GMP MPFR PCRE LIBUNWIND; do + for lib in LLVM SUITESPARSE ARPACK BLAS LAPACK GMP MPFR PCRE LIBUNWIND; do BUILDOPTS="$BUILDOPTS USE_SYSTEM_$lib=1"; done; export LDFLAGS="-L$(brew --prefix openblas-julia)/lib -L$(brew --prefix suite-sparse-julia)/lib"; @@ -96,6 +86,7 @@ before_install: script: - echo BUILDOPTS=$BUILDOPTS - export BUILDOPTS + # compile / install dependencies - contrib/download_cmake.sh - make -C moreutils mispipe - make $BUILDOPTS -C base version_git.jl.phony @@ -113,6 +104,7 @@ script: cat deps.log; echo "-- end of deps build log -----------------------------------------------"; false; } + # compile / install Julia - make $BUILDOPTS NO_GIT=1 prefix=/tmp/julia install | moreutils/ts -s "%.s" - make $BUILDOPTS NO_GIT=1 build-stats - du -sk /tmp/julia/* @@ -122,14 +114,25 @@ script: done; fi - cd .. && mv julia julia2 + # run tests - /tmp/julia/bin/julia --precompiled=no -e 'true' && /tmp/julia/bin/julia-debug --precompiled=no -e 'true' - /tmp/julia/bin/julia -e 'versioninfo()' + - pushd /tmp/julia/share/julia/test - export JULIA_CPU_CORES=2 && export JULIA_TEST_MAXRSS_MB=600 && - cd /tmp/julia/share/julia/test && /tmp/julia/bin/julia --check-bounds=yes runtests.jl $TESTSTORUN && - /tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online pkg - - cd `dirname $TRAVIS_BUILD_DIR` && mv julia2 julia && + /tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online download pkg + - popd + # test that the embedding code works on our installation + - mkdir /tmp/embedding-test && + make check -C /tmp/julia/share/doc/julia/examples/embedding \ + JULIA="DYLD_FALLBACK_LIBRARY_PATH='$DYLD_FALLBACK_LIBRARY_PATH' /tmp/julia/bin/julia" \ + BIN=/tmp/embedding-test \ + "$(cd julia2 && make print-CC)" + # restore initial state and prepare for travis caching + - mv julia2 julia && rm -f julia/deps/scratch/libgit2-*/CMakeFiles/CMakeOutput.log # uncomment the following if failures are suspected to be due to the out-of-memory killer # - dmesg +after_success: + - cd julia && make -C doc deploy diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4a050793693b88..ff4654ebf21a10 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,10 @@ # Notes for Julia Contributors -Hi! If you are new to the Julia community: welcome, and thanks for trying Julia. Please be sure to respect our [community standards](http://julialang.org/community/standards/) in all interactions. +Hi! If you are new to the Julia community: welcome, and thanks for trying Julia. Please be sure to respect our [community standards](https://julialang.org/community/standards) in all interactions. ## Learning Julia -[The learning page](http://julialang.org/learning/) has a great list of resources for new and experienced users alike. [This tutorial video](https://www.youtube.com/watch?v=vWkgEddb4-A) is one recommended starting point, as is the "[Invitation to Julia](https://www.youtube.com/watch?v=gQ1y5NUD_RI)" workshop video from JuliaCon 2015 ([slide materials here](https://github.com/dpsanders/invitation_to_julia)). The [Julia documentation](http://docs.Julialang.org/en/latest/) covers the language and core library features, and is [searchable](http://docs.Julialang.org/en/latest/search/). (note: Javascript required). +[The learning page](https://julialang.org/learning) has a great list of resources for new and experienced users alike. [This tutorial video](https://www.youtube.com/watch?v=vWkgEddb4-A) is one recommended starting point, as is the "[Invitation to Julia](https://www.youtube.com/watch?v=gQ1y5NUD_RI)" workshop video from JuliaCon 2015 ([slide materials here](https://github.com/dpsanders/invitation_to_julia)). The [Julia documentation](https://docs.julialang.org/en/latest) covers the language and core library features, and is searchable. ## Before filing an issue @@ -12,7 +12,7 @@ Hi! If you are new to the Julia community: welcome, and thanks for trying Julia. - Contributing code? Be sure to review the [contributor checklist](https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#contributor-checklist) for helpful tips on the tools we use to build Julia. -- Library feature requests are generally not accepted on this issue tracker. New libraries should be developed as [packages](http://docs.julialang.org/en/release-0.4/manual/packages/#package-development). Discuss ideas for libraries at the [Julia Discourse forum](https://discourse.julialang.org/). Doing so will often lead to pointers to existing projects and bring together collaborators with common interests. +- Library feature requests are generally not accepted on this issue tracker. New libraries should be developed as [packages](https://docs.julialang.org/en/latest/manual/packages#Package-Development-1). Discuss ideas for libraries at the [Julia Discourse forum](https://discourse.julialang.org). Doing so will often lead to pointers to existing projects and bring together collaborators with common interests. ## Contributor Checklist @@ -26,7 +26,7 @@ Hi! If you are new to the Julia community: welcome, and thanks for trying Julia. * Learn to use [git](http://git-scm.com), the version control system used by GitHub and the Julia project. Try a tutorial such as the one [provided by GitHub](http://try.GitHub.io/levels/1/challenges/1). -* Review discussions on the [Julia Discourse forum](https://discourse.julialang.org/). +* Review discussions on the [Julia Discourse forum](https://discourse.julialang.org). * For more detailed tips, read the [submission guide](https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#submitting-contributions) below. @@ -37,26 +37,26 @@ Hi! If you are new to the Julia community: welcome, and thanks for trying Julia. A useful bug report filed as a GitHub issue provides information about how to reproduce the error. 1. Before opening a new [GitHub issue](https://github.com/JuliaLang/julia/issues): - - Try searching the existing issues or the [Julia Discourse forum](https://discourse.julialang.org/) to see if someone else has already noticed the same problem. + - Try searching the existing issues or the [Julia Discourse forum](https://discourse.julialang.org) to see if someone else has already noticed the same problem. - Try some simple debugging techniques to help isolate the problem. - Try running the code with the debug build of Julia with `make debug`, which produces the `usr/bin/julia-debug`. - Consider running `julia-debug` with a debugger such as `gdb` or `lldb`. Obtaining even a simple [backtrace](http://www.unknownroad.com/rtfm/gdbtut/gdbsegfault.html) is very useful. - - If Julia segfaults, try following [these debugging tips](http://julia.readthedocs.org/en/latest/devdocs/backtraces/#segfaults-during-bootstrap-sysimg-jl) to help track down the specific origin of the bug. + - If Julia segfaults, try following [these debugging tips](https://docs.julialang.org/en/latest/devdocs/backtraces.html#Reporting-and-analyzing-crashes-(segfaults)-1) to help track down the specific origin of the bug. 2. If the problem is caused by a Julia package rather than core Julia, file a bug report with the relevant package author rather than here. 3. When filing a bug report, provide where possible: - The full error message, including the backtrace. - A minimal working example, i.e. the smallest chunk of code that triggers the error. Ideally, this should be code that can be pasted into a REPL or run from a source file. If the code is larger than (say) 50 lines, consider putting it in a [gist](https://gist.github.com). - - The version of Julia as provided by the `versioninfo()` command. Occasionally, the longer output produced by `versioninfo(true)` may be useful also, especially if the issue is related to a specific package. + - The version of Julia as provided by the `versioninfo()` command. Occasionally, the longer output produced by `versioninfo(verbose = true)` may be useful also, especially if the issue is related to a specific package. -4. When pasting code blocks or output, put triple backquotes (\`\`\`) around the text so GitHub will format it nicely. Code statements should be surrounded by single backquotes (\`). Be aware that the `@` sign tags users on GitHub, so references to macros should always be in single backquotes. See [GitHub's guide on Markdown](https://guides.github.com/features/mastering-markdown/) for more formatting tricks. +4. When pasting code blocks or output, put triple backquotes (\`\`\`) around the text so GitHub will format it nicely. Code statements should be surrounded by single backquotes (\`). Be aware that the `@` sign tags users on GitHub, so references to macros should always be in single backquotes. See [GitHub's guide on Markdown](https://guides.github.com/features/mastering-markdown) for more formatting tricks. ## Submitting contributions ### Contributing a Julia package -Julia has a built-in [package manager](https://github.com/JuliaLang/METADATA.jl) based on `git`. A number of [packages](http://pkg.julialang.org/) across many domains are already available for Julia. Developers are encouraged to provide their libraries as a Julia package. The Julia manual provides instructions on [creating Julia packages](http://docs.julialang.org/en/latest/manual/packages/). +Julia has a built-in [package manager](https://github.com/JuliaLang/METADATA.jl) based on `git`. A number of [packages](http://pkg.julialang.org) across many domains are already available for Julia. Developers are encouraged to provide their libraries as a Julia package. The Julia manual provides instructions on [creating Julia packages](https://docs.julialang.org/en/latest/manual/packages). For developers who need to wrap C libraries so that they can be called from Julia, the [Clang.jl](https://github.com/ihnorton/Clang.jl) package can help generate the wrappers automatically from the C header files. @@ -71,7 +71,7 @@ to port your package to latest Julia release. However, porting a package to the latest release may cause the package to break on earlier Julia releases. To maintain compatibility across releases, use -[`Compat.jl`](https://github.com/JuliaLang/Compat.jl/). Find the fix for your package +[`Compat.jl`](https://github.com/JuliaLang/Compat.jl). Find the fix for your package from the README, and specify the minimum version of Compat that provides the fix in your REQUIRE file. To find the correct minimum version, refer to [this guide](https://github.com/JuliaLang/Compat.jl/#tagging-the-correct-minimum-version-of-compat). @@ -84,7 +84,7 @@ There are never enough tests. Track [code coverage at Coveralls](https://coveral 2. Browse through the source files and find some untested functionality (highlighted in red) that you think you might be able to write a test for. -3. Write a test that exercises this functionality---you can add your test to one of the existing files, or start a new one, whichever seems most appropriate to you. If you're adding a new test file, make sure you include it in the list of tests in `test/choosetests.jl`. http://julia.readthedocs.org/en/latest/stdlib/test/ may be helpful in explaining how the testing infrastructure works. +3. Write a test that exercises this functionality---you can add your test to one of the existing files, or start a new one, whichever seems most appropriate to you. If you're adding a new test file, make sure you include it in the list of tests in `test/choosetests.jl`. https://docs.julialang.org/en/latest/stdlib/test may be helpful in explaining how the testing infrastructure works. 4. Run `make test-all` to rebuild Julia and run your new test(s). If you had to fix a bug or add functionality in `base`, this will ensure that your test passes and that you have not introduced extraneous whitespace. @@ -112,7 +112,7 @@ from Julia's root directory. This will rebuild the Julia system image, then inst > > When making changes to any of Julia's documentation it is recommended that you run `make docs` to check the your changes are valid and do not produce any errors before opening a pull request. -Below are outlined the three most common types of documentation changes and the steps required to perform them. Please note that the following instructions do not cover the full range of features provided by Documenter.jl. Refer to [Documenter's documentation](https://juliadocs.github.io/Documenter.jl/stable/) if you encounter anything that is not covered by the sections below. +Below are outlined the three most common types of documentation changes and the steps required to perform them. Please note that the following instructions do not cover the full range of features provided by Documenter.jl. Refer to [Documenter's documentation](https://juliadocs.github.io/Documenter.jl/stable) if you encounter anything that is not covered by the sections below. #### Modifying files in `doc/src/` @@ -182,7 +182,7 @@ Examples written within docstrings can be used as testcases known as "doctests" "DOCSTRING TEST" ``` -A doctest needs to match an interactive REPL including the `julia>` prompt. To run doctests you need to run `make -C doc check` from the root directory. +A doctest needs to match an interactive REPL including the `julia>` prompt. To run doctests you need to run `make -C doc check` from the root directory. It is recommended to add the header `# Examples` above the doctests. #### News-worthy changes @@ -194,7 +194,7 @@ For new functionality and other substantial changes, add a brief summary to `NEW The Julia community uses [GitHub issues](https://github.com/JuliaLang/julia/issues) to track and discuss problems, feature requests, and pull requests (PR). You can make pull requests for incomplete features to get code review. The convention is to prefix the pull request title with "WIP:" for Work In Progress, or "RFC:" for Request for Comments when work is completed and ready for merging. This will prevent accidental merging of work that is in progress. -Note: These instructions are for adding to or improving functionality in the base library. Before getting started, it can be helpful to discuss the proposed changes or additions on the [Julia Discourse forum](https://discourse.julialang.org/) or in a GitHub issue---it's possible your proposed change belongs in a package rather than the core language. Also, keep in mind that changing stuff in the base can potentially break a lot of things. Finally, because of the time required to build Julia, note that it's usually faster to develop your code in stand-alone files, get it working, and then migrate it into the base libraries. +Note: These instructions are for adding to or improving functionality in the base library. Before getting started, it can be helpful to discuss the proposed changes or additions on the [Julia Discourse forum](https://discourse.julialang.org) or in a GitHub issue---it's possible your proposed change belongs in a package rather than the core language. Also, keep in mind that changing stuff in the base can potentially break a lot of things. Finally, because of the time required to build Julia, note that it's usually faster to develop your code in stand-alone files, get it working, and then migrate it into the base libraries. Add new code to Julia's base libraries as follows: @@ -216,7 +216,7 @@ or with the `runtests.jl` script, e.g. to run `test/bitarray.jl` and `test/math. ./usr/bin/julia test/runtests.jl bitarray math -Make sure that [Travis](http://www.travis-ci.org) greenlights the pull request with a [`Good to merge` message](http://blog.travis-ci.com/2012-09-04-pull-requests-just-got-even-more-awesome/). +Make sure that [Travis](http://www.travis-ci.org) greenlights the pull request with a [`Good to merge` message](http://blog.travis-ci.com/2012-09-04-pull-requests-just-got-even-more-awesome). ### Code Formatting Guidelines @@ -262,22 +262,22 @@ Make sure that [Travis](http://www.travis-ci.org) greenlights the pull request w ## Resources * Julia - - **Homepage:** - - **Community:** + - **Homepage:** + - **Community:** - **IRC:** - **Source code:** - **Git clone URL:** - - **Documentation:** + - **Documentation:** - **Status:** - **Code coverage:** * Design of Julia - [Julia: A Fresh Approach to Numerical Computing](http://arxiv.org/pdf/1411.1607v3.pdf) - - [Julia: A Fast Dynamic Language for Technical Computing](http://julialang.org/images/julia-dynamic-2012-tr.pdf) - - [All Julia Publications](http://julialang.org/publications/) + - [Julia: A Fast Dynamic Language for Technical Computing](https://julialang.org/images/julia-dynamic-2012-tr.pdf) + - [All Julia Publications](https://julialang.org/publications) * Using GitHub - [Using Julia with GitHub (video)](http://www.youtube.com/watch?v=wnFYV3ZKtOg&feature=youtu.be) - [Using Julia on GitHub (notes for video)](https://gist.github.com/2712118#file_Julia_git_pull_request.md) - - [General GitHub documentation](http://help.github.com/) - - [GitHub pull request documentation](http://help.github.com/send-pull-requests/) + - [General GitHub documentation](http://help.github.com) + - [GitHub pull request documentation](http://help.github.com/send-pull-requests) diff --git a/DISTRIBUTING.md b/DISTRIBUTING.md index cdceecb728e30b..2d0e6916e2037f 100644 --- a/DISTRIBUTING.md +++ b/DISTRIBUTING.md @@ -12,9 +12,8 @@ separated most of the notes by OS. Note that while the code for Julia is [MIT-licensed, with a few exceptions](https://github.com/JuliaLang/julia/blob/master/LICENSE.md), the distribution created by the techniques described herein will be -GPL licensed, as various dependent libraries such as `FFTW` and -`SuiteSparse` are GPL licensed. We do hope to have a -non-GPL distribution of Julia in the future. +GPL licensed, as various dependent libraries such as `SuiteSparse` are +GPL licensed. We do hope to have a non-GPL distribution of Julia in the future. Versioning and Git ------------------ diff --git a/HISTORY.md b/HISTORY.md index 03c5a849cd5c20..64383dcfaa848c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -51,7 +51,7 @@ Experimental language features ------------------------------ * Support for - [multi-threading](http://docs.julialang.org/en/latest/manual/parallel-computing/#multi-threading-experimental). + [multi-threading](https://docs.julialang.org/en/latest/manual/parallel-computing/#multi-threading-experimental). Loops with independent iterations can be easily parallelized with the `Threads.@threads` macro. @@ -453,7 +453,7 @@ Deprecated or removed * `@unix_only` is deprecated in favor of `if is_unix()` * `@osx_only` is deprecated in favor of `if is_apple()` * `@linux_only` is deprecated in favor of `if is_linux()` - * NOTE: Using `@static` could be useful/necessary when used in a function's local scope. See details at the section entitled [Handling Operating System Variation](http://docs.julialang.org/en/latest/manual/handling-operating-system-variation/#man-handling-operating-system-variation) in the manual. + * NOTE: Using `@static` could be useful/necessary when used in a function's local scope. See details at the section entitled [Handling Operating System Variation](https://docs.julialang.org/en/latest/manual/handling-operating-system-variation/#man-handling-operating-system-variation) in the manual. Command-line option changes --------------------------- @@ -510,7 +510,7 @@ New language features types instead of to their values. The function then returns an expression forming the body of the function to be called at run time ([#7311]). - * [Documentation system](http://docs.julialang.org/en/latest/manual/documentation/) + * [Documentation system](https://docs.julialang.org/en/latest/manual/documentation/) for functions, methods, types and macros in packages and user code ([#8791]). * The syntax `function foo end` can be used to introduce a generic function without @@ -540,11 +540,11 @@ New language features * `++` is now parsed as an infix operator, but does not yet have a default definition ([#11030], [#11686]). * Support for inter-task communication using `Channels` ([#12264]). - See http://docs.julialang.org/en/latest/manual/parallel-computing/#channels for details. + See https://docs.julialang.org/en/latest/manual/parallel-computing/#channels for details. * `RemoteRef`s now point to remote channels. The remote channels can be of length greater than 1. Default continues to be of length 1 ([#12385]). - See http://docs.julialang.org/en/latest/manual/parallel-computing/#remoterefs-and-abstractchannels for details. + See https://docs.julialang.org/en/latest/manual/parallel-computing/#remoterefs-and-abstractchannels for details. * `@__LINE__` special macro now available to reflect invocation source line number ([#12727]). @@ -1745,8 +1745,8 @@ Bugfixes and performance updates Too numerous to mention. -[packages chapter]: http://docs.julialang.org/en/latest/manual/packages/ -[sorting functions]: http://docs.julialang.org/en/latest/stdlib/sort/ +[packages chapter]: https://docs.julialang.org/en/latest/manual/packages/ +[sorting functions]: https://docs.julialang.org/en/latest/stdlib/sort/ [pairwise summation]: https://en.wikipedia.org/wiki/Pairwise_summation [a448e080]: https://github.com/JuliaLang/julia/commit/a448e080dc736c7fb326426dfcb2528be36973d3 [5e3f074b]: https://github.com/JuliaLang/julia/commit/5e3f074b9173044a0a4219f9b285879ff7cec041 diff --git a/LICENSE.md b/LICENSE.md index c81b1ef7ea7f4a..b906f655a58173 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -35,6 +35,7 @@ Julia includes code from the following projects, which have their own licenses: - [MUSL](http://git.musl-libc.org/cgit/musl/tree/COPYRIGHT) (for getopt implementation on Windows) [MIT] - [MINGW](https://sourceforge.net/p/mingw/mingw-org-wsl/ci/legacy/tree/mingwrt/mingwex/dirname.c) (for dirname implementation on Windows) [MIT] - [NetBSD](http://www.netbsd.org/about/redistribution.html) (for setjmp, longjmp, and strptime implementations on Windows) [BSD-3] +- [Python](https://docs.python.org/2/license.html) (for strtod implementation on Windows) [BSD-3, effectively] - [randmtzig.c](https://github.com/JuliaLang/julia/blob/master/test/perf/micro/randmtzig.c) for Gaussian random number generation (for C benchmarks only) [BSD-3] The Julia language links to the following external libraries, which have their @@ -55,7 +56,6 @@ their own licenses: - [OPENLIBM](https://github.com/JuliaLang/openlibm/blob/master/LICENSE.md) [MIT, BSD-2, ISC] - [OPENSPECFUN](https://github.com/JuliaLang/openspecfun) [MIT, public domain] - [FADDEEVA](http://ab-initio.mit.edu/Faddeeva) [MIT] -- [FFTW](http://fftw.org/doc/License-and-Copyright.html) [GPL2+] - [GMP](http://gmplib.org/manual/Copying.html#Copying) [LGPL3+ or GPL2+] - [LIBGIT2](https://github.com/libgit2/libgit2/blob/development/COPYING) [GPL2+ with unlimited linking exception] - [CURL](https://curl.haxx.se/docs/copyright.html) [MIT/X derivative] @@ -70,10 +70,11 @@ their own licenses: The following components of Julia's standard library have separate licenses: -- base/fftw.jl (see [FFTW](http://fftw.org/doc/License-and-Copyright.html)) -- base/linalg/umfpack.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html)) -- base/linalg/cholmod.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html)) -- base/special/exp.jl (see [FREEBSD MSUN](https://github.com/freebsd/freebsd) [FreeBSD/2-clause BSD/Simplified BSD License]) +- base/grisu/* (see [double-conversion](https://github.com/google/double-conversion/blob/master/LICENSE)) +- base/sparse/umfpack.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html)) +- base/sparse/cholmod.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html)) +- base/special/exp.jl (see [FDLIBM](http://www.netlib.org/fdlibm/e_exp.c) [Freely distributable with preserved copyright notice]) +- base/special/rem_pio2.jl (see [FDLIBM](http://www.netlib.org/fdlibm/e_rem_pio2.c) [Freely distributable with preserved copyright notice]) Julia's build process uses the following external tools: diff --git a/Make.inc b/Make.inc index abad5fe879cce6..cf80fc05746fd9 100644 --- a/Make.inc +++ b/Make.inc @@ -1,4 +1,5 @@ # -*- mode: makefile-gmake -*- +# vi:syntax=make ## Note: ## It is generally preferable to change these options, for @@ -25,6 +26,7 @@ OPENBLAS_USE_THREAD:=1 # Use libraries available on the system instead of building them USE_SYSTEM_LLVM:=0 USE_SYSTEM_LIBUNWIND:=0 +DISABLE_LIBUNWIND:=0 USE_SYSTEM_PCRE:=0 USE_SYSTEM_LIBM:=0 USE_SYSTEM_OPENLIBM:=0 @@ -33,7 +35,6 @@ USE_SYSTEM_OPENSPECFUN:=0 USE_SYSTEM_DSFMT:=0 USE_SYSTEM_BLAS:=0 USE_SYSTEM_LAPACK:=0 -USE_SYSTEM_FFTW:=0 USE_SYSTEM_GMP:=0 USE_SYSTEM_MPFR:=0 USE_SYSTEM_ARPACK:=0 @@ -52,8 +53,6 @@ USE_LLVM_SHLIB := 1 ## Settings for various Intel tools # Set to 1 to use MKL USE_INTEL_MKL ?= 0 -# Set to 1 to use MKL FFT -USE_INTEL_MKL_FFT ?= 0 # Set to 1 to use Intel LIBM USE_INTEL_LIBM ?= 0 # Set to 1 to enable profiling with Intel VTune Amplifier @@ -177,7 +176,7 @@ endif USE_GPL_LIBS ?= 1 # Directories where said libraries get installed to -prefix ?= $(abspath julia-$(JULIA_COMMIT)) +prefix ?= $(BUILDROOT)/julia-$(JULIA_COMMIT) bindir := $(prefix)/bin libdir := $(prefix)/lib libexecdir := $(prefix)/libexec @@ -230,14 +229,16 @@ INSTALL_M := $(JULIAHOME)/contrib/install.sh 755 LLVMROOT := $(build_prefix) LLVM_ASSERTIONS := 0 LLVM_DEBUG := 0 -#LLVM_USE_CMAKE: defined in deps/llvm-ver.mk as it depends on LLVM_VER_SHORT # set to 1 to get clang and compiler-rt BUILD_LLVM_CLANG := 0 # set to 1 to get lldb (often does not work, no chance with llvm3.2 and earlier) # see http://lldb.llvm.org/build.html for dependencies BUILD_LLDB := 0 + +# Options to enable Polly and its code-generation options USE_POLLY := 0 -USE_POLLY_OPENMP := 0 +USE_POLLY_OPENMP := 0 # Enable OpenMP code-generation +USE_POLLY_ACC := 0 # Enable GPU code-generation # Cross-compile #XC_HOST := i686-w64-mingw32 @@ -316,9 +317,13 @@ JULIACODEGEN := LLVM # flag for disabling assertions ifeq ($(FORCE_ASSERTIONS), 1) +# C++ code needs to include LLVM header with the same assertion flag as LLVM +# Use this flag to re-enable assertion in our code after all the LLVM headers are included +CXX_DISABLE_ASSERTION := DISABLE_ASSERTIONS := else -DISABLE_ASSERTIONS := -DNDEBUG +CXX_DISABLE_ASSERTION := -DJL_NDEBUG +DISABLE_ASSERTIONS := -DNDEBUG -DJL_NDEBUG endif # Compiler specific stuff @@ -515,6 +520,33 @@ ifeq (exists, $(shell [ -e $(BUILDROOT)/Make.user ] && echo exists )) include $(BUILDROOT)/Make.user endif +# A bit of a kludge to work around libraries linking to FreeBSD's outdated system libgcc_s +# Instead, let's link to the libgcc_s corresponding to the installation of gfortran +ifeq ($(OS),FreeBSD) +ifneq (,$(findstring gfortran,$(FC))) + +# First let's figure out what version of GCC we're dealing with +_GCCMAJOR := $(shell $(FC) -dumpversion | cut -d'.' -f1) +_GCCMINOR := $(shell $(FC) -dumpversion | cut -d'.' -f2) + +# The ports system uses major and minor for GCC < 5 (e.g. gcc49 for GCC 4.9), otherwise major only +ifeq ($(_GCCMAJOR),4) + _GCCVER := $(_GCCMAJOR)$(_GCCMINOR) +else + _GCCVER := $(_GCCMAJOR) +endif + +# Allow the user to specify this in Make.user +GCCPATH ?= $(LOCALBASE)/lib/gcc$(_GCCVER) + +LDFLAGS += -L$(build_libdir) -L$(GCCPATH) -Wl,-rpath,$(build_libdir) -Wl,-rpath,$(GCCPATH) + +# This ensures we get the right RPATH even if we're missing FFLAGS somewhere +FC += -Wl,-rpath=$(GCCPATH) + +endif # gfortran +endif # FreeBSD + ifneq ($(CC_BASE)$(CXX_BASE),$(shell echo $(CC) | cut -d' ' -f1)$(shell echo $(CXX) | cut -d' ' -f1)) $(error Forgot override directive on CC or CXX in Make.user? Cowardly refusing to build) endif @@ -529,12 +561,7 @@ SANITIZE_LDFLAGS := -fsanitize=address endif JCXXFLAGS += $(SANITIZE_OPTS) JCFLAGS += $(SANITIZE_OPTS) -LDFLAGS += $(SANITIZE_LDFLAGS) -# FIXME: sanitizing all dependencies doesn't work because of -Wl,--no-undefined -# https://github.com/JuliaLang/julia/issues/13858 -# use LLVM_SANITIZE to sanitize LLVM -#DEPS_CFLAGS += $(SANITIZE_OPTS) -#DEPS_CXXFLAGS += $(SANITIZE_OPTS) +JLDFLAGS += $(SANITIZE_LDFLAGS) endif TAR := $(shell which gtar 2>/dev/null || which tar 2>/dev/null) @@ -656,6 +683,7 @@ ifneq (,$(filter $(ARCH), powerpc64le ppc64le)) JCFLAGS += -fsigned-char OPENBLAS_DYNAMIC_ARCH:=0 OPENBLAS_TARGET_ARCH:=POWER8 +BINARY:=64 # GCC doesn't do -march= on ppc64le MARCH= endif @@ -732,6 +760,8 @@ endif ifeq ($(OS),WINNT) LIBUNWIND:= +else ifneq ($(DISABLE_LIBUNWIND), 0) +LIBUNWIND:= else ifeq ($(USE_SYSTEM_LIBUNWIND), 1) ifneq ($(OS),Darwin) @@ -827,14 +857,6 @@ LIBLAPACKNAME := liblapack endif endif -ifeq ($(OS), WINNT) -LIBFFTWNAME := libfftw3 -LIBFFTWFNAME := libfftw3f -else -LIBFFTWNAME := libfftw3_threads -LIBFFTWFNAME := libfftw3f_threads -endif - ifeq ($(USE_SYSTEM_LIBM), 1) LIBM := -lm LIBMNAME := libm @@ -934,7 +956,16 @@ endif ifeq ($(OS), FreeBSD) JLDFLAGS := -Wl,-Bdynamic -OSLIBS += -lelf -lkvm -lrt -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) +OSLIBS += -lelf -lkvm -lrt + +# Tweak order of libgcc_s in DT_NEEDED, +# make it loaded first to +# prevent from linking to outdated system libs. +# See #21788 +OSLIBS += -lgcc_s + +OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \ + $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) endif ifeq ($(OS), Darwin) @@ -980,6 +1011,10 @@ ifeq ($(USE_OPROFILE_JITEVENTS), 1) JCPPFLAGS += -DJL_USE_OPROFILE_JITEVENTS endif +ifeq ($(DISABLE_LIBUNWIND), 1) +JCPPFLAGS += -DJL_DISABLE_LIBUNWIND +endif + # Intel libraries ifeq ($(USE_INTEL_LIBM), 1) @@ -997,9 +1032,16 @@ MKLLIB := $(MKLROOT)/lib/ia32 endif USE_SYSTEM_BLAS:=1 USE_SYSTEM_LAPACK:=1 +ifeq ($(OS), WINNT) +LIBBLASNAME := mkl_rt +LIBLAPACKNAME := mkl_rt +# work around libtool issue with arpack +MKL_LDFLAGS := -L$(MKLLIB) -Wl,-lmkl_rt +else LIBBLASNAME := libmkl_rt LIBLAPACKNAME := libmkl_rt MKL_LDFLAGS := -L$(MKLLIB) -lmkl_rt +endif ifneq ($(strip $(MKLLIB)),) ifeq ($(OS), Linux) RPATH_MKL := -Wl,-rpath,$(MKLLIB) @@ -1011,12 +1053,6 @@ LIBBLAS := $(MKL_LDFLAGS) LIBLAPACK := $(MKL_LDFLAGS) endif -ifeq ($(USE_INTEL_MKL_FFT), 1) -USE_SYSTEM_FFTW := 1 -LIBFFTWNAME := libmkl_rt -LIBFFTWFNAME := libmkl_rt -endif - ifeq ($(HAVE_SSP),1) JCPPFLAGS += -DHAVE_SSP=1 ifeq ($(USEGCC),1) @@ -1057,8 +1093,14 @@ endif # Custom libcxx ifeq ($(BUILD_CUSTOM_LIBCXX),1) LDFLAGS += -L$(build_libdir) -CXXLDFLAGS += -L$(build_libdir) -lc++abi -stdlib=libc++ -lc++ -CPPFLAGS += -I$(build_includedir)/c++/v1 +CXXLDFLAGS += -L$(build_libdir) -lc++abi -lc++ +ifeq ($(USECLANG),1) +CXXLDFLAGS += -stdlib=libc++ +else +ifeq ($(USEGCC),1) +$(error BUILD_CUSTOM_LIBCXX is currently only supported with Clang. Try setting BUILD_CUSTOM_LIBCXX=0) +endif +endif # Clang CUSTOM_LD_LIBRARY_PATH := LD_LIBRARY_PATH="$(build_libdir)" ifeq ($(USEICC),1) CXXFLAGS += -cxxlib-nostd -static-intel diff --git a/Makefile b/Makefile index 0e28cc87b7628e..05b08bed94a49b 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ all: debug release # sort is used to remove potential duplicates DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_man1dir)) ifneq ($(BUILDROOT),$(JULIAHOME)) -BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps test test/perf) +BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps test test/perf examples examples/embedding) BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) DIRS := $(DIRS) $(BUILDDIRS) $(BUILDDIRMAKE): | $(BUILDDIRS) @@ -62,12 +62,16 @@ $(BUILDROOT)/doc/_build/html/en/index.html: $(shell find $(BUILDROOT)/base $(BUI CLEAN_TARGETS += clean-docdir clean-docdir: @-rm -fr $(abspath $(build_docdir)) -$(build_prefix)/.examples: $(wildcard $(JULIAHOME)/examples/*.jl) $(shell find $(JULIAHOME)/examples/clustermanager) + +$(build_prefix)/.examples: $(wildcard $(JULIAHOME)/examples/*.jl) \ + $(shell find $(JULIAHOME)/examples/clustermanager) \ + $(shell find $(JULIAHOME)/examples/embedding) @echo Copying in usr/share/doc/julia/examples @-rm -fr $(build_docdir)/examples @mkdir -p $(build_docdir)/examples @cp -R $(JULIAHOME)/examples/*.jl $(build_docdir)/examples/ @cp -R $(JULIAHOME)/examples/clustermanager $(build_docdir)/examples/ + @cp -R $(JULIAHOME)/examples/embedding $(build_docdir)/examples @echo 1 > $@ julia-symlink: julia-ui-$(JULIA_BUILD_MODE) @@ -151,7 +155,7 @@ release-candidate: release testall @echo 6. Clean out old .tar.gz files living in deps/, "\`git clean -fdx\`" seems to work #"` @echo 7. Replace github release tarball with tarballs created from make light-source-dist and make full-source-dist @echo 8. Follow packaging instructions in DISTRIBUTING.md to create binary packages for all platforms - @echo 9. Upload to AWS, update http://julialang.org/downloads and http://status.julialang.org/stable links + @echo 9. Upload to AWS, update https://julialang.org/downloads and http://status.julialang.org/stable links @echo 10. Update checksums on AWS for tarball and packaged binaries @echo 11. Announce on mailing lists @echo 12. Change master to release-0.X in base/version.jl and base/version_git.sh as in 4cb1e20 @@ -182,6 +186,7 @@ $(build_private_libdir)/%.$(SHLIB_EXT): $(build_private_libdir)/%.o CORE_SRCS := $(addprefix $(JULIAHOME)/, \ base/boot.jl base/coreimg.jl \ + base/docs/core.jl \ base/abstractarray.jl \ base/array.jl \ base/bool.jl \ @@ -241,11 +246,6 @@ JL_PRIVATE_LIBS := ccalltest ifeq ($(USE_GPL_LIBS), 1) JL_PRIVATE_LIBS += suitesparse_wrapper endif -ifeq ($(USE_SYSTEM_FFTW),0) -ifeq ($(USE_GPL_LIBS), 1) -JL_PRIVATE_LIBS += fftw3 fftw3f fftw3_threads fftw3f_threads -endif -endif ifeq ($(USE_SYSTEM_PCRE),0) JL_PRIVATE_LIBS += pcre endif @@ -323,6 +323,7 @@ $(eval $(call std_dll,gcc_s_seh-1)) endif $(eval $(call std_dll,ssp-0)) $(eval $(call std_dll,winpthread-1)) +$(eval $(call std_dll,atomic-1)) endif define stringreplace $(build_depsbindir)/stringreplace $$(strings -t x - $1 | grep '$2' | awk '{print $$1;}') '$3' 255 "$(call cygpath_w,$1)" @@ -330,7 +331,7 @@ endef install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html @$(MAKE) $(QUIET_MAKE) all - @for subdir in $(bindir) $(libexecdir) $(datarootdir)/julia/site/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir); do \ + @for subdir in $(bindir) $(datarootdir)/julia/site/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir); do \ mkdir -p $(DESTDIR)$$subdir; \ done @@ -341,10 +342,8 @@ ifeq ($(OS),WINNT) -$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/ -$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/ else - -cp -a $(build_libexecdir) $(DESTDIR)$(prefix) - - # Copy over .dSYM directories directly ifeq ($(OS),Darwin) + # Copy over .dSYM directories directly -cp -a $(build_libdir)/*.dSYM $(DESTDIR)$(libdir) -cp -a $(build_private_libdir)/*.dSYM $(DESTDIR)$(private_libdir) endif @@ -401,9 +400,9 @@ ifneq ($(private_libdir_rel),$(build_private_libdir_rel)) ifeq ($(OS), Darwin) for julia in $(DESTDIR)$(bindir)/julia* ; do \ install_name_tool -rpath @executable_path/$(build_private_libdir_rel) @executable_path/$(private_libdir_rel) $$julia; \ - install_name_tool -rpath @executable_path/$(build_libdir_rel) @executable_path/$(libdir_rel) $$julia; \ + install_name_tool -add_rpath @executable_path/$(build_libdir_rel) @executable_path/$(libdir_rel) $$julia; \ done -else ifeq ($(OS), Linux) +else ifneq (,$(findstring $(OS),Linux FreeBSD)) for julia in $(DESTDIR)$(bindir)/julia* ; do \ patchelf --set-rpath '$$ORIGIN/$(private_libdir_rel):$$ORIGIN/$(libdir_rel)' $$julia; \ done @@ -458,7 +457,7 @@ endif ifeq ($(OS), WINNT) [ ! -d $(JULIAHOME)/dist-extras ] || ( cd $(JULIAHOME)/dist-extras && \ - cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll libgfortran-3.dll libquadmath-0.dll libstdc++-6.dll libgcc_s_s*-1.dll libssp-0.dll libwinpthread-1.dll $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin ) + cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin ) ifeq ($(USE_GPL_LIBS), 1) [ ! -d $(JULIAHOME)/dist-extras ] || ( cd $(JULIAHOME)/dist-extras && \ cp busybox.exe $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin ) @@ -480,8 +479,10 @@ else endif rm -fr $(BUILDROOT)/julia-$(JULIA_COMMIT) -# this target does not accept BUILDROOT -light-source-dist.tmp: $(JULIAHOME)/doc/_build/html +light-source-dist.tmp: $(BUILDROOT)/doc/_build/html/en/index.html +ifneq ($(BUILDROOT),$(JULIAHOME)) + $(error make light-source-dist does not work in out-of-tree builds) +endif # Save git information -@$(MAKE) -C $(JULIAHOME)/base version_git.jl.phony @@ -491,18 +492,16 @@ light-source-dist.tmp: $(JULIAHOME)/doc/_build/html find doc/_build/html >> light-source-dist.tmp # Make tarball with only Julia code -# this target does not accept BUILDROOT light-source-dist: light-source-dist.tmp # Prefix everything with the current directory name (usually "julia"), then create tarball DIRNAME=$$(basename $$(pwd)); \ sed -e "s_.*_$$DIRNAME/&_" light-source-dist.tmp > light-source-dist.tmp1; \ - cd ../ && tar -cz -T $$DIRNAME/light-source-dist.tmp1 --no-recursion -f $$DIRNAME/julia-$(JULIA_VERSION)_$(JULIA_COMMIT).tar.gz + cd ../ && tar -cz --no-recursion -T $$DIRNAME/light-source-dist.tmp1 -f $$DIRNAME/julia-$(JULIA_VERSION)_$(JULIA_COMMIT).tar.gz source-dist: @echo \'source-dist\' target is deprecated: use \'full-source-dist\' instead. # Make tarball with Julia code plus all dependencies -# this target does not accept BUILDROOT full-source-dist: light-source-dist.tmp # Get all the dependencies downloaded @$(MAKE) -C deps getall NO_GIT=1 @@ -514,7 +513,7 @@ full-source-dist: light-source-dist.tmp # Prefix everything with the current directory name (usually "julia"), then create tarball DIRNAME=$$(basename $$(pwd)); \ sed -e "s_.*_$$DIRNAME/&_" full-source-dist.tmp > full-source-dist.tmp1; \ - cd ../ && tar -cz -T $$DIRNAME/full-source-dist.tmp1 --no-recursion -f $$DIRNAME/julia-$(JULIA_VERSION)_$(JULIA_COMMIT)-full.tar.gz + cd ../ && tar -cz --no-recursion -T $$DIRNAME/full-source-dist.tmp1 -f $$DIRNAME/julia-$(JULIA_VERSION)_$(JULIA_COMMIT)-full.tar.gz clean: | $(CLEAN_TARGETS) @-$(MAKE) -C $(BUILDROOT)/base clean @@ -522,6 +521,7 @@ clean: | $(CLEAN_TARGETS) @-$(MAKE) -C $(BUILDROOT)/src clean @-$(MAKE) -C $(BUILDROOT)/ui clean @-$(MAKE) -C $(BUILDROOT)/test clean + @-$(MAKE) -C $(BUILDROOT)/examples clean -rm -f $(BUILDROOT)/julia -rm -f $(BUILDROOT)/*.tar.gz -rm -f $(build_depsbindir)/stringreplace \ @@ -548,13 +548,18 @@ distcleanall: cleanall test testall testall1 test clean distcleanall cleanall clean-* \ run-julia run-julia-debug run-julia-release run \ install binary-dist light-source-dist.tmp light-source-dist \ - dist full-source-dist source-dist + dist full-source-dist source-dist examples test: check-whitespace $(JULIA_BUILD_MODE) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test default JULIA_BUILD_MODE=$(JULIA_BUILD_MODE) +ifeq ($(JULIA_BUILD_MODE),release) +JULIA_SYSIMG=$(build_private_libdir)/sys$(JULIA_LIBSUFFIX).$(SHLIB_EXT) +else +JULIA_SYSIMG=$(build_private_libdir)/sys-$(JULIA_BUILD_MODE)$(JULIA_LIBSUFFIX).$(SHLIB_EXT) +endif testall: check-whitespace $(JULIA_BUILD_MODE) - cp $(build_private_libdir)/sys$(JULIA_LIBSUFFIX).$(SHLIB_EXT) $(BUILDROOT)/local.$(SHLIB_EXT) && $(JULIA_EXECUTABLE) -J $(call cygpath_w,$(BUILDROOT)/local.$(SHLIB_EXT)) -e 'true' && rm $(BUILDROOT)/local.$(SHLIB_EXT) + cp $(JULIA_SYSIMG) $(BUILDROOT)/local.$(SHLIB_EXT) && $(JULIA_EXECUTABLE) -J $(call cygpath_w,$(BUILDROOT)/local.$(SHLIB_EXT)) -e 'true' && rm $(BUILDROOT)/local.$(SHLIB_EXT) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test all JULIA_BUILD_MODE=$(JULIA_BUILD_MODE) testall1: check-whitespace $(JULIA_BUILD_MODE) @@ -582,8 +587,8 @@ ifneq (,$(filter $(ARCH), i386 i486 i586 i686)) cd $(JULIAHOME)/dist-extras && \ $(JLDOWNLOAD) http://downloads.sourceforge.net/sevenzip/7z920.exe && \ 7z x -y 7z920.exe 7z.exe 7z.dll && \ - ../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_42.2 \ - "mingw32-libgfortran3 mingw32-libquadmath0 mingw32-libstdc++6 mingw32-libgcc_s_sjlj1 mingw32-libssp0 mingw32-libwinpthread1 mingw32-libexpat1 mingw32-zlib1" && \ + ../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2 \ + "mingw32-libexpat1 mingw32-zlib1" && \ cp usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll . else ifeq ($(ARCH),x86_64) cd $(JULIAHOME)/dist-extras && \ @@ -591,15 +596,15 @@ else ifeq ($(ARCH),x86_64) 7z x -y 7z920-x64.msi _7z.exe _7z.dll && \ mv _7z.dll 7z.dll && \ mv _7z.exe 7z.exe && \ - ../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_42.2 \ - "mingw64-libgfortran3 mingw64-libquadmath0 mingw64-libstdc++6 mingw64-libgcc_s_seh1 mingw64-libssp0 mingw64-libwinpthread1 mingw64-libexpat1 mingw64-zlib1" && \ + ../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2 \ + "mingw64-libexpat1 mingw64-zlib1" && \ cp usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll . else $(error no win-extras target for ARCH=$(ARCH)) endif cd $(JULIAHOME)/dist-extras && \ $(JLDOWNLOAD) http://downloads.sourceforge.net/sevenzip/7z920_extra.7z && \ - $(JLDOWNLOAD) https://unsis.googlecode.com/files/nsis-2.46.5-Unicode-setup.exe && \ + $(JLDOWNLOAD) https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/unsis/nsis-2.46.5-Unicode-setup.exe && \ chmod a+x 7z.exe && \ chmod a+x 7z.dll && \ $(call spawn,./7z.exe) x -y -onsis nsis-2.46.5-Unicode-setup.exe && \ @@ -618,7 +623,9 @@ LLVM_SIZE := $(build_depsbindir)/llvm-size$(EXE) endif build-stats: @echo $(JULCOLOR)' ==> ./julia binary sizes'$(ENDCOLOR) - $(call spawn,$(LLVM_SIZE) -A $(build_private_libdir)/sys.$(SHLIB_EXT) $(build_shlibdir)/libjulia.$(SHLIB_EXT) $(build_bindir)/julia$(EXE)) + $(call spawn,$(LLVM_SIZE) -A $(call cygpath_w,$(build_private_libdir)/sys.$(SHLIB_EXT)) \ + $(call cygpath_w,$(build_shlibdir)/libjulia.$(SHLIB_EXT)) \ + $(call cygpath_w,$(build_bindir)/julia$(EXE))) @echo $(JULCOLOR)' ==> ./julia launch speedtest'$(ENDCOLOR) @time $(call spawn,$(build_bindir)/julia$(EXE) -e '') @time $(call spawn,$(build_bindir)/julia$(EXE) -e '') diff --git a/NEWS.md b/NEWS.md index 0ec5525ed9f2bd..7e461a30be6a32 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,245 @@ +Julia v0.7.0 Release Notes +========================== + +New language features +--------------------- + + * Local variables can be tested for being defined + using the new `@isdefined variable` macro ([#22281]). + +Language changes +---------------- + + * The syntax for parametric methods, `function f{T}(x::T)`, has been + changed to `function f(x::T) where {T}` ([#11310]). + + * The syntax `1.+2` is deprecated, since it is ambiguous: it could mean either + `1 .+ 2` (the current meaning) or `1. + 2` ([#19089]). + + * In string and character literals, backslash `\` may no longer + precede unrecognized escape characters ([#22800]). + + * Declaring arguments as `x::ANY` to avoid specialization has been replaced + by `@nospecialize x`. ([#22666]). + + * Keyword argument default values are now evaluated in successive scopes --- + the scope for each expression includes only previous keyword arguments, in + left-to-right order ([#17240]). + + * The parsing of `1<<2*3` as `1<<(2*3)` is deprecated, and will change to + `(1<<2)*3` in a future version ([#13079]). + + * `{ }` expressions now use `braces` and `bracescat` as expression heads instead + of `cell1d` and `cell2d`, and parse similarly to `vect` and `vcat` ([#8470]). + +Breaking changes +---------------- + +This section lists changes that do not have deprecation warnings. + + * `ntuple(f, n::Integer)` throws `ArgumentError` if `n` is negative. + Previously an empty tuple was returned ([#21697]). + + * Juxtaposing string literals (e.g. `"x"y`) is now a syntax error ([#20575]). + + * `@__DIR__` returns the current working directory rather than `nothing` when not run + from a file ([#21759]). + + * `@__FILE__` and `@__DIR__` return information relative to the file that it was parsed from, + rather than from the task-local `SOURCE_PATH` global when it was expanded. + + * All macros receive an extra argument `__source__::LineNumberNode` which describes the + parser location in the source file for the `@` of the macro call. + It can be accessed as a normal argument variable in the body of the macro. + This is implemented by inserting an extra leading argument into the + `Expr(:macrocall, :@name, LineNumberNode(...), args...)` + surface syntax. ([#21746]) + + * Passing the same keyword argument multiple times is now a syntax error ([#16937]). + + * `getsockname` on a `TCPSocket` now returns the locally bound address and port + of the socket. Previously the address of the remote endpoint was being + returned ([#21825]). + + * Using `ARGS` within the ~/.juliarc.jl or within a .jl file loaded with `--load` will no + longer contain the script name as the first argument. Instead the script name will be + assigned to `PROGRAM_FILE`. ([#22092]) + + * The format for a `ClusterManager` specifying the cookie on the command line is now + `--worker=`. `--worker ` will not work as it is now an optional argument. + + * The representation of `CartesianRange` has changed to a + tuple-of-AbstractUnitRanges; the `start` and `stop` fields are no + longer present. Use `first(R)` and `last(R)` to obtain + start/stop. ([#20974]) + + * The `Diagonal` type definition has changed from `Diagonal{T}` to + `Diagonal{T,V<:AbstractVector{T}}` ([#22718]). + + * Spaces are no longer allowed between `@` and the name of a macro in a macro call ([#22868]). + + * Juxtaposition of a non-literal with a macro call (`x@macro`) is no longer valid syntax ([#22868]). + + * On a cluster, all files are now loaded from the local file system rather than node 1 ([#22588]). + To load the same file everywhere from node 1, one possible alternative is to broadcast a call to `include_string`: + `@everywhere include_string(Main, $(read("filename", String)), "filename")`. + Improving upon this API is left as an opportunity for packages. + + * `randperm(n)` and `randcycle(n)` now always return a `Vector{Int}` (independent of + the type of `n`). Use the corresponding mutating functions `randperm!` and `randcycle!` + to control the array type ([#22723]). + + * Worker-worker connections are setup lazily for an `:all_to_all` topology. Use keyword + arg `lazy=false` to force all connections to be setup during a `addprocs` call. ([#22814]) + +Library improvements +-------------------- + + * The functions `strip`, `lstrip` and `rstrip` now return `SubString` ([#22496]). + + * The functions `base` and `digits` digits now accept a negative + base (like `ndigits` did) ([#21692]). + + * The function `randn` now accepts complex arguments (`Complex{T <: AbstractFloat}`) + ([#21973]). + + * The function `rand` can now pick up random elements from strings, associatives + and sets ([#22228], [#21960], [#18155], [#22224]). + + * Method lists are now printed as a numbered list. In addition, the source code of a + method can be opened in an editor by entering the corresponding number in the REPL + and pressing `^Q` ([#22007]). + + * `getpeername` on a `TCPSocket` returns the address and port of the remote + endpoint of the TCP connection ([#21825]). + + * `resize!` and `sizehint!` methods no longer over-reserve memory when the + requested array size is more than double of its current size ([#22038]). + + * The `crc32c` function for CRC-32c checksums is now exported ([#22274]). + + * The output of `versioninfo()` is now controlled with keyword arguments ([#21974]). + + * The function `LibGit2.set_remote_url` now always sets both the fetch and push URLs for a + git repo. Additionally, the argument order was changed to be consistent with the git + command line tool ([#22062]). + + * `logspace` now accepts a `base` keyword argument to specify the base of the logarithmic + range. The base defaults to 10 ([#22310]). + + * Added `unique!` which is an inplace version of `unique` ([#20549]). + + * `@test isequal(x, y)` and `@test isapprox(x, y)` now prints an evaluated expression when + the test fails ([#22296]). + + * Uses of `Val{c}` in `Base` has been replaced with `Val{c}()`, which is now easily + accessible via the `@pure` constructor `Val(c)`. Functions are defined as + `f(::Val{c}) = ...` and called by `f(Val(c))`. Notable affected functions include: + `ntuple`, `Base.literal_pow`, `sqrtm`, `lufact`, `lufact!`, `qrfact`, `qrfact!`, + `cholfact`, `cholfact!`, `_broadcast!`, `reshape`, `cat` and `cat_t`. + + * A new `@macroexpand1` macro for non recursive macro expansion ([#21662]). + + * `Char`s can now be concatenated with `String`s and/or other `Char`s using `*` ([#22532]). + + * `Diagonal` is now parameterized on the type of the wrapped vector. This allows + for `Diagonal` matrices with arbitrary `AbstractVector`s ([#22718]). + + * Mutating versions of `randperm` and `randcycle` have been added: + `randperm!` and `randcycle!` ([#22723]). + +Compiler/Runtime improvements +----------------------------- + + * The inlining heuristic now models the approximate runtime cost of + a method (using some strongly-simplifying assumptions). Functions + are inlined unless their estimated runtime cost substantially + exceeds the cost of setting up and issuing a subroutine + call. ([#22210], [#22732]) + +Deprecated or removed +--------------------- + + * The keyword `immutable` is fully deprecated to `struct`, and + `type` is fully deprecated to `mutable struct` ([#19157], [#20418]). + + * The method `srand(rng, filename, n=4)` has been deprecated ([#21359]). + + * The `cholfact`/`cholfact!` methods that accepted an `uplo` symbol have been deprecated + in favor of using `Hermitian` (or `Symmetric`) views ([#22187], [#22188]). + + * `isposdef(A::AbstractMatrix, UL::Symbol)` and `isposdef!(A::AbstractMatrix, UL::Symbol)` + have been deprecated in favor of `isposdef(Hermitian(A, UL))` and `isposdef!(Hermitian(A, UL))` + respectively ([#22245]). + + * The `bkfact`/`bkfact!` methods that accepted `uplo` and `issymmetric` symbols have been deprecated + in favor of using `Hermitian` (or `Symmetric`) views ([#22605]). + + * The function `current_module` is deprecated and replaced with `@__MODULE__` ([#22064]). + This caused the deprecation of some reflection methods (such as `macroexpand` and `isconst`), + which now require a module argument. + And it caused the bugfix of other default arguments to use the Main module (including `whos`, `which`). + + * The `Operators` module is deprecated. Instead, import required operators explicitly + from `Base`, e.g. `import Base: +, -, *, /` ([#22251]). + + * Bindings to the FFTW library have been removed from Base. The DFT framework for building FFT + implementations is now in AbstractFFTs.jl, the bindings to the FFTW library are in FFTW.jl, + and the Base signal processing functions which used FFTs are now in DSP.jl ([#21956]). + + * The `corrected` positional argument to `cov` has been deprecated in favor of + a keyword argument with the same name ([#21709]). + + * Omitting spaces around the `?` and the `:` tokens in a ternary expression has been deprecated. + Ternaries must now include some amount of whitespace, e.g. `x ? a : b` rather than + `x?a:b` ([#22523] and [#22712]). + + * `?` can no longer be used as an identifier name ([#22712]) + + * The method `replace(s::AbstractString, pat, r, count)` with `count <= 0` is deprecated + in favor of `replace(s::AbstractString, pat, r, typemax(Int))` ([#22325]). + + * `read(io, type, dims)` is deprecated to `read!(io, Array{type}(dims))` ([#21450]). + + * `read(::IO, ::Ref)` is now a method of `read!`, since it mutates its `Ref` argument ([#21592]). + + * `Bidiagonal` constructors now use a `Symbol` (`:U` or `:L`) for the upper/lower + argument, instead of a `Bool` or a `Char` ([#22703]). + + * Calling `nfields` on a type to find out how many fields its instances have is deprecated. + Use `fieldcount` instead. Use `nfields` only to get the number of fields in a specific object ([#22350]). + + * `fieldnames` now operates only on types. To get the names of fields in an object, use + `fieldnames(typeof(x))` ([#22350]). + + * `InexactError` and `DomainError` now take + arguments. `InexactError(func::Symbol, type, -3)` now prints as + `ERROR: InexactError: func(type, -3)`, and `DomainError(val, + [msg])` prints as `ERROR: DomainError with val:\nmsg`. ([#20005], + [#22751]) + + * The operating system identification functions: `is_linux`, `is_bsd`, `is_apple`, `is_unix`, + and `is_windows`, have been deprecated in favor of `Sys.islinux`, `Sys.isbsd`, `Sys.isapple`, + `Sys.isunix`, and `Sys.iswindows`, respectively ([#22182]). + + * The forms of `read`, `readstring`, and `eachline` that accepted both a `Cmd` object and an + input stream are deprecated. Use e.g. `read(pipeline(stdin, cmd))` instead ([#22762]). + + * The unexported type `AbstractIOBuffer` has been renamed to `GenericIOBuffer` ([#17360] [#22796]). + + * The method `String(io::IOBuffer)` is deprecated to `String(take!(copy(io)))` ([#21438]). + + * The function `readstring` is deprecated in favor of `read(io, String)` ([#22793]) + + * The function `showall` is deprecated. Showing entire values is the default, unless an + `IOContext` specifying `:limit=>true` is in use ([#22847]). + + * `issubtype` has been deprecated in favor of `<:` (which used to be an alias for `issubtype`). + + * Calling `write` on non-isbits arrays is deprecated in favor of explicit loops or + `serialize` ([#6466]). + + Julia v0.6.0 Release Notes ========================== @@ -5,18 +247,22 @@ New language features --------------------- * New type system capabilities ([#8974], [#18457]) - * Type parameter constraints can refer to previous parameters, e.g. + + + Type parameter constraints can refer to previous parameters, e.g. `type Foo{R<:Real, A<:AbstractArray{R}}`. Can also be used in method definitions. - * New syntax `Array{T} where T<:Integer`, indicating a union of types over all + + + New syntax `Array{T} where T<:Integer`, indicating a union of types over all specified values of `T` (represented by a `UnionAll` type). This provides behavior similar to parametric methods or `typealias`, but can be used anywhere a type is accepted. This syntax can also be used in method definitions, e.g. `function inv(M::Matrix{T}) where T<:AbstractFloat`. Anonymous functions can have type parameters via the syntax `((x::Array{T}) where T<:Real) -> 2x`. - * Implicit type parameters, e.g. `Vector{<:Real}` is equivalent to + + + Implicit type parameters, e.g. `Vector{<:Real}` is equivalent to `Vector{T} where T<:Real`, and similarly for `Vector{>:Int}` ([#20414]). - * Much more accurate subtype and type intersection algorithms. Method sorting and + + + Much more accurate subtype and type intersection algorithms. Method sorting and identification of equivalent and ambiguous methods are improved as a result. Language changes @@ -32,13 +278,19 @@ Language changes ``` the syntax `Foo(x) = new(x)` actually defined a constructor for `Foo{T,S}`, i.e. the case where the type parameters are specified. For clarity, this - definition now must be written as `Foo{T,S}(x) where {T,S<:Real} = new(x)`. ([#11310]) + definition now must be written as `Foo{T,S}(x) where {T,S<:Real} = new(x)` + ([#11310], [#20308]). * The keywords used to define types have changed ([#19157], [#20418]). + + `immutable` changes to `struct` + + `type` changes to `mutable struct` + + `abstract` changes to `abstract type ... end` + + `bitstype 32 Char` changes to `primitive type Char 32 end` + In 0.6, `immutable` and `type` are still allowed as synonyms without a deprecation warning. @@ -46,16 +298,16 @@ Language changes nonstandard command literal is like a nonstandard string literal, but the syntax uses backquotes (``` ` ```) instead of double quotes, and the resulting macro called is suffixed with `_cmd`. For instance, the syntax - ``` q`xyz` ``` is equivalent to `@q_cmd "xyz"`. ([#18644]) + ``` q`xyz` ``` is equivalent to `@q_cmd "xyz"` ([#18644]). * Nonstandard string and command literals can now be qualified with their module. For instance, `Base.r"x"` is now parsed as `Base.@r_str "x"`. - Previously, this syntax parsed as an implicit multiplication. ([#18690]) + Previously, this syntax parsed as an implicit multiplication ([#18690]). * For every binary operator `⨳`, `a .⨳ b` is now automatically equivalent to the `broadcast` call `(⨳).(a, b)`. Hence, one no longer defines methods for `.*` etcetera. This also means that "dot operations" automatically - fuse into a single loop, along with other dot calls `f.(x)`. ([#17623]) + fuse into a single loop, along with other dot calls `f.(x)` ([#17623]). Similarly for unary operators ([#20249]). * Newly defined methods are no longer callable from the same dynamic runtime @@ -68,16 +320,15 @@ Language changes every function call, operator, and assignment in an expression ([#20321]). * The identifier `_` can be assigned, but accessing its value is deprecated, - allowing this syntax to be used in the future for discarding values ([#9343], [#18251]). + allowing this syntax to be used in the future for discarding values ([#9343], + [#18251], [#20328]). * The `typealias` keyword is deprecated, and should be replaced with - `Vector{T} = Array{T,1}` or a `const` assignment. + `Vector{T} = Array{T,1}` or a `const` assignment ([#20500]). * Experimental feature: `x^n` for integer literals `n` (e.g. `x^3` - or `x^-3`) is now lowered to `x^Val{n}`, to enable compile-time - specialization for literal integer exponents ([#20530]). - `x^p` for `x::Number` and a literal `p=0,1,2,3` is now lowered to - `one(x)`, `x`, `x*x`, and `x*x*x`, respectively ([#20648]). + or `x^-3`) is now lowered to `Base.literal_pow(^, x, Val{n})`, to enable + compile-time specialization for literal integer exponents ([#20530], [#20889]). Breaking changes ---------------- @@ -86,16 +337,16 @@ This section lists changes that do not have deprecation warnings. * `readline`, `readlines` and `eachline` return lines without line endings by default. You *must* use `readline(s, chomp=false)`, etc. to get the old behavior where - returned lines include trailing end-of-line character(s). ([#19944]) + returned lines include trailing end-of-line character(s) ([#19944]). * `String`s no longer have a `.data` field (as part of a significant performance improvement). Use `Vector{UInt8}(str)` to access a string as a byte array. However, allocating the `Vector` object has overhead. You can also use `codeunit(str, i)` to access the `i`th byte of a `String`. Use `sizeof(str)` instead of `length(str.data)`, and `pointer(str)` instead of - `pointer(str.data)`. ([#19449]) + `pointer(str.data)` ([#19449]). - * Operations between `Float16` and `Integers` now return `Float16` instead of `Float32`. ([#17261]) + * Operations between `Float16` and `Integers` now return `Float16` instead of `Float32` ([#17261]). * Keyword arguments are processed left-to-right: if the same keyword is specified more than once, the rightmost occurrence takes precedence ([#17785]). @@ -112,22 +363,23 @@ This section lists changes that do not have deprecation warnings. `broadcast!` or `.=` ([#17623]). * Operations like `.+` and `.*` on `Range` objects are now generic - `broadcast` calls (see above) and produce an `Array`. If you want - a `Range` result, use `+` and `*`, etcetera ([#17623]). + `broadcast` calls (see [above](#language-changes)) and produce an `Array`. + If you want a `Range` result, use `+` and `*`, etcetera ([#17623]). * `broadcast` now treats `Ref` (except for `Ptr`) arguments as 0-dimensional arrays ([#18965]). * `broadcast` now handles missing data (`Nullable`s) allowing operations to be lifted over mixtures of `Nullable`s and scalars, as if the `Nullable` - were like an array with zero or one element. ([#16961], [#19787]). + were like an array with zero or one element ([#16961], [#19787]). * The runtime now enforces when new method definitions can take effect ([#17057]). The flip-side of this is that new method definitions should now reliably actually take effect, and be called when evaluating new code ([#265]). - * The array-scalar operations `div`, `mod`, `rem`, `&`, `|`, `xor`, `/`, `\`, `*`, `+`, and `-` - now follow broadcast promotion rules ([#19692]). + * The array-scalar methods of `/`, `\`, `*`, `+`, and `-` now follow broadcast promotion + rules. (Likewise for the now-deprecated array-scalar methods of `div`, `mod`, `rem`, + `&`, `|`, and `xor`; see "Deprecated or removed" below.) ([#19692]). * `broadcast!(f, A)` now calls `f()` for each element of `A`, rather than doing `fill!(A, f())` ([#19722]). @@ -135,19 +387,19 @@ This section lists changes that do not have deprecation warnings. removed before `waitfor` seconds. With a `waitfor=0`, `rmprocs` returns immediately without waiting for worker exits. - * `quadgk` has been moved from Base into a separate package. ([#19741]) + * `quadgk` has been moved from Base into a separate package ([#19741]). * The `Collections` module has been removed, and all functions defined therein have been - moved to the `DataStructures` package. ([#19800]) + moved to the `DataStructures` package ([#19800]). * The `RepString` type has been moved to the [LegacyStrings.jl package](https://github.com/JuliaArchive/LegacyStrings.jl). * In macro calls with parentheses, e.g. `@m(a=1)`, assignments are now parsed as - `=` expressions, instead of as `kw` expressions. ([#7669]) + `=` expressions, instead of as `kw` expressions ([#7669]). * When used as an infix operator, `~` is now parsed as a call to an ordinary operator - with assignment precedence, instead of as a macro call. ([#20406]) + with assignment precedence, instead of as a macro call ([#20406]). * (µ "micro" and ɛ "latin epsilon") are considered equivalent to the corresponding Greek characters in identifiers. `\varepsilon` @@ -155,17 +407,17 @@ This section lists changes that do not have deprecation warnings. * `retry` now inputs the keyword arguments `delays` and `check` instead of `n` and `max_delay`. The previous functionality can be achieved setting - `delays` to `ExponentialBackOff`. ([#19331]) + `delays` to `ExponentialBackOff` ([#19331]). * `transpose(::AbstractVector)` now always returns a `RowVector` view of the input (which is a special 1×n-sized `AbstractMatrix`), not a `Matrix`, etc. In particular, for - `v::AbstractVector` we now have `(v.').' === v` and `v.' * v` is a scalar. ([#19670]) + `v::AbstractVector` we now have `(v.').' === v` and `v.' * v` is a scalar ([#19670]). * Parametric types with "unspecified" parameters, such as `Array`, are now represented as `UnionAll` types instead of `DataType`s ([#18457]). * `Union` types have two fields, `a` and `b`, instead of a single `types` field. - The empty type `Union{}` is represented by a singleton of type `BottomType` ([#18457]). + The empty type `Union{}` is represented by a singleton of type `TypeofBottom` ([#18457]). * The type `NTuple{N}` now refers to tuples where every element has the same type (since it is shorthand for `NTuple{N,T} where T`). To get the old behavior of matching @@ -203,30 +455,70 @@ This section lists changes that do not have deprecation warnings. * The `count` function no longer sums non-boolean values ([#20404]) + * The generic `getindex(::AbstractString, ::AbstractVector)` method's signature has been + tightened to `getindex(::AbstractString, ::AbstractVector{<:Integer})`. Consequently, + indexing into `AbstractString`s with non-`AbstractVector{<:Integer}` `AbstractVector`s + now throws a `MethodError` in the absence of an appropriate specialization. + (Previously such cases failed less explicitly with the exception of + `AbstractVector{Bool}`, which now throws an `ArgumentError` noting that + logical indexing into strings is not supported.) ([#20248]) + * Bessel, Hankel, Airy, error, Dawson, eta, zeta, digamma, inverse digamma, trigamma, and polygamma special functions have been moved from Base to the [SpecialFunctions.jl package](https://github.com/JuliaMath/SpecialFunctions.jl) - ([#20427]). + ([#20427]). Note that `airy`, `airyx` and `airyprime` have been deprecated + in favor of more specific functions (`airyai`, `airybi`, `airyaiprime`, + `airybiprimex`, `airyaix`, `airybix`, `airyaiprimex`, `airybiprimex`) + ([#18050]). + + * When a macro is called in the module in which that macro is defined, global variables + in the macro are now correctly resolved in the macro definition environment. Breakage + from this change commonly manifests as undefined variable errors that do not occur + under 0.5. Fixing such breakage typically requires sprinkling additional `esc`s in + the offending macro ([#15850]). * `write` on an `IOBuffer` now returns a signed integer in order to be consistent with other buffers ([#20609]). + * The `<:Integer` division fallback `/(::Integer, ::Integer)`, which formerly + inappropriately took precedence over other division methods for some + mixed-integer-type division calls, has been removed ([#19779]). + + * `@async`, `@spawn`, `@spawnat`, `@fetch` and `@fetchfrom` no longer implicitly + localize variables. Previously, the expression would be wrapped in an implicit + `let` block ([#19594]). + + * `parse` no longer accepts IPv4 addresses including leading zeros, octal, or hexadecimal. + Convert IPv4 addresses including octal or hexadecimal to decimal, and remove leading + zeros in decimal addresses ([#19811]). + + * Closures shipped for remote execution via `@spawn` or `remotecall` now automatically + serialize globals defined under Main. For details, please refer to the paragraph + on "Global variables" under the "Parallel computing" chapter in the manual ([#19594]). + + * `homedir` now determines the user's home directory via `libuv`'s `uv_os_homedir`, + rather than from environment variables ([#19636]). + + * Workers now listen on an ephemeral port assigned by the OS. Previously workers would + listen on the first free port available from 9009 ([#21818]). + + Library improvements -------------------- - * `@views` macro to convert a whole expression or block of code to + * A new `@views` macro was added to convert a whole expression or block of code to use views for all slices ([#20164]). - * `max`, `min`, and related functions (`minmax`, `maximum`, `minimum`, - `extrema`) now return `NaN` for `NaN` arguments ([#12563]). + * `max`, `min`, and related functions (`minmax`, `maximum`, `minimum`, `extrema`) + now return `NaN` for `NaN` arguments ([#12563]). - * `oneunit(x)` function to return a dimensionful version of `one(x)` (which - is clarified to mean a dimensionless quantity if `x` is dimensionful) ([#20268]). + * `oneunit(x)` function to return a dimensionful version of `one(x)` + (which is clarified to mean a dimensionless quantity if `x` is dimensionful) ([#20268]). * The `chop` and `chomp` functions now return a `SubString` ([#18339]). - * Numbered stackframes printed in stacktraces can be opened in an editor by + * Numbered stackframes printed in stacktraces can now be opened in an editor by entering the corresponding number in the REPL and pressing `^Q` ([#19680]). * The REPL now supports something called *prompt pasting* ([#17599]). @@ -236,22 +528,28 @@ Library improvements without having to scrub away prompts and outputs. This can be disabled or enabled at will with `Base.REPL.enable_promptpaste(::Bool)`. - * The function `print_with_color` can now take a color represented by an integer between 0 and 255 inclusive as its first argument ([#18473]). - For a number to color mapping please refer to [this chart](https://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg). + * The function `print_with_color` can now take a color + represented by an integer between 0 and 255 inclusive + as its first argument ([#18473]). For a number-to-color mapping, please refer to + [this chart](https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg). It is also possible to use numbers as colors in environment variables that customizes colors in the REPL. For example, to get orange warning messages, simply set `ENV["JULIA_WARN_COLOR"] = 208`. Please note that not all terminals support 256 colors. * The function `print_with_color` no longer prints text in bold by default ([#18628]). - Instead, the function now take a keyword argument `bold::Bool` which determines whether to print in bold or not. - On some terminals, printing a color in non bold results in slightly darker colors being printed than when printing in bold. + Instead, the function now take a keyword argument `bold::Bool` + which determines whether to print in bold or not. On some terminals, printing a color in non bold + results in slightly darker colors being printed than when printing in bold. Therefore, light versions of the colors are now supported. For the available colors see the help entry on `print_with_color`. * The default text style for REPL input and answers has been changed from bold to normal ([#11250]). - They can be changed back to bold by setting the environment variables `JULIA_INPUT_COLOR` and `JULIA_ANSWER_COLOR` to `"bold"`. - For example, one way of doing this is adding `ENV["JULIA_INPUT_COLOR"] = :bold` and `ENV["JULIA_ANSWER_COLOR"] = :bold` to the `.juliarc.jl` file. - See the [manual section on customizing colors](http://docs.julialang.org/en/latest/manual/interacting-with-julia#Customizing-Colors-1) for more information. + They can be changed back to bold by setting the environment variables + `JULIA_INPUT_COLOR` and `JULIA_ANSWER_COLOR` to `"bold"`. + For example, one way of doing this is adding `ENV["JULIA_INPUT_COLOR"] = :bold` + and `ENV["JULIA_ANSWER_COLOR"] = :bold` to the `.juliarc.jl` file. See the + [manual section on customizing colors](https://docs.julialang.org/en/latest/manual/interacting-with-julia#Customizing-Colors-1) + for more information. * The default color for info messages has been changed from blue to cyan ([#18442]), and for warning messages from red to yellow ([#18453]). This @@ -269,61 +567,122 @@ Library improvements you can now do e.g. `[A I]` and it will concatenate an appropriately sized identity matrix ([#19305]). - * New `accumulate` and `accumulate!` functions, which generalize `cumsum` and - `cumprod`. Also known as a [scan](https://en.wikipedia.org/wiki/Prefix_sum) - operation ([#18931]). + * New `accumulate` and `accumulate!` functions were added, which generalize `cumsum` and `cumprod`. + Also known as a [scan](https://en.wikipedia.org/wiki/Prefix_sum) operation ([#18931]). * `reshape` now allows specifying one dimension with a `Colon()` (`:`) for the new shape, in which case that dimension's length will be computed such that its product with all the other dimensions is equal to the length of the original array ([#19919]). - * New `titlecase` function, which capitalizes the first character of each word within a string ([#19469]). + * The new `to_indices` function provides a uniform interface for index conversions, + taking an array and a tuple of indices as arguments and returning a tuple of + integers and/or arrays of supported scalar indices. It will throw an `ArgumentError` + for any unsupported indices, and the returned arrays should be iterated over (and + not indexed into) to support more efficient logical indexing ([#19730]). + + + Using colons (`:`) to represent a collection of indices is deprecated. They now must be + explicitly converted to a specialized array of integers with the `to_indices` function. +    As a result, the type of `SubArray`s that represent views over colon indices has changed. + + + Logical indexing is now more efficient. Logical arrays are converted by `to_indices` to + a lazy, iterable collection of indices that doesn't support indexing. A deprecation + provides indexing support with O(n) lookup. + + + The performance of indexing with `CartesianIndex`es is also improved in many situations. + + * A new `titlecase` function was added, to capitalize the first character of each word within a string ([#19469]). * `any` and `all` now always short-circuit, and `mapreduce` never short-circuits ([#19543]). That is, not every member of the input iterable will be visited if a `true` (in the case of `any`) or `false` (in the case of `all`) value is found, and `mapreduce` will visit all members of the iterable. - * Additional methods for `ones` and `zeros` functions to support the same signature as the `similar` function ([#19635]). + * Additional methods for `ones` and `zeros` functions were added + to support the same signature as the `similar` function ([#19635]). * `count` now has a `count(itr)` method equivalent to `count(identity, itr)` ([#20403]). - * Methods for `map` and `filter` with `Nullable` arguments have been - implemented; the semantics are as if the `Nullable` were a container with - zero or one elements ([#16961]). + * Methods for `map` and `filter` with `Nullable` arguments have been implemented; + the semantics are as if the `Nullable` were a container with zero or one elements ([#16961]). - * New `@test_warn` and `@test_nowarn` macros in the `Base.Test` module to + * New `@test_warn` and `@test_nowarn` macros were added in the `Base.Test` module to test for the presence or absence of warning messages ([#19903]). - * `logging` can be used to redirect `info`, `warn`, and `error` messages + * `logging` can now be used to redirect `info`, `warn`, and `error` messages either universally or on a per-module/function basis ([#16213]). - * New `iszero(x)` function to quickly check whether `x` is zero (or is all zeros, for an array) ([#19950]). + * New function `Base.invokelatest(f, args...)` to call the latest version + of a function in circumstances where an older version may be called + instead (e.g. in a function calling `eval`) ([#19784]). + + * A new `iszero(x)` function was added, to quickly check whether `x` is zero + (or is all zeros, for an array) ([#19950]). * `notify` now returns a count of tasks woken up ([#19841]). - * New nonstandard string literal `raw"..."` for creating strings - with no interpolation or unescaping ([#19900]). + * A new nonstandard string literal `raw"..."` was added, + for creating strings with no interpolation or unescaping ([#19900]). + + * A new `Dates.Time` type was added that supports representing the time of day + with up to nanosecond resolution ([#12274]). + + * Raising one or negative one to a negative integer power formerly threw a `DomainError`. + One raised to any negative integer power now yields one, negative one raised to any + negative even integer power now yields one, and negative one raised to any negative + odd integer power now yields negative one. Similarly, raising `true` to any negative + integer power now yields `true` rather than throwing a `DomainError` ([#18342]). - * A new `Dates.Time` type was added that supports representing the time of day with up to nanosecond resolution ([#12274]). + * A new `@macroexpand` macro was added as a convenient alternative to the `macroexpand` function ([#18660]). - * New `@macroexpand` macro as a convenient alternative to the `macroexpand` function ([#18660]). + * `invoke` now supports keyword arguments ([#20345]). - * Introduced a wrapper type for lazy complex conjugation of arrays, `ConjArray`. + * A new `ConjArray` type was added, as a wrapper type for lazy complex conjugation of arrays. Currently, it is used by default for the new `RowVector` type only, and enforces that both `transpose(vec)` and `ctranspose(vec)` are views not copies ([#20047]). + * `rem` now accepts a `RoundingMode` argument via `rem(x, y, r::RoundingMode)`, yielding + `x - y*round(x/y, r)` without intermediate rounding. In particular, `rem(x, y, RoundNearest)` + yields a value in the interval `[-abs(y)/2, abs(y)/2]`), which corresponds to the IEE754 + `remainder` function. Similarly, `rem2pi(x, r::RoundingMode)` now exists as well, yielding + `rem(x, 2pi, r::RoundingMode)` but with greater accuracy ([#10946]). + + * `map[!]` and `broadcast[!]` now have dedicated methods for sparse/structured + vectors/matrices. Specifically, `map[!]` and `broadcast[!]` over combinations including + one or more `SparseVector`, `SparseMatrixCSC`, `Diagonal`, `Bidiagonal`, `Tridiagonal`, + or `SymTridiagonal`, and any number of `broadcast` scalars, `Vector`s, or `Matrix`s, + now efficiently yield `SparseVector`s or `SparseMatrix`s as appropriate ([#19239], + [#19371], [#19518], [#19438], [#19690], [#19724], [#19926], [#19934], [#20009]). + + * The operators `!` and `∘` (`\circ` at the REPL and in most code editors) now + respectively perform predicate function negation and function composition. For example, + `map(!iszero, (0, 1))` is now equivalent to `map(x -> !iszero(x), (0, 1))` and + `map(uppercase ∘ hex, 250:255)` is now equivalent to + `map(x -> uppercase(hex(x)), 250:255)` ([#17155]). + + * `enumerate` now supports the two-argument form `enumerate(::IndexStyle, iterable)`. + This form allows specification of the returned indices' style. For example, + `enumerate(IndexLinear, iterable)` yields linear indices and + `enumerate(IndexCartesian, iterable)` yields cartesian indices ([#16378]). + + * Jump to first/last history entries in the REPL via "Alt-<" and "Alt->" ([#22829]). + Compiler/Runtime improvements ----------------------------- -* `ccall` is now implemented as a macro, removing the need for special code-generator support for Intrinsics. + * `ccall` is now implemented as a macro, + removing the need for special code-generator support for `Intrinsics` ([#18754]). -* `ccall` gained limited support for a `llvmcall` calling-convention. This can replace many uses of `llvmcall` with a simpler, shorter declaration. + * `ccall` gained limited support for a `llvmcall` calling-convention. + This can replace many uses of `llvmcall` with a simpler, shorter declaration ([#18754]). -* All Intrinsics are now Builtin functions instead and have proper error checking and fall-back static compilation support. + * All `Intrinsics` are now `Builtin` functions instead and have proper error checking + and fall-back static compilation support ([#18754]). Deprecated or removed --------------------- + * `ipermutedims(A::AbstractArray, p)` has been deprecated in favor of + `permutedims(A, invperm(p))` ([#18891]). + * Linear indexing is now only supported when there is exactly one non-cartesian index provided. Allowing a trailing index at dimension `d` to linearly access the higher dimensions from array `A` (beyond `size(A, d)`) @@ -331,103 +690,362 @@ Deprecated or removed Instead, `reshape` the array such that its dimensionality matches the number of indices ([#20079]). + * `Multimedia.@textmime "mime"` has been deprecated. Instead define + `Multimedia.istextmime(::MIME"mime") = true` ([#18441]). + * `isdefined(a::Array, i::Int)` has been deprecated in favor of `isassigned` ([#18346]). + * The three-argument `SubArray` constructor (which accepts `dims::Tuple` as its third + argument) has been deprecated in favor of the two-argument equivalent (the + `dims::Tuple` argument being superfluous) ([#19259]). + * `is` has been deprecated in favor of `===` (which used to be an alias for `is`) ([#17758]). - * `num` and `den` have been deprecated in favor of `numerator` and `denominator` respectively ([#19233]). + * Ambiguous methods for addition and subtraction between `UniformScaling`s and `Number`s, + for example `(+)(J::UniformScaling, x::Number)`, have been deprecated in favor of + unambiguous, explicit equivalents, for example `J.λ + x` ([#17607]). + + * `num` and `den` have been deprecated in favor of `numerator` and `denominator` respectively ([#19233],[#19246]). + + * `delete!(ENV::EnvHash, k::AbstractString, def)` has been deprecated in favor of + `pop!(ENV, k, def)`. Be aware that `pop!` returns `k` or `def`, whereas `delete!` + returns `ENV` or `def` ([#18012]). * infix operator `$` has been deprecated in favor of infix `⊻` or function `xor()` ([#18977]). + * The single-argument form of `write` (`write(x)`, with implicit `STDOUT` output stream), + has been deprecated in favor of the explicit equivalent `write(STDOUT, x)` ([#17654]). + * `Dates.recur` has been deprecated in favor of `filter` ([#19288]) - * `cummin` and `cummax` have been deprecated in favor of `accumulate`. + * A number of ambiguous `convert` operations between `Number`s (especially `Real`s) + and `Date`, `DateTime`, and `Period` types have been deprecated in favor of + unambiguous `convert` and explicit constructor calls. Additionally, ambiguous colon + construction of `<:Period` ranges without step specification, for example + `Dates.Hour(1):Dates.Hour(2)`, has been deprecated in favor of such construction + including step specification, for example `Dates.Hour(1):Dates.Hour(1):Dates.Hour(2)` + ([#19920]). + + * `cummin` and `cummax` have been deprecated in favor of `accumulate` ([#18931]). + + * The `Array` constructor syntax `Array(T, dims...)` has been deprecated + in favor of the forms `Array{T,N}(dims...)` (where `N` is known, or + particularly `Vector{T}(dims...)` for `N = 1` and `Matrix{T}(dims...)` for `N = 2`), + and `Array{T}(dims...)` (where `N` is not known). Likewise for `SharedArray`s ([#19989]). * `sumabs` and `sumabs2` have been deprecated in favor of `sum(abs, x)` and `sum(abs2, x)`, respectively. `maxabs` and `minabs` have similarly been deprecated in favor of `maximum(abs, x)` and `minimum(abs, x)`. Likewise for the in-place counterparts of these functions ([#19598]). - * `airy`, `airyx` and `airyprime` have been deprecated in favor of more specific - functions (`airyai`, `airybi`, `airyaiprime`, `airybiprimex`, `airyaix`, `airybix`, - `airyaiprimex`, `airybiprimex`) ([#18050]). + * The array-reducing form of `isinteger` (`isinteger(x::AbstractArray)`) has been + deprecated in favor of `all(isinteger, x)` ([#19925]). * `produce`, `consume` and iteration over a Task object have been deprecated in favor of using Channels for inter-task communication ([#19841]). + * The `negate` keyword has been deprecated from all functions in the `Dates` adjuster + API (`adjust`, `tonext`, `toprev`, `Date`, `Time`, and `DateTime`). Instead use + predicate function negation via the `!` operator + (see [Library Improvements](#library-improvements)) ([#20213]). + * `@test_approx_eq x y` has been deprecated in favor of `@test isapprox(x,y)` or `@test x ≈ y` ([#4615]). + * `Matrix()` and `Matrix{T}()` have been deprecated in favor of the explicit forms + `Matrix(0, 0)` and `Matrix{T}(0, 0)` ([#20330]). + + * Vectorized functions have been deprecated in favor of dot syntax ([#17302], [#17265], + [#18558], [#19711], [#19712], [#19791], [#19802], [#19931], [#20543], [#20228]). + + * All methods of character predicates (`isalnum`, `isalpha`, `iscntrl`, `isdigit`, + `isnumber`, `isgraph`, `islower`, `isprint`, `ispunct`, `isspace`, `isupper`, + `isxdigit`) that accept `AbstractStrings` have been deprecated in favor of `all`. + For example, `isnumber("123")` should now be expressed `all(isnumber, "123")` + ([#20342]). + + * A few names related to indexing traits have been changed: `LinearIndexing` and + `linearindexing` have been deprecated in favor of `IndexStyle`. `LinearFast` has + been deprecated in favor of `IndexLinear`, and `LinearSlow` has been deprecated in + favor of `IndexCartesian` ([#16378]). + + * The two-argument forms of `map` (`map!(f, A)`) and `asyncmap!` (`asyncmap!(f, A)`) + have been deprecated in anticipation of future semantic changes ([#19721]). + + * `unsafe_wrap(String, ...)` has been deprecated in favor of `unsafe_string` ([#19449]). + + * `zeros` and `ones` methods accepting an element type as the first argument and an + array as the second argument, for example `zeros(Float64, [1, 2, 3])`, have been + deprecated in favor of equivalent methods with the second argument instead the + size of the array, for example `zeros(Float64, size([1, 2, 3]))` ([#21183]). + + * `Base.promote_eltype_op` has been deprecated ([#19669], [#19814], [#19937]). + + * `isimag` has been deprecated ([#19949]). + + * The tuple-of-types form of `invoke`, `invoke(f, (types...), ...)`, has been deprecated + in favor of the tuple-type form `invoke(f, Tuple{types...}, ...)` ([#18444]). + + * `Base._promote_array_type` has been deprecated ([#19766]). + + * `broadcast_zpreserving` has been deprecated ([#19533], [#19720]). + + * Methods allowing indexing of tuples by `AbstractArray`s with more than one dimension + have been deprecated. (Indexing a tuple by such a higher-dimensional `AbstractArray` + should yield a tuple with more than one dimension, but tuples are one-dimensional.) + ([#19737]). + + * `@test_approx_eq a b` has been deprecated in favor of `@test a ≈ b` (or, + equivalently, `@test ≈(a, b)` or `@test isapprox(a, b)`). + `@test_approx_eq_eps` has been deprecated in favor of new `@test` syntax: + `@test` now supports the syntax `@test f(args...) key=val ...` for + `@test f(args..., key=val...)`. This syntax allows, for example, writing + `@test a ≈ b atol=c` in place of `@test ≈(a, b, atol=c)` (and hence + `@test_approx_eq_eps a b c`) ([#19901]). + + * `takebuf_array` has been deprecated in favor of `take!`, and `takebuf_string(x)` + has been deprecated in favor of `String(take!(x))` ([#19088]). + + * `convert` methods from `Diagonal` and `Bidiagonal` to subtypes of + `AbstractTriangular` have been deprecated ([#17723]). + + * `Base.LinAlg.arithtype` has been deprecated. If you were using `arithtype` within a + `promote_op` call, instead use `promote_op(Base.LinAlg.matprod, Ts...)`. Otherwise, + consider defining equivalent functionality locally ([#18218]). + + * Special characters (`#{}()[]<>|&*?~;`) should now be quoted in commands. For example, + ``` `export FOO=1\;` ``` should replace ``` `export FOO=1;` ``` and + ``` `cd $dir '&&' $thingie` ``` should replace ``` `cd $dir && $thingie` ``` ([#19786]). + + * Zero-argument `Channel` constructors (`Channel()`, `Channel{T}()`) have been deprecated + in favor of equivalents accepting an explicit `Channel` size + (`Channel(2)`, `Channel{T}(2)`) ([#18832]). + + * The zero-argument constructor `MersenneTwister()` has been + deprecated in favor of the explicit `MersenneTwister(0)` ([#16984]). + + * `Base.promote_type(op::Type, Ts::Type...)` has been removed as part of an overhaul + of `broadcast`'s promotion mechanism. If you need the functionality of that + `Base.promote_type` method, consider defining it locally via + `Core.Inference.return_type(op, Tuple{Ts...})` ([#18642]). + + * `bitbroadcast` has been deprecated in favor of `broadcast`, which now produces a + `BitArray` instead of `Array{Bool}` for functions yielding a boolean result ([#19771]). + + * To complete the deprecation of histogram-related functions, `midpoints` has been + deprecated. Instead use the + [StatsBase.jl package](https://github.com/JuliaStats/StatsBase.jl)'s + `midpoints` function ([#20058]). + + * Passing a type argument to `LibGit2.cat` has been deprecated in favor of a simpler, + two-argument method for `LibGit2.cat` ([#20435]). + + * The `LibGit2.owner` function for finding the repository which owns a given Git object + has been deprecated in favor of `LibGit2.repository` ([#20135]). + + * The `LibGit2.GitAnyObject` type has been renamed to `LibGit2.GitUnknownObject` to + clarify its intent ([#19935]). + + * The `LibGit2.GitOid` type has been renamed to `LibGit2.GitHash` for clarity ([#19878]). + + * Finalizing `LibGit2` objects with `finalize` has been deprecated in favor of using `close` + ([#19660]). + + * Parsing string dates from a `Dates.DateFormat` object has been deprecated as part of a + larger effort toward faster, more extensible date parsing ([#20952]). + +Command-line option changes +--------------------------- + + * In `polly` builds (`USE_POLLY := 1`), the new flag `--polly={yes|no}` controls whether + `@polly` declarations are respected. (With `--polly=no`, `@polly` declarations are + ignored.) This flag is also available in non-`polly` builds (`USE_POLLY := 0`), + but has no effect ([#18159]). + [#265]: https://github.com/JuliaLang/julia/issues/265 [#4615]: https://github.com/JuliaLang/julia/issues/4615 [#7669]: https://github.com/JuliaLang/julia/issues/7669 [#8974]: https://github.com/JuliaLang/julia/issues/8974 [#9343]: https://github.com/JuliaLang/julia/issues/9343 +[#10946]: https://github.com/JuliaLang/julia/issues/10946 [#11250]: https://github.com/JuliaLang/julia/issues/11250 [#11310]: https://github.com/JuliaLang/julia/issues/11310 [#12274]: https://github.com/JuliaLang/julia/issues/12274 [#12563]: https://github.com/JuliaLang/julia/issues/12563 +[#15850]: https://github.com/JuliaLang/julia/issues/15850 [#16213]: https://github.com/JuliaLang/julia/issues/16213 +[#16378]: https://github.com/JuliaLang/julia/issues/16378 +[#16937]: https://github.com/JuliaLang/julia/issues/16937 [#16961]: https://github.com/JuliaLang/julia/issues/16961 +[#16984]: https://github.com/JuliaLang/julia/issues/16984 [#16986]: https://github.com/JuliaLang/julia/issues/16986 [#17057]: https://github.com/JuliaLang/julia/issues/17057 +[#17155]: https://github.com/JuliaLang/julia/issues/17155 [#17261]: https://github.com/JuliaLang/julia/issues/17261 +[#17265]: https://github.com/JuliaLang/julia/issues/17265 +[#17302]: https://github.com/JuliaLang/julia/issues/17302 [#17599]: https://github.com/JuliaLang/julia/issues/17599 +[#17607]: https://github.com/JuliaLang/julia/issues/17607 [#17623]: https://github.com/JuliaLang/julia/issues/17623 +[#17654]: https://github.com/JuliaLang/julia/issues/17654 +[#17723]: https://github.com/JuliaLang/julia/issues/17723 [#17758]: https://github.com/JuliaLang/julia/issues/17758 [#17785]: https://github.com/JuliaLang/julia/issues/17785 +[#18012]: https://github.com/JuliaLang/julia/issues/18012 [#18050]: https://github.com/JuliaLang/julia/issues/18050 +[#18155]: https://github.com/JuliaLang/julia/issues/18155 +[#18159]: https://github.com/JuliaLang/julia/issues/18159 +[#18218]: https://github.com/JuliaLang/julia/issues/18218 [#18251]: https://github.com/JuliaLang/julia/issues/18251 [#18330]: https://github.com/JuliaLang/julia/issues/18330 [#18339]: https://github.com/JuliaLang/julia/issues/18339 +[#18342]: https://github.com/JuliaLang/julia/issues/18342 [#18346]: https://github.com/JuliaLang/julia/issues/18346 +[#18441]: https://github.com/JuliaLang/julia/issues/18441 [#18442]: https://github.com/JuliaLang/julia/issues/18442 +[#18444]: https://github.com/JuliaLang/julia/issues/18444 [#18453]: https://github.com/JuliaLang/julia/issues/18453 [#18457]: https://github.com/JuliaLang/julia/issues/18457 [#18473]: https://github.com/JuliaLang/julia/issues/18473 +[#18558]: https://github.com/JuliaLang/julia/issues/18558 [#18628]: https://github.com/JuliaLang/julia/issues/18628 +[#18642]: https://github.com/JuliaLang/julia/issues/18642 [#18644]: https://github.com/JuliaLang/julia/issues/18644 [#18660]: https://github.com/JuliaLang/julia/issues/18660 [#18690]: https://github.com/JuliaLang/julia/issues/18690 +[#18754]: https://github.com/JuliaLang/julia/issues/18754 [#18777]: https://github.com/JuliaLang/julia/issues/18777 +[#18832]: https://github.com/JuliaLang/julia/issues/18832 [#18839]: https://github.com/JuliaLang/julia/issues/18839 +[#18891]: https://github.com/JuliaLang/julia/issues/18891 [#18931]: https://github.com/JuliaLang/julia/issues/18931 [#18965]: https://github.com/JuliaLang/julia/issues/18965 [#18977]: https://github.com/JuliaLang/julia/issues/18977 [#19018]: https://github.com/JuliaLang/julia/issues/19018 +[#19088]: https://github.com/JuliaLang/julia/issues/19088 [#19157]: https://github.com/JuliaLang/julia/issues/19157 [#19233]: https://github.com/JuliaLang/julia/issues/19233 +[#19239]: https://github.com/JuliaLang/julia/issues/19239 +[#19246]: https://github.com/JuliaLang/julia/issues/19246 +[#19259]: https://github.com/JuliaLang/julia/issues/19259 [#19288]: https://github.com/JuliaLang/julia/issues/19288 [#19305]: https://github.com/JuliaLang/julia/issues/19305 [#19331]: https://github.com/JuliaLang/julia/issues/19331 +[#19371]: https://github.com/JuliaLang/julia/issues/19371 +[#19438]: https://github.com/JuliaLang/julia/issues/19438 [#19449]: https://github.com/JuliaLang/julia/issues/19449 [#19464]: https://github.com/JuliaLang/julia/issues/19464 [#19469]: https://github.com/JuliaLang/julia/issues/19469 +[#19518]: https://github.com/JuliaLang/julia/issues/19518 +[#19533]: https://github.com/JuliaLang/julia/issues/19533 [#19543]: https://github.com/JuliaLang/julia/issues/19543 +[#19594]: https://github.com/JuliaLang/julia/issues/19594 [#19598]: https://github.com/JuliaLang/julia/issues/19598 [#19635]: https://github.com/JuliaLang/julia/issues/19635 +[#19636]: https://github.com/JuliaLang/julia/issues/19636 +[#19660]: https://github.com/JuliaLang/julia/issues/19660 +[#19669]: https://github.com/JuliaLang/julia/issues/19669 [#19670]: https://github.com/JuliaLang/julia/issues/19670 [#19677]: https://github.com/JuliaLang/julia/issues/19677 [#19680]: https://github.com/JuliaLang/julia/issues/19680 +[#19690]: https://github.com/JuliaLang/julia/issues/19690 [#19692]: https://github.com/JuliaLang/julia/issues/19692 +[#19711]: https://github.com/JuliaLang/julia/issues/19711 +[#19712]: https://github.com/JuliaLang/julia/issues/19712 +[#19720]: https://github.com/JuliaLang/julia/issues/19720 +[#19721]: https://github.com/JuliaLang/julia/issues/19721 [#19722]: https://github.com/JuliaLang/julia/issues/19722 +[#19724]: https://github.com/JuliaLang/julia/issues/19724 +[#19730]: https://github.com/JuliaLang/julia/issues/19730 +[#19737]: https://github.com/JuliaLang/julia/issues/19737 [#19741]: https://github.com/JuliaLang/julia/issues/19741 +[#19766]: https://github.com/JuliaLang/julia/issues/19766 +[#19771]: https://github.com/JuliaLang/julia/issues/19771 +[#19779]: https://github.com/JuliaLang/julia/issues/19779 +[#19784]: https://github.com/JuliaLang/julia/issues/19784 +[#19786]: https://github.com/JuliaLang/julia/issues/19786 [#19787]: https://github.com/JuliaLang/julia/issues/19787 +[#19791]: https://github.com/JuliaLang/julia/issues/19791 [#19800]: https://github.com/JuliaLang/julia/issues/19800 +[#19802]: https://github.com/JuliaLang/julia/issues/19802 +[#19811]: https://github.com/JuliaLang/julia/issues/19811 +[#19814]: https://github.com/JuliaLang/julia/issues/19814 [#19841]: https://github.com/JuliaLang/julia/issues/19841 +[#19878]: https://github.com/JuliaLang/julia/issues/19878 [#19900]: https://github.com/JuliaLang/julia/issues/19900 +[#19901]: https://github.com/JuliaLang/julia/issues/19901 [#19903]: https://github.com/JuliaLang/julia/issues/19903 [#19919]: https://github.com/JuliaLang/julia/issues/19919 +[#19920]: https://github.com/JuliaLang/julia/issues/19920 +[#19925]: https://github.com/JuliaLang/julia/issues/19925 +[#19926]: https://github.com/JuliaLang/julia/issues/19926 +[#19931]: https://github.com/JuliaLang/julia/issues/19931 +[#19934]: https://github.com/JuliaLang/julia/issues/19934 +[#19935]: https://github.com/JuliaLang/julia/issues/19935 +[#19937]: https://github.com/JuliaLang/julia/issues/19937 [#19944]: https://github.com/JuliaLang/julia/issues/19944 +[#19949]: https://github.com/JuliaLang/julia/issues/19949 [#19950]: https://github.com/JuliaLang/julia/issues/19950 +[#19989]: https://github.com/JuliaLang/julia/issues/19989 +[#20005]: https://github.com/JuliaLang/julia/issues/20005 +[#20009]: https://github.com/JuliaLang/julia/issues/20009 [#20047]: https://github.com/JuliaLang/julia/issues/20047 +[#20058]: https://github.com/JuliaLang/julia/issues/20058 [#20079]: https://github.com/JuliaLang/julia/issues/20079 +[#20135]: https://github.com/JuliaLang/julia/issues/20135 [#20164]: https://github.com/JuliaLang/julia/issues/20164 +[#20213]: https://github.com/JuliaLang/julia/issues/20213 +[#20228]: https://github.com/JuliaLang/julia/issues/20228 +[#20248]: https://github.com/JuliaLang/julia/issues/20248 [#20249]: https://github.com/JuliaLang/julia/issues/20249 [#20268]: https://github.com/JuliaLang/julia/issues/20268 +[#20308]: https://github.com/JuliaLang/julia/issues/20308 [#20321]: https://github.com/JuliaLang/julia/issues/20321 [#20327]: https://github.com/JuliaLang/julia/issues/20327 +[#20328]: https://github.com/JuliaLang/julia/issues/20328 +[#20330]: https://github.com/JuliaLang/julia/issues/20330 +[#20342]: https://github.com/JuliaLang/julia/issues/20342 +[#20345]: https://github.com/JuliaLang/julia/issues/20345 [#20403]: https://github.com/JuliaLang/julia/issues/20403 [#20404]: https://github.com/JuliaLang/julia/issues/20404 [#20406]: https://github.com/JuliaLang/julia/issues/20406 [#20414]: https://github.com/JuliaLang/julia/issues/20414 [#20418]: https://github.com/JuliaLang/julia/issues/20418 +[#20427]: https://github.com/JuliaLang/julia/issues/20427 +[#20435]: https://github.com/JuliaLang/julia/issues/20435 +[#20500]: https://github.com/JuliaLang/julia/issues/20500 +[#20530]: https://github.com/JuliaLang/julia/issues/20530 +[#20543]: https://github.com/JuliaLang/julia/issues/20543 +[#20575]: https://github.com/JuliaLang/julia/issues/20575 +[#20609]: https://github.com/JuliaLang/julia/issues/20609 +[#20889]: https://github.com/JuliaLang/julia/issues/20889 +[#20952]: https://github.com/JuliaLang/julia/issues/20952 +[#20974]: https://github.com/JuliaLang/julia/issues/20974 +[#21183]: https://github.com/JuliaLang/julia/issues/21183 +[#21359]: https://github.com/JuliaLang/julia/issues/21359 +[#21692]: https://github.com/JuliaLang/julia/issues/21692 +[#21697]: https://github.com/JuliaLang/julia/issues/21697 +[#21746]: https://github.com/JuliaLang/julia/issues/21746 +[#21759]: https://github.com/JuliaLang/julia/issues/21759 +[#21818]: https://github.com/JuliaLang/julia/issues/21818 +[#21825]: https://github.com/JuliaLang/julia/issues/21825 +[#21956]: https://github.com/JuliaLang/julia/issues/21956 +[#21960]: https://github.com/JuliaLang/julia/issues/21960 +[#21973]: https://github.com/JuliaLang/julia/issues/21973 +[#21974]: https://github.com/JuliaLang/julia/issues/21974 +[#22007]: https://github.com/JuliaLang/julia/issues/22007 +[#22038]: https://github.com/JuliaLang/julia/issues/22038 +[#22062]: https://github.com/JuliaLang/julia/issues/22062 +[#22064]: https://github.com/JuliaLang/julia/issues/22064 +[#22182]: https://github.com/JuliaLang/julia/issues/22182 +[#22187]: https://github.com/JuliaLang/julia/issues/22187 +[#22188]: https://github.com/JuliaLang/julia/issues/22188 +[#22210]: https://github.com/JuliaLang/julia/issues/22210 +[#22224]: https://github.com/JuliaLang/julia/issues/22224 +[#22228]: https://github.com/JuliaLang/julia/issues/22228 +[#22245]: https://github.com/JuliaLang/julia/issues/22245 +[#22310]: https://github.com/JuliaLang/julia/issues/22310 +[#22523]: https://github.com/JuliaLang/julia/issues/22523 +[#22532]: https://github.com/JuliaLang/julia/issues/22532 +[#22709]: https://github.com/JuliaLang/julia/issues/22709 +[#22712]: https://github.com/JuliaLang/julia/issues/22712 +[#22732]: https://github.com/JuliaLang/julia/issues/22732 diff --git a/README.arm.md b/README.arm.md index f31eed9d51ef3a..9de38fdeee94ec 100644 --- a/README.arm.md +++ b/README.arm.md @@ -1,32 +1,20 @@ -# Julia binaries for ARM +# Julia on ARM (Linux) -[Nightly builds](https://status.julialang.org/download/linux-arm) are -available for ARMv7-A. - -# Hardware requirements - -Julia requires at least `armv6` and `vfpv2` instruction sets. It's recommended -to use at least `armv7-a`. `armv5` or soft float are not supported. +Julia fully supports ARMv8 (AArch64) processors, and supports ARMv7 and ARMv6 +(AArch32) with some caveats. This file provides general guidelines for compilation, +in addition to instructions for specific devices. -# Building Julia on ARM +A list of [known issues](https://github.com/JuliaLang/julia/labels/arm) for ARM is +available. If you encounter difficulties, please create an issue including the output +from `cat /proc/cpuinfo`. -Julia has been compiled on several ARMv7 / Cortex A15 Samsung -Chromebooks running Ubuntu Linux under Crouton, Raspberry Pi systems -and Odroid boards. This is a work in progress - several tests are -known to fail, and backtraces are not available. -Julia on ARM can be built by simply typing `make`, which will download all -the relevant libraries. This is the *recommended* way, and it will take a -few hours. +## Building Julia -If you get SIGILL during sysimg.o creation, it is likely that your cpu -does not support VFP. File an issue on the Julia issue tracker with -the contents of /proc/cpuinfo. +In most cases, Julia can be successfully built by following the platform independent +[build instructions](https://github.com/JuliaLang/julia/blob/master/README.md). -This is the list of known issues on ARM: - [https://github.com/JuliaLang/julia/labels/arm](https://github.com/JuliaLang/julia/labels/arm) - -# Build dependencies +### Build dependencies We recommend using at least Ubuntu 14.04 and gcc 4.8, which is part of the standard `build-essentials`. @@ -39,62 +27,73 @@ adding the following lines in `Make.user`: override USE_SYSTEM_BLAS=1 override USE_SYSTEM_LAPACK=1 override USE_SYSTEM_LIBM=1 -override USE_SYSTEM_FFTW=1 override USE_SYSTEM_GMP=1 override USE_SYSTEM_MPFR=1 override USE_SYSTEM_ARPACK=1 ```` -The following command will install all the necessary libraries on Ubuntu. +The following command will install all the necessary libraries on Ubuntu: ```` -sudo apt-get install libblas3gf liblapack3gf libarpack2 libfftw3-dev libgmp3-dev \ +sudo apt-get install libblas3gf liblapack3gf libarpack2 libgmp3-dev \ libmpfr-dev libblas-dev liblapack-dev cmake gcc-4.8 \ g++-4.8 gfortran libgfortran3 m4 libedit-dev ```` -Note that OpenBLAS only supports ARMv7. For older ARM variants, using the reference BLAS -may be the simplest thing to do. +If you run into issues building LLVM, see [these notes](http://llvm.org/docs/HowToBuildOnARM.html). + + +## 32-bit (ARMv6, ARMv7) -# ARM specific build problems +Julia has been successfully compiled on several variants of the following ARMv6 & ARMv7 devices: -If you run into issues building LLVM, see these notes: -[http://llvm.org/docs/HowToBuildOnARM.html](http://llvm.org/docs/HowToBuildOnARM.html) +* ARMv7 / Cortex A15 Samsung Chromebooks running Ubuntu Linux under Crouton; +* [Raspberry Pi](https://www.raspberrypi.org). +* [Odroid](http://www.hardkernel.com/main/main.php). + + +Julia requires at least the `armv6` and `vfpv2` instruction sets. It's recommended to use `armv7-a`. +`armv5` or soft float are not supported. + +### Binaries + +[Nightly builds](https://status.julialang.org/download/linux-arm) are +available for ARMv7-A. -## Raspberry Pi 1 / Raspberry Pi Zero +### Device specific instructions -Note: These chips use ARMv6, which is not well supported at the moment. However it is -possible to get a working Julia build. +#### Raspberry Pi 1 / Raspberry Pi Zero -The Raspberry Pi ARM CPU type is not detected by LLVM. Before starting the -build, it is recommended to explicitly set the CPU target by adding the -following to `Make.user`: +The type of ARM CPU used in the Raspberry Pi is not detected by LLVM. Explicitly set the +CPU target by adding the following to `Make.user`: ```` JULIA_CPU_TARGET=arm1176jzf-s ```` -It is also preferable to use various system provided dependencies on -ARMv6 as described in [Build Dependencies](#build-dependencies). +It is preferable to use various system provided dependencies on ARMv6 as described in +[Build Dependencies](#build-dependencies). -You may need to increase the swap file size: edit the `/etc/dphys-swapfile`, changing the line +To complete the build, you may need to increase the swap file size. To do so, edit +`/etc/dphys-swapfile`, changing the line: CONF_SWAPSIZE=100 -to +to: CONF_SWAPSIZE=512 -Then restart the swapfile service: +before restarting the swapfile service: sudo /etc/init.d/dphys-swapfile stop sudo /etc/init.d/dphys-swapfile start -## Raspberry Pi 2 +#### Raspberry Pi 2 -For Raspberry Pi 2, which is ARMv7, the default build should work. However, the -CPU type is also not detected by LLVM. Fix this by adding -`JULIA_CPU_TARGET=cortex-a7` to `Make.user`. +The type of ARM CPU used in the Raspberry Pi 2 is not detected by LLVM. Explicitly set the +CPU target by adding the following to `Make.user`: + +```JULIA_CPU_TARGET=cortex-a7``` Depending on the exact compiler and distribution, there might be a build failure due to unsupported inline assembly. In that case, add `MARCH=armv7-a` to @@ -102,7 +101,7 @@ due to unsupported inline assembly. In that case, add `MARCH=armv7-a` to If building LLVM fails, you can download binaries from the LLVM website: -1. Download the [LLVM 3.7.0 binaries for ARMv7a] (http://llvm.org/releases/3.7.0/clang+llvm-3.7.0-armv7a-linux-gnueabihf.tar.xz) and extract them in a local directory. +1. Download the [LLVM 3.9.0 binaries for ARMv7a] (http://llvm.org/releases/3.9.0/clang+llvm-3.9.0-armv7a-linux-gnueabihf.tar.xz) and extract them in a local directory. 2. Add the following to `Make.user` (adjusting the path to the `llvm-config` binary): ``` @@ -112,9 +111,9 @@ If building LLVM fails, you can download binaries from the LLVM website: Please do let us know if you had to download a pre-built LLVM in [#10235](https://github.com/JuliaLang/julia/issues/10235). -## Chromebook +#### Chromebook -On Chromebooks, you have to first install Crouton. If you do not have +On Chromebooks, you have to first install Crouton. If you do not have an Ubuntu chroot running on your Chromebook using Crouton, you can do so by following these tutorials. @@ -125,7 +124,42 @@ These tutorials will end up installing Ubuntu 12.04, and you have to upgrade to Ubuntu 14.04, or install Ubuntu 14.04 from scratch by finding appropriate `crouton` help. -## Scaleway cloud hosted ARM servers +#### Scaleway cloud hosted ARM servers On the current [Scaleway](http://scaleway.com) ARM servers, the Julia build works out of the box. + +## AArch64 (ARMv8) + +Julia has been successfully built on the following ARMv8 devices: + +* [nVidia Jetson TX1 & TX2](http://www.nvidia.com/object/embedded-systems-dev-kits-modules.html); +* [X-Gene 1](https://www.apm.com/products/data-center/x-gene-family/x-gene/); +* [Overdrive 3000](https://softiron.com/products/overdrive-3000/); +* [Cavium ThunderX](http://www.cavium.com/ThunderX_ARM_Processors.html) on [packet.net](https://www.packet.net). + +Compilation on `ARMv8-A` requires that `Make.user` is configured as follows: + +``` +MARCH=armv8-a +``` + +### Device specific instructions + +#### nVidia Jetson TX2 + +Julia builds and runs on the [nVidia Jetson TX2](http://www.nvidia.com/object/embedded-systems-dev-kits-modules.html) +platform with minimal configuration changes. + +After configuring `Make.user` as per the `AArch64` instructions in this document, +follow the general [build instructions](https://github.com/JuliaLang/julia/blob/master/README.md). +The majority of the build dependencies specified in the instructions are installed by +the default configuration flashed by [Jetpack 3.0](https://developer.nvidia.com/embedded/jetpack). The remaining tools can be installed by issuing the following command: + +``` +sudo apt-get install gfortran wget cmake +``` + +A full parallel build, including LLVM, +will complete in around two hours. All tests pass and CUDA functionality is available +through, e.g., [CUDAdrv](https://github.com/JuliaGPU/CUDAdrv.jl). diff --git a/README.md b/README.md index 43e19ece0f37ef..d6b9b28893ded3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -11,24 +11,23 @@ Windows: [![Build status](https://ci.appveyor.com/api/projects/status/dvial98s5v Code Coverage: [![Coverage Status](https://coveralls.io/repos/JuliaLang/julia/badge.svg?branch=master)](https://coveralls.io/r/JuliaLang/julia?branch=master) [![codecov.io](http://codecov.io/github/JuliaLang/julia/coverage.svg?branch=master)](http://codecov.io/github/JuliaLang/julia?branch=master) - ## 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](http://julialang.org/). +The main homepage for Julia can be found at [julialang.org](https://julialang.org/). This is the GitHub repository of Julia source code, including instructions for compiling and installing Julia, below. - ## Resources -- **Homepage:** -- **Binaries:** -- **Documentation:** +- **Homepage:** +- **Binaries:** +- **Documentation:** - **Packages:** - **Source code:** - **Git clone URL:** - **Discussion forum:** -- **Mailing lists:** +- **Mailing lists:** +- **Slack:** (get an invite from ) - **Gitter:** - **IRC:** - **Code coverage:** @@ -36,27 +35,37 @@ This is the GitHub repository of Julia source code, including instructions for c New developers may find the notes in [CONTRIBUTING](https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md) helpful to start contributing to the Julia codebase. ### External Resources - - [**StackOverflow**](https://stackoverflow.com/questions/tagged/julia-lang) - [**Youtube**](https://www.youtube.com/channel/UC9IuUwwE2xdjQUT_LMLONoA) - [**Twitter**](https://twitter.com/JuliaLanguage) - [**Meetup**](http://julia.meetup.com/) - ## Currently Supported Platforms -- **Linux** -- **MacOS** -- **FreeBSD** -- **Windows** +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) | | ✓ | Official | +| | PowerPC (64-bit) | | | Community | +| 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) | ✓ | | Community | + +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](https://julialang.org/downloads) page and are tested regularly. +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's possible that Julia will build and work on other platforms too, and we're always looking to better our platform coverage. +If you're using Julia on a platform not listed here, let us know! -All systems are supported with both x86/64 (64-bit) and x86 (32-bit, except MacOS) architectures. Support for [ARM](https://github.com/JuliaLang/julia/blob/master/README.arm.md), AARCH64, and POWER8 (little-endian) has been added recently. - - ## Source Download and Compilation -First, make sure you have all the [required dependencies](#Required-Build-Tools-External-Libraries) installed. +First, make sure you have all the [required dependencies](#required-build-tools-and-external-libraries) installed. Then, acquire the source code by cloning the git repository: git clone git://github.com/JuliaLang/julia.git @@ -67,12 +76,12 @@ Then, acquire the source code by cloning the git repository: 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 `0.5` series of releases. You can get this version by changing to the Julia directory and running +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 `0.6` series of releases. You can get this version by changing to the Julia directory and running - git checkout release-0.5 + git checkout v0.6.0 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](https://github.com/JuliaLang/julia#platform-specific-build-notes) for details.) -When compiled the first time, it will automatically download and build its [external dependencies](#Required-Build-Tools-External-Libraries). +When compiled the first time, it will automatically download and build its [external dependencies](#required-build-tools-and-external-libraries). 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`. The build will automatically check for the existence of `Make.user` and use it if it exists. Building Julia requires 1.5GiB of disk space and approximately 700MiB of virtual memory. @@ -80,7 +89,7 @@ For builds of julia starting with 0.5.0-dev, you can create out-of-tree builds o If you need to build Julia in an environment that does not allow access to the outside world, 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 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). +**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 using its full path in the directory created above (the `julia` directory), or, to run it from anywhere, either - add an alias (in `bash`: `echo "alias julia='/path/to/install/folder/bin/julia'" >> ~/.bashrc && source ~/.bashrc`), or @@ -105,7 +114,7 @@ the `julia` source directory, type `make testall`. You should see output that lists a series of tests being run; if they complete without error, you should be in good shape to start using Julia. -You can read about [getting started](http://docs.julialang.org/en/stable/manual/getting-started/) in the manual. +You can read about [getting started](https://docs.julialang.org/en/stable/manual/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 @@ -171,12 +180,10 @@ latest version. - ## 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 @@ -186,20 +193,20 @@ Julia does not install anything outside the directory it was cloned into. Julia * 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. -* See also the [external dependencies](#Required-Build-Tools-External-Libraries). +* See also the [external dependencies](#required-build-tools-and-external-libraries). #### 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 lib32gfortran3 (also manually call `ln -s /usr/lib32/libgfortran3.so.0 /usr/lib32/libgfortran3.so`) and lib32gcc1, lib32stdc++6, among others. +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](https://launchpad.net/~staticfloat/+archive/julia-deps/) 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](#System-Provided-Libraries). +The [julia-deps PPA](https://launchpad.net/~staticfloat/+archive/julia-deps/) 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](#system-provided-libraries). #### RHEL/CentOS 6 @@ -232,20 +239,24 @@ When building Julia, or its dependencies, libraries installed by third party pac ### FreeBSD -On *FreeBSD Release 11.0*, install the gfortran, git, cmake, and gmake packages/ports (`pkg install gcc6 gmake git cmake`), and compile Julia with the command: - - $ echo 'FC=gfortran6' >> Make.user - $ gmake - -You must use the `gmake` command on FreeBSD instead of `make`. +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`. +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.) -Note that Julia is community-supported and we have little control over our upstream dependencies, you may still run into issues with dependencies and YMMV. Current known issues include: +It's 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. - - The x86 arch doesn't support threading due to lack of compiler runtime library support (set `JULIA_THREADS=0`). - - OpenBLAS patches in pkg haven't been upstreamed. - - gfortran can't link binaries. Set `FFLAGS=-Wl,-rpath,/usr/local/lib/gcc6` to work around this (upstream bug submitted to FreeBSD pkg maintainers). - - System libraries installed by pkg are not on the compiler path by default. You may need to add `LDFLAGS=-L/usr/local/lib` and `CPPFLAGS=-I/usr/local/include` to your environment or `Make.user` file to build successfully. +Some known issues on FreeBSD are: +* 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 @@ -255,7 +266,6 @@ In order to build Julia on Windows, see [README.windows](https://github.com/Juli 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: @@ -285,7 +295,6 @@ Julia uses the following external libraries, which are automatically downloaded - **[AMOS]** — subroutines for computing Bessel and Airy functions. - **[SuiteSparse]** (>= 4.1) — library of linear algebra routines for sparse matrices. - **[ARPACK]** — collection of subroutines designed to solve large, sparse eigenvalue problems. -- **[FFTW]** (>= 3.3) — library for computing fast Fourier transforms very quickly and efficiently. - **[PCRE]** (>= 10.00) — Perl-compatible regular expressions library. - **[GMP]** (>= 5.0) — GNU multiple precision arithmetic library, needed for `BigInt` support. - **[MPFR]** (>= 3.0) — GNU multiple precision floating point library, needed for arbitrary precision floating point (`BigFloat`) support. @@ -317,23 +326,20 @@ Julia uses the following external libraries, which are automatically downloaded [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/ -[utf8proc]: http://julialang.org/utf8proc/ +[utf8proc]: https://julialang.org/utf8proc/ [libosxunwind]: https://github.com/JuliaLang/libosxunwind [libunwind]: http://www.nongnu.org/libunwind [libssh2]: https://www.libssh2.org [mbedtls]: https://tls.mbed.org/ [pkg-config]: https://www.freedesktop.org/wiki/Software/pkg-config/ - ### 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`. @@ -360,12 +366,10 @@ 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: @@ -382,10 +386,9 @@ The Julia source code is organized as follows: 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](http://julialang.org/downloads/). +If you would rather not compile the latest Julia from source, platform-specific tarballs with pre-compiled binaries are also [available for download](https://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): @@ -398,7 +401,7 @@ Now you should be able to run Julia like this: 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. +You can read about [getting started](https://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: @@ -419,8 +422,8 @@ The following distributions include julia, but the versions may be out of date d * [Nightly builds PPA](https://launchpad.net/~staticfloat/+archive/julianightlies) (depends on the [julia-deps PPA](https://launchpad.net/~staticfloat/+archive/julia-deps/)) * [MacPorts](https://trac.macports.org/browser/trunk/dports/lang/julia/Portfile) * [OS X Homebrew Tap](https://github.com/staticfloat/homebrew-julia/) +* [FreeBSD Ports](https://www.freshports.org/lang/julia/) - ## Editor and Terminal Setup Currently, Julia editing mode support is available for a number of @@ -440,4 +443,4 @@ is available through [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. +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](https://docs.julialang.org/en/latest/manual/interacting-with-julia) for more details. diff --git a/README.windows.md b/README.windows.md index 91655d5e18da92..05a31ee1f31044 100644 --- a/README.windows.md +++ b/README.windows.md @@ -1,198 +1,182 @@ -# General Information for Windows +# Julia on Windows This file describes how to install, or build, and use Julia on Windows. -For more general information about Julia, please see the [main README](https://github.com/JuliaLang/julia/blob/master/README.md) or the [documentation](http://docs.julialang.org/). -# Unicode font support +For more general information about Julia, please see the +[main README](https://github.com/JuliaLang/julia/blob/master/README.md) +or the [documentation](https://docs.julialang.org/). -The built-in Windows fonts have rather poor coverage of the Unicode character space. -The free [`DejaVu Sans Mono`](http://dejavu-fonts.org/) font can be used as a replacement font in the Windows console. -Since Windows 2000, simply downloading the font and installing it is insufficient, since Windows keeps a list of approved fonts in the registry. -Instructions for adding fonts to the terminal are available at: -[http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q247815](http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q247815) +## General Information for Windows -Additionally, rather than sticking with the default command prompt, you may want to use a different terminal emulator program, such as [`Conemu`](https://code.google.com/p/conemu-maximus5/) or [`Mintty`](https://code.google.com/p/mintty/) -(note that running Julia on Mintty needs a copy of `stty.exe` in your `%PATH%` to work properly). -Alternatively, you may prefer the features of a more full-function IDE, such as [`Juno`](http://junolab.org), [`LightTable`](https://github.com/one-more-minute/Jupiter-LT), [`Sublime-IJulia`](https://github.com/quinnj/Sublime-IJulia), or [`IJulia`](https://github.com/JuliaLang/IJulia.jl). +### Unicode font support +The built-in Windows fonts have rather poor coverage of the Unicode character +space. The free [`DejaVu Sans Mono`](http://dejavu-fonts.org/) font can be used +as a replacement font in the Windows console. Since Windows 2000, simply +downloading the font and installing it is insufficient, since Windows keeps a +list of approved fonts in the registry. -# Binary distribution - -Julia runs on Windows 7 and later. -Both the 32-bit and 64-bit versions are supported. -The 32-bit (i686) binary will run on either a 32-bit and 64-bit operating system. -The 64-bit (x86_64) binary will only run on 64-bit Windows and will otherwise refuse to launch. - -1. [Download](http://julialang.org/downloads) the latest version of Julia. Extract the binary to a reasonable destination folder, e.g. `C:\julia`. - -2. Double-click the `julia` shortcut to launch Julia. - -3. Julia's home directory is the location pointed to by the Windows environment variable `HOME`: this directory is for instance where the startup file `.juliarc.jl` resides. `HOMEDRIVE`\\`HOMEPATH` is used as a fallback if `HOME` is not defined. +Instructions for adding fonts to the terminal are available at +[this answer on superuser.com](https://superuser.com/a/5079) +Additionally, rather than sticking with the default command prompt, you may want +to use a different terminal emulator program, such as +[Conemu](https://code.google.com/p/conemu-maximus5/) or [Mintty]( +https://github.com/mintty/mintty) (note that running Julia on Mintty needs a +copy of `stty.exe` in your `%PATH%` to work properly). Alternatively, you may +prefer the features of a more full-function IDE, such as [Juno](http://junolab.org), +[Sublime-IJulia](https://github.com/quinnj/Sublime-IJulia), or +[IJulia](https://github.com/JuliaLang/IJulia.jl). -# Line endings -Julia uses binary-mode files exclusively. Unlike many other Windows programs, if you write '\n' to a file, you get a '\n' in the file, not some other bit pattern. This matches the behavior exhibited by other operating systems. If you have installed msysGit, it is suggested, but not required, that you configure your system msysGit to use the same convention: - - git config --global core.eol lf - git config --global core.autocrlf input +### Line endings +Julia uses binary-mode files exclusively. Unlike many other Windows programs, +if you write `\n` to a file, you get a `\n` in the file, not some other bit +pattern. This matches the behavior exhibited by other operating systems. If +you have installed Git for Windows, it is suggested, but not required, that you +configure your system Git to use the same convention: +```sh +git config --global core.eol lf +git config --global core.autocrlf input +``` or edit `%USERPROFILE%\.gitconfig` and add/edit the lines: - - [core] eol = lf - autocrlf = input - - -# Source distribution - -## Supported build platforms -- Windows 10: supported (32 and 64 bits) -- Windows 8: supported (32 and 64 bits) -- Windows 7: supported (32 and 64 bits) -- Windows Vista: not officially supported (but probably works anyways) -- Windows XP: not supported (but may work anyways, if you can get around the lack of junction points) - -## Compiling with MinGW/MSYS2 - -### MSYS2 provides a robust MSYS experience. - -1. Install [Python 2.x](http://www.python.org/downloads/). Do **not** install Python 3. - -2. Install [CMake](http://www.cmake.org/download/). - -3. Install and configure [MSYS2](https://msys2.github.io), a minimal POSIX-like environment for Windows. - - 1. Download and run the latest installer for the [32-bit](http://sourceforge.net/projects/msys2/files/Base/i686/) or [64-bit](http://sourceforge.net/projects/msys2/files/Base/x86_64/) distribution. The installer will have a name like `msys2-i686-yyyymmdd.exe` or `msys2-x86_64-yyyymmdd.exe`. - - 2. Double-click `msys2_shell.bat` in the installed msys directory. Initialize the MSYS2 base system using the `pacman` package manager included in MSYS2: - - ``` - update-core - pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime # if update-core is not available - pacman -Syu #Update package database and full system upgrade ``` - - 3. Exit and restart MSYS2, then install packages required to build julia: - - ``` - pacman -S diffutils git m4 make patch tar p7zip msys/openssh ca-certificates +[core] + eol = lf + autocrlf = input ``` - 4. Configure your MSYS2 shell so Python is visible on the path: +## Binary distribution - ``` - echo "export PATH=/usr/local/bin:/usr/bin:/opt/bin:/C/Python27" >> ~/.bashrc -``` +Julia runs on Windows 7 and later. +Both the 32-bit and 64-bit versions are supported. +The 32-bit (i686) binary will run on either a 32-bit and 64-bit operating system. +The 64-bit (x86_64) binary will only run on 64-bit Windows and will otherwise refuse to launch. - *N.B.* The `export` clobbers whatever `$PATH` is already defined. This is suggested to avoid path-masking. If you use MSYS2 for purposes other than building Julia, you may prefer to append rather than clobber. + 1. [Download](https://julialang.org/downloads) the latest version of Julia. + Extract the binary to a reasonable destination folder, e.g. `C:\julia`. - *N.B.* All of the path separators are unix-style. In MSYS2, `/C/` means the root of your `C:\` drive. Replace `/C/Python27` with the location where you installed Python. + 2. Double-click the `julia` shortcut to launch Julia. + 3. Julia's home directory is the location pointed to by the Windows environment + variable `%HOME%`: this directory is for instance where the startup file + `.juliarc.jl` resides. `%HOMEDRIVE%\%HOMEPATH%` is used as a fallback if + `%HOME%` is not defined. - 5. Configuration of MSYS2 is complete. Now `exit` the MSYS2 shell. +## Source distribution -4. Build Julia and its dependencies from source. - 1. Open a new MSYS2 shell and clone the Julia sources - ``` - git clone https://github.com/JuliaLang/julia.git - cd julia -``` +### Supported build platforms - 2. Run the following script to download the correct versions of the MinGW-w64 compilers - ``` - contrib/windows/get_toolchain.sh 32 # for 32 bit Julia - # or - contrib/windows/get_toolchain.sh 64 # for 64 bit Julia -``` - Then follow the printed instructions by running either - ``` - export PATH=$PWD/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH # for 32 bit Julia - # or - export PATH=$PWD/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH # for 64 bit Julia -``` - to add the downloaded MinGW-w64 compilers to your path (temporarily, only needed during the shell session when you build Julia). + - Windows 10: supported (32 and 64 bits) + - Windows 8: supported (32 and 64 bits) + - Windows 7: supported (32 and 64 bits) - 3. Specify the location where you installed CMake +### Cygwin-to-MinGW cross-compiling - ``` - echo 'override CMAKE=/C/path/to/CMake/bin/cmake.exe' > Make.user -``` +The recommended way of compiling Julia from source on Windows is by cross +compiling from [Cygwin](http://www.cygwin.com), using versions of the +MinGW-w64 compilers available through Cygwin's package manager. - 4. Start the build - ``` - make -j 4 # Adjust the number of cores (4) to match your build environment. -``` + 1. Download and run Cygwin setup for [32 bit](http://cygwin.com/setup-x86.exe) + or [64 bit](http://cygwin.com/setup-x86_64.exe). Note, that you can compile + either 32 or 64 bit Julia from either 32 or 64 bit Cygwin. 64 bit Cygwin + has a slightly smaller but often more up-to-date selection of packages. -5. Setup Package Development Environment - 1. The `Pkg` module in Base provides many convenient tools for [developing and publishing packages](http://docs.julialang.org/en/latest/manual/packages/). - One of the packages added through pacman above was `openssh`, which will allow secure access to GitHub APIs. - Follow GitHub's [guide](https://help.github.com/articles/generating-ssh-keys) to setting up SSH keys to ensure your local machine can communicate with GitHub effectively. + Advanced: you may skip steps 2-4 by running: - 2. In case of the issues with building packages (i.e. ICU fails to build with the following error message ```error compiling xp_parse: error compiling xp_make_parser: could not load module libexpat-1: %```) run ```make win-extras``` and then copy everything from the ```dist-extras``` folder into ```usr/bin```. + setup-x86_64.exe -s -q -P cmake,gcc-g++,git,make,patch,curl,m4,python,p7zip,mingw64-i686-gcc-g++,mingw64-i686-gcc-fortran,mingw64-x86_64-gcc-g++,mingw64-x86_64-gcc-fortran + :: replace with a site from https://cygwin.com/mirrors.html + :: or run setup manually first and select a mirror -## Cygwin-to-MinGW cross compiling + 2. Select installation location and download mirror. -Julia can be also compiled from source in [Cygwin](http://www.cygwin.com), using versions of the MinGW-w64 compilers available through Cygwin's package manager. + 3. At the '*Select Packages'* step, select the following: -1. Download and run Cygwin setup for [32 bit](http://cygwin.com/setup-x86.exe) or [64 bit](http://cygwin.com/setup-x86_64.exe). Note that you can compile either 32 or 64 bit Julia from either 32 or 64 bit Cygwin. 64 bit Cygwin has a slightly smaller but often more up-to-date selection of packages. + 1. From the *Devel* category: `cmake`, `gcc-g++`, `git`, `make`, `patch` + 2. From the *Net* category: `curl` + 3. From *Interpreters* (or *Python*) category: `m4`, `python` + 4. From the *Archive* category: `p7zip` + 5. For 32 bit Julia, and also from the *Devel* category: + `mingw64-i686-gcc-g++` and `mingw64-i686-gcc-fortran` + 6. For 64 bit Julia, and also from the *Devel* category: + `mingw64-x86_64-gcc-g++` and `mingw64-x86_64-gcc-fortran` -2. Select installation location and download mirror. + 4. At the *'Resolving Dependencies'* step, be sure to leave *'Select required + packages (RECOMMENDED)'* enabled. -3. At the "Select Packages" step, select the following: - 1. `git` (under `Devel` category) - 2. `make` (under `Devel` category) - 3. `curl` (under `Net` category) - 4. `patch` (under `Devel` category) - 5. `python` (under `Interpreters` or `Python` category) - 6. `gcc-g++` (under `Devel` category) - 7. `m4` (under `Interpreters` category) - 8. `cmake` (under `Devel` category) - 9. `p7zip` (under `Archive` category) - 10. `mingw64-i686-gcc-g++` and `mingw64-i686-gcc-fortran` (for 32 bit Julia, under `Devel` category) - 11. `mingw64-x86_64-gcc-g++` and `mingw64-x86_64-gcc-fortran` (for 64 bit Julia, under `Devel` category) + 5. Allow Cygwin installation to finish, then start from the installed shortcut + a *'Cygwin Terminal'*, or *'Cygwin64 Terminal'*, respectively. -4. At the "Resolving Dependencies" step, be sure to leave "Select required packages (RECOMMENDED)" enabled. + 6. Build Julia and its dependencies from source: -5. Allow Cygwin installation to finish, then start a "Cygwin Terminal" (or "Cygwin64 Terminal") from the installed shortcut. + 1. Get the Julia sources + ```sh + git clone https://github.com/JuliaLang/julia.git + cd julia + ``` + Tip: If you get an `error: cannot fork() for fetch-pack: Resource + temporarily unavailable` from git, add `alias git="env PATH=/usr/bin git"` + to `~/.bashrc` and restart Cygwin. -6. Build Julia and its dependencies from source. - 1. Get the Julia sources - ``` - git clone --recursive https://github.com/JuliaLang/julia.git - cd julia -``` - *Tips:* - - If you get an `error: cannot fork() for fetch-pack: Resource temporarily unavailable` from git, add `alias git="env PATH=/usr/bin git"` to `~/.bashrc` and restart Cygwin. + 2. Set the `XC_HOST` variable in `Make.user` to indicate MinGW-w64 cross + compilation + ```sh + echo 'XC_HOST = i686-w64-mingw32' > Make.user # for 32 bit Julia + # or + echo 'XC_HOST = x86_64-w64-mingw32' > Make.user # for 64 bit Julia + ``` - 2. Set the `XC_HOST` variable in `Make.user` to indicate MinGW-w64 cross compilation + 3. Start the build + ```sh + make -j 4 # Adjust the number of cores (4) to match your build environment. + ``` - For 32 bit Julia - ``` - echo 'XC_HOST = i686-w64-mingw32' > Make.user -``` - For 64 bit Julia - ``` - echo 'XC_HOST = x86_64-w64-mingw32' > Make.user -``` - 3. Start the build - ``` - make -j 4 # Adjust the number of cores (4) to match your build environment. -``` + > Protip: build both! + > ```sh + > make O=julia-win32 configure + > make O=julia-win64 configure + > echo 'XC_HOST = i686-w64-mingw32' > julia-win32/Make.user + > echo 'XC_HOST = x86_64-w64-mingw32' > julia-win64/Make.user + > echo 'ifeq ($(BUILDROOT),$(JULIAHOME)) + > $(error "in-tree build disabled") + > endif' >> Make.user + > make -C julia-win32 # build for Windows x86 in julia-win32 folder + > make -C julia-win64 # build for Windows x86-64 in julia-win64 folder + > ``` -7. Run Julia using the Julia executables directly - ``` + 7. Run Julia using the Julia executables directly + ```sh usr/bin/julia.exe usr/bin/julia-debug.exe -``` + ``` + +### Compiling with MinGW/MSYS2 + +Compiling Julia from source using [MSYS2](https://msys2.github.io) has worked +in the past but is not actively supported. Pull requests to restore support +would be welcome. See a [past version of this file]( +https://github.com/JuliaLang/julia/blob/v0.6.0/README.windows.md) +for the former instructions for compiling using MSYS2. -## Cross-compiling from Unix -If you prefer to cross-compile, the following steps should get you started. +### Cross-compiling from Unix + +You can also use MinGW-w64 cross compilers to build a Windows version of Julia from +Linux, Mac, or the Windows Subsystem for Linux (WSL). Note that when compiling in +WSL, you should use the Linux file system environment, not the `/mnt/` emulated Windows +paths, since time stamps in `/mnt/` do not work properly as required by configure +scripts and makefiles (see https://github.com/Microsoft/BashOnWindows/issues/1939). + +For maximum compatibility with packages that use [WinRPM.jl]( +https://github.com/JuliaLang/WinRPM.jl) for binary dependencies on Windows, it +is recommended that you use OpenSUSE 42.2 for cross-compiling a Windows build +of Julia. If you use a different Linux distribution or OS X, install +[Vagrant](http://www.vagrantup.com/downloads) and use the following `Vagrantfile`: -For maximum compatibility with packages that use [WinRPM.jl](https://github.com/JuliaLang/WinRPM.jl) for binary dependencies on Windows, it is recommended that you use OpenSUSE 13.2 for cross-compiling a Windows build of Julia. If you use a different Linux distribution or OS X, install [Vagrant](http://www.vagrantup.com/downloads) and use the following `Vagrantfile`: ``` # Vagrantfile for MinGW-w64 cross-compilation of Julia @@ -201,10 +185,10 @@ $script = <