From 67e716ce006398f459fdebac45baef6ea563e90b Mon Sep 17 00:00:00 2001 From: ScottPJones Date: Sat, 16 May 2015 21:57:31 -0400 Subject: [PATCH] Make lite version of Julia --- Make.inc | 7 + base/Makefile | 5 + base/constants.jl | 5 +- base/deprecated.jl | 2 + base/exports.jl | 357 +++++++++++++++++++++++---------------------- base/precompile.jl | 2 + base/sysimg.jl | 6 + 7 files changed, 207 insertions(+), 177 deletions(-) diff --git a/Make.inc b/Make.inc index 7b6725e5fd6b1..8bca557bd7355 100644 --- a/Make.inc +++ b/Make.inc @@ -54,6 +54,9 @@ USE_INTEL_JITEVENTS ?= 0 USEICC ?= 0 USEIFC ?= 0 +# Set to 1 to build a "lite" version of Julia +BUILD_LITE ?= 0 + ifeq ($(USE_MKL), 1) $(warning "The julia make variable USE_MKL has been renamed to USE_INTEL_MKL") USE_INTEL_MKL = 1 @@ -91,7 +94,11 @@ JULIA_COMMIT = $(JULIA_VERSION) endif # Whether to use GPL libraries or not. +ifeq ($(BUILD_LITE), 1) +USE_GPL_LIBS ?= 0 +else USE_GPL_LIBS ?= 1 +endif # Directories where said libraries get installed to prefix ?= $(abspath julia-$(JULIA_COMMIT)) diff --git a/base/Makefile b/base/Makefile index 4deae7c3dcd6c..196b0715e29d2 100644 --- a/base/Makefile +++ b/base/Makefile @@ -54,6 +54,11 @@ ifeq ($(USE_GPL_LIBS), 1) @echo "const USE_GPL_LIBS = true" >> $@ else @echo "const USE_GPL_LIBS = false" >> $@ +endif +ifeq ($(BUILD_LITE), 1) + @echo "const BUILD_LITE = true" >> $@ +else + @echo "const BUILD_LITE = false" >> $@ endif @echo "const libfftw_name = \"$(LIBFFTWNAME)\"" >> $@ @echo "const libfftwf_name = \"$(LIBFFTWFNAME)\"" >> $@ diff --git a/base/constants.jl b/base/constants.jl index dda7b8e39cfee..d3bc9c41cbdee 100644 --- a/base/constants.jl +++ b/base/constants.jl @@ -121,9 +121,12 @@ const golden = φ for T in (MathConst, Rational, Integer, Number) ^(::MathConst{:e}, x::T) = exp(x) end -for T in (Range, BitArray, SparseMatrixCSC, StridedArray, AbstractArray) +for T in (Range, BitArray, StridedArray, AbstractArray) .^(::MathConst{:e}, x::T) = exp(x) end +if !BUILD_LITE + .^(::MathConst{:e}, x::SparseMatrixCSC) = exp(x) +end ^(::MathConst{:e}, x::AbstractMatrix) = expm(x) log(::MathConst{:e}) = 1 # use 1 to correctly promote expressions like log(x)/log(e) diff --git a/base/deprecated.jl b/base/deprecated.jl index 4d2c645230bb4..31237f122ffb5 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -374,8 +374,10 @@ end end # 8898 +if !BUILD_LITE @deprecate precision(x::DateTime) eps(x) @deprecate precision(x::Date) eps(x) +end @deprecate names(t::DataType) fieldnames(t) @deprecate names(v) fieldnames(v) diff --git a/base/exports.jl b/base/exports.jl index c597161bd1d62..84d08107c06f8 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -3,29 +3,20 @@ export # Modules Collections, - FFTW, Meta, Operators, Pkg, Profile, - Dates, Sys, Test, Libc, Libdl, - LinAlg, - BLAS, - LAPACK, Serializer, - SparseMatrix, Docs, Markdown, # Types AbstractMatrix, - AbstractSparseArray, - AbstractSparseMatrix, - AbstractSparseVector, AbstractVector, AbstractVecOrMat, Array, @@ -101,7 +92,6 @@ export SharedArray, SharedMatrix, SharedVector, - SparseMatrixCSC, StatStruct, StepRange, StridedArray, @@ -605,107 +595,6 @@ export vec, zeros, -# linear algebra - bkfact!, - bkfact, - blas_set_num_threads, - blkdiag, - chol, - cholfact!, - cholfact, - cond, - condskeel, - cross, - ctranspose!, - ctranspose, - det, - diag, - diagind, - diagm, - diff, - dot, - eig, - eigfact!, - eigfact, - eigmax, - eigmin, - eigs, - eigvals, - eigvals!, - eigvecs, - expm, - eye, - factorize, - givens, - hessfact!, - hessfact, - isdiag, - ishermitian, - isposdef!, - isposdef, - issym, - istril, - istriu, - kron, - ldltfact, - ldltfact!, - linreg, - logdet, - lu, - lufact!, - lufact, - lyap, - norm, - nullspace, - ordschur!, - ordschur, - peakflops, - pinv, - qr, - qrfact!, - qrfact, - rank, - scale!, - scale, - schur, - schurfact!, - schurfact, - sqrtm, - svd, - svdfact!, - svdfact, - svds, - svdvals!, - svdvals, - sylvester, - trace, - transpose!, - transpose, - tril!, - tril, - triu!, - triu, - vecnorm, - ⋅, - ×, - -# sparse - etree, - full, - issparse, - sparse, - sparsevec, - spdiagm, - speye, - spones, - sprand, - sprandbool, - sprandn, - spzeros, - symperm, - rowvals, - nzrange, - # bitarrays bitpack, bitunpack, @@ -913,66 +802,6 @@ export set_rounding, with_rounding, -# statistics - cor, - cov, - hist, - hist!, - hist2d, - hist2d!, - histrange, - mean!, - mean, - median!, - median, - middle, - midpoints, - quantile!, - quantile, - std, - stdm, - var, - varm, - -# signal processing - bfft!, - bfft, - brfft, - conv, - conv2, - dct!, - dct, - deconv, - fft!, - fft, - fftshift, - filt, - filt!, - idct!, - idct, - ifft!, - ifft, - ifftshift, - irfft, - plan_bfft!, - plan_bfft, - plan_brfft, - plan_dct!, - plan_dct, - plan_fft!, - plan_fft, - plan_idct!, - plan_idct, - plan_ifft!, - plan_ifft, - plan_irfft, - plan_rfft, - rfft, - xcorr, - -# numerical integration - quadgk, - # iteration done, enumerate, @@ -1025,11 +854,6 @@ export toc, toq, -# dates - Date, - DateTime, - now, - # errors assert, backtrace, @@ -1412,3 +1236,184 @@ export @enum, @label, @goto + +export +# modules + FFTW, + Dates, + LinAlg, + BLAS, + LAPACK, + SparseMatrix, + +# Types + AbstractSparseArray, + AbstractSparseMatrix, + AbstractSparseVector, + SparseMatrixCSC, + +# dates + Date, + DateTime, + now, + +# linear algebra + bkfact!, + bkfact, + blas_set_num_threads, + blkdiag, + chol, + cholfact!, + cholfact, + cond, + condskeel, + cross, + ctranspose!, + ctranspose, + det, + diag, + diagind, + diagm, + diff, + dot, + eig, + eigfact!, + eigfact, + eigmax, + eigmin, + eigs, + eigvals, + eigvals!, + eigvecs, + expm, + eye, + factorize, + givens, + hessfact!, + hessfact, + isdiag, + ishermitian, + isposdef!, + isposdef, + issym, + istril, + istriu, + kron, + ldltfact, + ldltfact!, + linreg, + logdet, + lu, + lufact!, + lufact, + lyap, + norm, + nullspace, + ordschur!, + ordschur, + peakflops, + pinv, + qr, + qrfact!, + qrfact, + rank, + scale!, + scale, + schur, + schurfact!, + schurfact, + sqrtm, + svd, + svdfact!, + svdfact, + svds, + svdvals!, + svdvals, + sylvester, + trace, + transpose!, + transpose, + tril!, + tril, + triu!, + triu, + vecnorm, + ⋅, + ×, + +# sparse + etree, + full, + issparse, + sparse, + sparsevec, + spdiagm, + speye, + spones, + sprand, + sprandbool, + sprandn, + spzeros, + symperm, + rowvals, + nzrange, + +# statistics + cor, + cov, + hist, + hist!, + hist2d, + hist2d!, + histrange, + mean!, + mean, + median!, + median, + middle, + midpoints, + quantile!, + quantile, + std, + stdm, + var, + varm, + +# signal processing + bfft!, + bfft, + brfft, + conv, + conv2, + dct!, + dct, + deconv, + fft!, + fft, + fftshift, + filt, + filt!, + idct!, + idct, + ifft!, + ifft, + ifftshift, + irfft, + plan_bfft!, + plan_bfft, + plan_brfft, + plan_dct!, + plan_dct, + plan_fft!, + plan_fft, + plan_idct!, + plan_idct, + plan_ifft!, + plan_ifft, + plan_irfft, + plan_rfft, + rfft, + xcorr, + +# numerical integration + quadgk diff --git a/base/precompile.jl b/base/precompile.jl index dda16ae87fd18..1431558bd7449 100644 --- a/base/precompile.jl +++ b/base/precompile.jl @@ -295,7 +295,9 @@ precompile(Base.next, (Dict{Symbol,Any},Int)) precompile(Base.next, (IntSet, Int)) precompile(Base.next, (UnitRange{Int},Int)) precompile(Base.nextind, (ASCIIString, Int)) +if !BUILD_LITE precompile(Base.nnz, (BitArray{1},)) +end precompile(Base.normpath, (ASCIIString,)) precompile(Base.notify, (Condition, Any)) precompile(Base.notify_empty, (Base.RemoteValue,)) diff --git a/base/sysimg.jl b/base/sysimg.jl index 5d16fd0160052..8290f5ebd4480 100644 --- a/base/sysimg.jl +++ b/base/sysimg.jl @@ -248,6 +248,7 @@ using .Markdown # misc useful functions & macros include("util.jl") +if !BUILD_LITE # dense linear algebra include("linalg.jl") importall .LinAlg @@ -269,6 +270,7 @@ if USE_GPL_LIBS include("dsp.jl") importall .DSP end +end # system information include("sysinfo.jl") @@ -277,9 +279,11 @@ import .Sys.CPU_CORES # mathematical constants include("constants.jl") +if !BUILD_LITE # Numerical integration include("quadgk.jl") importall .QuadGK +end # Fast math include("fastmath.jl") @@ -289,6 +293,7 @@ importall .FastMath include("pkg.jl") const Git = Pkg.Git +if !BUILD_LITE # profiler include("profile.jl") importall .Profile @@ -296,6 +301,7 @@ importall .Profile # dates include("Dates.jl") import .Dates: Date, DateTime, now +end # deprecated functions include("deprecated.jl")