Skip to content

Commit

Permalink
Merge branch 'master' into mb/deprecatemultivaluenonscalarindexedassi…
Browse files Browse the repository at this point in the history
…gnment

* master:
  Make stdlib tests runnable standalone. (#26242)
  fix unary-related parsing regressions caused by #26154 (#26239)
  Formatting changes to new SSA IR devdocs [ci skip]
  use medium code model on PPC
  `retry` should support the check function proposed in the docstring. (#26138)
  mention axes in docs instead of size (#26233)
  exclude more CI files from source distro (#25906)
  Describe three-valued logic in docstrings
  deprecate using the value of `.=`. fixes #25954 (#26088)
  backport change to make CodegenPrepare work with isNoopAddrSpaceCast
  optimize the python version of abs2 in the microbenchmarks (#26223)
  Add notes for package maintainers (#25912)
  typo
  Fix broken links to functions in the manual (#26171)
  [NewOptimizer] Track inlining info
  Begin work on new optimizer framework
  add patch to make GC address spaces work on PPC
  also backport sover patch to LLVM 4.0
  • Loading branch information
mbauman committed Feb 28, 2018
2 parents 41d458e + 74f5328 commit 83d99cd
Show file tree
Hide file tree
Showing 74 changed files with 3,241 additions and 478 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ endif

# Create file light-source-dist.tmp to hold all the filenames that go into the tarball
echo "base/version_git.jl" > light-source-dist.tmp
git ls-files | sed -e '/\.git/d' -e '/\.travis/d' >> light-source-dist.tmp
# Exclude git, github and CI config files
git ls-files | sed -E -e '/^\..+/d' -e '/\/\..+/d' -e '/appveyor.yml/d' >> light-source-dist.tmp
find doc/_build/html >> light-source-dist.tmp

# Make tarball with only Julia code
Expand Down
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ Building Julia requires that the following software be installed:

Julia uses the following external libraries, which are automatically downloaded (or in a few cases, included in the Julia source repository) and then compiled from source the first time you run `make`:

- **[LLVM]** (3.9) — compiler infrastructure.
- **[LLVM]** (3.9 + patches) — compiler infrastructure (see [note below](#llvm)).
- **[FemtoLisp]** — packaged with Julia source, and used to implement the compiler front-end.
- **[libuv]** — portable, high-performance event-based I/O library.
- **[libuv]** (custom fork) — portable, high-performance event-based I/O library.
- **[OpenLibm]** — portable libm library containing elementary math functions.
- **[DSFMT]** — fast Mersenne Twister pseudorandom number generator library.
- **[OpenBLAS]** — fast, open, and maintained [basic linear algebra subprograms (BLAS)](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) library, based on [Kazushige Goto's](https://en.wikipedia.org/wiki/Kazushige_Goto) famous [GotoBLAS](https://www.tacc.utexas.edu/research-development/tacc-software/gotoblas2).
- **[OpenBLAS]** — fast, open, and maintained [basic linear algebra subprograms (BLAS)](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) library, based on [Kazushige Goto's](https://en.wikipedia.org/wiki/Kazushige_Goto) famous [GotoBLAS](https://www.tacc.utexas.edu/research-development/tacc-software/gotoblas2) (see [note below](#blas-and-lapack)).
- **[LAPACK]** (>= 3.5) — library of linear algebra routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems.
- **[MKL]** (optional) – OpenBLAS and LAPACK may be replaced by Intel's MKL library.
- **[SuiteSparse]** (>= 4.1) — library of linear algebra routines for sparse matrices.
- **[SuiteSparse]** (>= 4.1) — library of linear algebra routines for sparse matrices (see [note below](#suitesparse)).
- **[ARPACK]** — collection of subroutines designed to solve large, sparse eigenvalue problems.
- **[PCRE]** (>= 10.00) — Perl-compatible regular expressions library.
- **[GMP]** (>= 5.0) — GNU multiple precision arithmetic library, needed for `BigInt` support.
Expand All @@ -318,6 +318,7 @@ Julia uses the following external libraries, which are automatically downloaded
[patch]: http://www.gnu.org/software/patch
[wget]: http://www.gnu.org/software/wget
[m4]: http://www.gnu.org/software/m4
[awk]: http://www.gnu.org/software/gawk
[gcc]: http://gcc.gnu.org
[clang]: http://clang.llvm.org
[python]: https://www.python.org/
Expand Down Expand Up @@ -347,12 +348,35 @@ Julia uses the following external libraries, which are automatically downloaded
[mbedtls]: https://tls.mbed.org/
[pkg-config]: https://www.freedesktop.org/wiki/Software/pkg-config/

### Notes for distribution package maintainers

Package maintainers will typically want to make use of system libraries where possible. Please refer to the above version requirements and additional notes below. A list of maintained Julia packages for various platforms is available at https://julialang.org/downloads/platform.html.

### System Provided Libraries

If you already have one or more of these packages installed on your system, you can prevent Julia from compiling duplicates of these libraries by passing `USE_SYSTEM_...=1` to `make` or adding the line to `Make.user`. The complete list of possible flags can be found in `Make.inc`.

Please be aware that this procedure is not officially supported, as it introduces additional variability into the installation and versioning of the dependencies, and is recommended only for system package maintainers. Unexpected compile errors may result, as the build system will do no further checking to ensure the proper packages are installed.

### LLVM

The most complicated dependency is LLVM, for which we require version 3.9 with some additional patches from upstream (LLVM is not backward compatible). For packaging Julia, we recommend either:
- bundling a Julia-only LLVM library inside the Julia package, or
- adding the patches to the LLVM 3.9 package of the distribution.
* A complete list of patches is available in `deps/llvm.mk`, and the patches themselves are in `deps/patches/`.
* The only Julia-specific patch is the lib renaming (`llvm-symver-jlprefix.patch`), which should _not_ be applied to a system LLVM.
* The remaining patches are all upstream bug fixes, and have been contributed into upstream LLVM.

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

### libuv

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

### BLAS and LAPACK

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

### SuiteSparse

SuiteSparse is a special case, since it is typically only installed as a static library, while `USE_SYSTEM_SUITESPARSE=1` requires that it is a shared library. Running the script `contrib/repackage_system_suitesparse4.make` will copy your static system SuiteSparse installation into the shared library format required by Julia. `make USE_SYSTEM_SUITESPARSE=1` will then use the SuiteSparse that has been copied into Julia's directory, but will not build a new SuiteSparse library from scratch.
Expand Down
5 changes: 5 additions & 0 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Return a tuple containing the dimensions of `A`. Optionally you can specify the
dimension(s) you want the length of, and get the length of that dimension, or a tuple of the
lengths of dimensions you asked for.
Note that `size` may not be defined for arrays with non-standard indices, in which case [`axes`](@ref)
may be useful. See the manual chapter on [arrays with custom indices](@ref man-custom-indices).
# Examples
```jldoctest
julia> A = fill(1, (2,3,4));
Expand All @@ -49,6 +52,8 @@ size(x, d1::Integer, d2::Integer, dx::Vararg{Integer, N}) where {N} =
Return the valid range of indices for array `A` along dimension `d`.
See also [`size`](@ref), and the manual chapter on [arrays with custom indices](@ref man-custom-indices).
# Examples
```jldoctest
julia> A = fill(1, (5,6,7));
Expand Down
10 changes: 10 additions & 0 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ end

copyto!(dest::Array{T}, src::Array{T}) where {T} = copyto!(dest, 1, src, 1, length(src))

# N.B: The generic definition in multidimensional.jl covers, this, this is just here
# for bootstrapping purposes.
function fill!(dest::Array{T}, x) where T
xT = convert(T, x)
for i in 1:length(dest)
@inbounds dest[i] = xT
end
dest
end

"""
copy(x)
Expand Down
28 changes: 23 additions & 5 deletions base/bool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ typemax(::Type{Bool}) = true
"""
!(x)
Boolean not.
Boolean not. Implements [three-valued logic](https://en.wikipedia.org/wiki/Three-valued_logic),
returning [`missing`](@ref) if `x` is `missing`.
# Examples
```jldoctest
Expand All @@ -21,6 +22,9 @@ false
julia> !false
true
julia> !missing
missing
julia> .![true false true]
1×3 BitArray{2}:
false true false
Expand All @@ -40,13 +44,27 @@ end
xor(x, y)
⊻(x, y)
Bitwise exclusive or of `x` and `y`. The infix operation
`a ⊻ b` is a synonym for `xor(a,b)`, and
`⊻` can be typed by tab-completing `\\xor`
or `\\veebar` in the Julia REPL.
Bitwise exclusive or of `x` and `y`. Implements
[three-valued logic](https://en.wikipedia.org/wiki/Three-valued_logic),
returning [`missing`](@ref) if one of the arguments is `missing`.
The infix operation `a ⊻ b` is a synonym for `xor(a,b)`, and
`⊻` can be typed by tab-completing `\\xor` or `\\veebar` in the Julia REPL.
# Examples
```jldoctest
julia> xor(true, false)
true
julia> xor(true, true)
false
julia> xor(true, missing)
missing
julia> false ⊻ false
false
julia> [true; true; false] .⊻ [true; false; false]
3-element BitArray{1}:
false
Expand Down
14 changes: 13 additions & 1 deletion base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@
# label::Int
#end

#struct PiNode
# val
# typ
#end

#struct PhiNode
# edges::Vector{Any}
# values::Vector{Any}
#end

#struct QuoteNode
# value
#end
Expand Down Expand Up @@ -141,7 +151,7 @@ export
TypeError, ArgumentError, MethodError, AssertionError, LoadError, InitError,
UndefKeywordError,
# AST representation
Expr, QuoteNode, LineNumberNode, GlobalRef,
Expr, QuoteNode, LineNumberNode, GlobalRef, PiNode, PhiNode,
# object model functions
fieldtype, getfield, setfield!, nfields, throw, tuple, ===, isdefined, eval,
# sizeof # not exported, to avoid conflicting with Base.sizeof
Expand Down Expand Up @@ -344,6 +354,8 @@ eval(Core, :(LineNumberNode(l::Int, @nospecialize(f)) = $(Expr(:new, :LineNumber
eval(Core, :(GlobalRef(m::Module, s::Symbol) = $(Expr(:new, :GlobalRef, :m, :s))))
eval(Core, :(SlotNumber(n::Int) = $(Expr(:new, :SlotNumber, :n))))
eval(Core, :(TypedSlot(n::Int, @nospecialize(t)) = $(Expr(:new, :TypedSlot, :n, :t))))
eval(Core, :(PhiNode(edges::Array{Any, 1}, values::Array{Any, 1}) = $(Expr(:new, :PhiNode, :edges, :values))))
eval(Core, :(PiNode(val, typ) = $(Expr(:new, :PiNode, :val, :typ))))

Module(name::Symbol=:anonymous, std_imports::Bool=true) = ccall(:jl_f_new_module, Ref{Module}, (Any, Bool), name, std_imports)

Expand Down
2 changes: 1 addition & 1 deletion base/checked.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Core.Intrinsics:
checked_srem_int,
checked_uadd_int, checked_usub_int, checked_umul_int, checked_udiv_int,
checked_urem_int
import Base: no_op_err, @_inline_meta, @_noinline_meta
import ..no_op_err, ..@_inline_meta, ..@_noinline_meta

# define promotion behavior for checked operations
checked_add(x::Integer, y::Integer) = checked_add(promote(x,y)...)
Expand Down
2 changes: 0 additions & 2 deletions base/compiler/bootstrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ let fs = Any[typeinf_ext, typeinf, typeinf_edge, pure_eval_call],
end
end
end

ccall(:jl_set_typeinf_func, Cvoid, (Any,), typeinf_ext)
26 changes: 26 additions & 0 deletions base/compiler/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ include("refvalue.jl")
# checked arithmetic
const checked_add = +
const checked_sub = -
const SignedInt = Union{Int8,Int16,Int32,Int64,Int128}
const UnsignedInt = Union{UInt8,UInt16,UInt32,UInt64,UInt128}
sub_with_overflow(x::T, y::T) where {T<:SignedInt} = checked_ssub_int(x, y)
sub_with_overflow(x::T, y::T) where {T<:UnsignedInt} = checked_usub_int(x, y)
sub_with_overflow(x::Bool, y::Bool) = (x-y, false)
add_with_overflow(x::T, y::T) where {T<:SignedInt} = checked_sadd_int(x, y)
add_with_overflow(x::T, y::T) where {T<:UnsignedInt} = checked_uadd_int(x, y)
add_with_overflow(x::Bool, y::Bool) = (x+y, false)

# core array operations
include("indices.jl")
Expand All @@ -66,12 +74,29 @@ include("reduce.jl")
include("bitarray.jl")
include("bitset.jl")
include("abstractdict.jl")
include("abstractset.jl")
include("iterators.jl")
using .Iterators: zip, enumerate
using .Iterators: Flatten, product # for generators
include("namedtuple.jl")

# core docsystem
include("docs/core.jl")

# SubArray
include("subarray.jl")
macro views(x); esc(x); end

# sorting
function sort end
function sort! end
function issorted end
function sortperm end
include("ordering.jl")
using .Order
include("sort.jl")
using .Sort

############
# compiler #
############
Expand All @@ -96,6 +121,7 @@ include("compiler/typeinfer.jl")
include("compiler/optimize.jl") # TODO: break this up further + extract utilities

include("compiler/bootstrap.jl")
ccall(:jl_set_typeinf_func, Cvoid, (Any,), typeinf_ext)

end # baremodule Compiler
))
Loading

0 comments on commit 83d99cd

Please sign in to comment.