Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JuliaLang/julia into jb/kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 18, 2013
2 parents 4fcfe42 + fa89045 commit 3759a22
Show file tree
Hide file tree
Showing 138 changed files with 5,721 additions and 25,491 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
[submodule "deps/openlibm"]
path = deps/openlibm
url = git:https://github.com/JuliaLang/openlibm.git
[submodule "deps/nginx"]
path = deps/nginx
url = git:https://github.com/git-mirror/nginx
[submodule "deps/Rmath"]
path = deps/Rmath
url = git:https://github.com/JuliaLang/Rmath.git
2 changes: 1 addition & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(JULIAHOME)/src/julia.e
JCFLAGS += -D_WIN32_WINNT=0x0600
JCXXFLAGS += -D_WIN32_WINNT=0x0600
LLVM_CONFIG := WINEPATH="$(WINEPATH)" $(LLVM_CONFIG).exe
JLDFLAGS = -Wl,--stack,8388608
JLDFLAGS = -Wl,--stack,8388608 -Wl,--large-address-aware
endif

# MKL
Expand Down
20 changes: 6 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ julia-debug julia-release:
@$(MAKE) $(QUIET_MAKE) -C deps
@$(MAKE) $(QUIET_MAKE) -C src lib$@
@$(MAKE) $(QUIET_MAKE) -C base
@$(MAKE) $(QUIET_MAKE) -C extras
@$(MAKE) $(QUIET_MAKE) -C ui $@
@ln -sf $(BUILD)/bin/$@-$(DEFAULT_REPL) julia

$(BUILD)/share/julia/helpdb.jl: doc/helpdb.jl | $(BUILD)/share/julia
@cp $< $@

# use sys.ji if it exists, otherwise run two stages
$(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji: VERSION base/*.jl base/pkg/*.jl $(BUILD)/share/julia/helpdb.jl
$(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji: VERSION base/*.jl base/pkg/*.jl base/linalg/*.jl $(BUILD)/share/julia/helpdb.jl
@#echo `git rev-parse --short HEAD`-$(OS)-$(ARCH) \(`date +"%Y-%m-%d %H:%M:%S"`\) > COMMIT
$(QUIET_JULIA) cd base && \
(test -f $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji || $(JULIA_EXECUTABLE) -bf sysimg.jl) && $(JULIA_EXECUTABLE) -f sysimg.jl || echo "Note: this error is usually fixed by running 'make clean'. If the error persists, 'make cleanall' may help."
Expand All @@ -55,8 +54,8 @@ JL_PRIVATE_LIBS = amd arpack cholmod colamd fftw3 fftw3f fftw3_threads \
umfpack z openblas

PREFIX ?= julia-$(JULIA_COMMIT)
install: release webrepl
@for subdir in "sbin" "bin" "etc" "libexec" $(JL_LIBDIR) $(JL_PRIVATE_LIBDIR) "share/julia" ; do \
install: release
@for subdir in "bin" "libexec" $(JL_LIBDIR) $(JL_PRIVATE_LIBDIR) "share/julia" "include/julia" ; do \
mkdir -p $(PREFIX)/$$subdir ; \
done
ifeq ($(OS), Darwin)
Expand All @@ -72,11 +71,12 @@ endif
-for suffix in $(JL_PRIVATE_LIBS) ; do \
cp -a $(BUILD)/lib/lib$${suffix}*.$(SHLIB_EXT)* $(PREFIX)/$(JL_PRIVATE_LIBDIR) ; \
done
cp -a $(BUILD)/lib/libuv.a $(PREFIX)/$(JL_PRIVATE_LIBDIR)
cp -a src/julia.h $(BUILD)/include/uv* $(PREFIX)/include/julia
# Copy system image
cp $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji $(PREFIX)/$(JL_PRIVATE_LIBDIR)
# Copy in all .jl sources as well
cp -R -L $(BUILD)/share/julia $(PREFIX)/share/
-cp $(BUILD)/etc/nginx.conf $(PREFIX)/etc/
ifeq ($(OS), WINNT)
-cp $(JULIAHOME)/contrib/windows/* $(PREFIX)
endif
Expand All @@ -91,7 +91,6 @@ ifeq ($(OS), Darwin)
-./contrib/fixup-libgfortran.sh $(PREFIX)/$(JL_PRIVATE_LIBDIR)
endif
ifeq ($(OS), WINNT)
cp -R $(BUILD)/sbin $(PREFIX)
-[ -e dist-extras/7za.exe ] && cp dist-extras/7za.exe $(PREFIX)/bin/7z.exe
-[ -e dist-extras/PortableGit-1.8.0-preview20121022.7z ] && \
mkdir $(PREFIX)/Git && \
Expand All @@ -113,7 +112,6 @@ endif

clean: | $(CLEAN_TARGETS)
@$(MAKE) -C base clean
@$(MAKE) -C extras clean
@$(MAKE) -C src clean
@$(MAKE) -C ui clean
@for buildtype in "release" "debug" ; do \
Expand All @@ -131,7 +129,7 @@ cleanall: clean
# @$(MAKE) -C deps clean-uv

.PHONY: default debug release julia-debug julia-release \
test testall test-* clean cleanall webrepl \
test testall test-* clean cleanall \
run-julia run-julia-debug run-julia-release

test: release
Expand All @@ -143,12 +141,6 @@ testall: release
test-%: release
@$(MAKE) $(QUIET_MAKE) -C test $*

webrepl: all
ifeq ($(USE_SYSTEM_NGINX), 0)
@$(MAKE) $(QUIET_MAKE) -C deps install-nginx
endif
@$(MAKE) -C ui/webserver julia-release

# download target for some hardcoded windows dependencies
.PHONY: win-extras
win-extras:
Expand Down
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Building Julia requires that the following software be installed:
- **[gcc, g++][gcc]** — compiling and linking C, C++
- **[clang][clang]** — clang is the default compiler on OS X (Need at least v3.1, Xcode 4.3.3 on OS X)
- **[gfortran][gcc]** — compiling and linking fortran libraries
- **[git]**contributions and version control.
- **[git]**version control and package management.
- **[perl]** — preprocessing of header files of libraries.
- **[wget]**, **[curl]**, or **fetch** (FreeBSD) — to automatically download external libraries.
- **[m4]** — needed to build GMP.
Expand Down Expand Up @@ -194,7 +194,7 @@ SuiteSparse is a special case, since it is typically only installed as a static
## Directories

base/ source code for Julia's standard library
contrib/ emacs, vim and textmate support for Julia
contrib/ editor support for Julia source, miscellaneous scripts
deps/ external dependencies
examples/ example Julia programs
extras/ useful optional libraries
Expand Down Expand Up @@ -238,16 +238,6 @@ On Linux systems, the `Shift-Enter` binding can be set by placing the following

keysym Return = Return Linefeed

<a name="Web-REPL">
## Web REPL

Julia has a web REPL with very preliminary graphics capabilities. The web REPL is currently a showcase to try out new ideas. The web REPL is social - multiple people signing in with a common session name can collaborate within a session.

1. Do `make webrepl` to build the Julia webserver.
2. Start the web REPL service with `./usr/bin/launch-julia-webserver`.
3. Point your browser to `https://localhost:2000/`.
4. Try `plot(cumsum(randn(1000)))` and other things.

### Try it Online

[Forio.com](https://forio.com/) is generously hosting and maintaining an instance of Julia's web REPL here: [julia.forio.com](https://julia.forio.com).
Expand Down
2 changes: 1 addition & 1 deletion base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ errno_h.jl:
$(QUIET_PERL) echo '#include "errno.h"' | $(CC) -E -dM - | perl -nle 'print "const $$1 = int32($$2)" if /^#define\s+(E\w+)\s+(\d+)\s*$$/' | sort > $@

file_constants.jl: ../src/file_constants.h
$(QUIET_PERL) ${CC} -E -P -DJULIA ../src/file_constants.h | perl -nle 'print "$$1" if /^(\s*const\s+[A-z_]+\s+=\s+[0-9A-z_]+\s*)$$/' > $@
$(QUIET_PERL) ${CC} -E -P -DJULIA ../src/file_constants.h | perl -nle 'print "$$1 0o$$2" if /^(\s*const\s+[A-z_]+\s+=)\s+(0[0-9]*)\s*$$/; print "$$1" if /^\s*(const\s+[A-z_]+\s+=\s+([1-9]|0x)[0-9A-z]*)\s*$$/' > $@

uv_constants.jl: ../src/uv_constants.h
$(QUIET_PERL) ${CC} -E -P -I"../deps/libuv/include" -DJULIA ../src/uv_constants.h | tail -n 5 > $@
Expand Down
15 changes: 5 additions & 10 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ function one{T}(x::AbstractMatrix{T})
eye(T, m)
end


linspace(start::Integer, stop::Integer, n::Integer) =
linspace(float(start), float(stop), n)
function linspace(start::Real, stop::Real, n::Integer)
(start, stop) = promote(start, stop)
T = typeof(start)
Expand All @@ -218,15 +219,9 @@ function linspace(start::Real, stop::Real, n::Integer)
a[1] = start
return a
end
step = (stop-start)/(n-1)
if isa(start,Integer)
for i=1:n
a[i] = iround(T,start+(i-1)*step)
end
else
for i=1:n
a[i] = start+(i-1)*step
end
n -= 1
for i=0:n
a[i+1] = start*((n-i)/n) + stop*(i/n)
end
a
end
Expand Down
2 changes: 1 addition & 1 deletion base/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ end
macro thunk(ex); :(()->$(esc(ex))); end
macro L_str(s); s; end

function compile_hint(f, args::Tuple)
function precompile(f, args::Tuple)
if isgeneric(f)
ccall(:jl_compile_hint, Void, (Any, Any), f, args)
end
Expand Down
3 changes: 1 addition & 2 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ export
# intrinsics module
Intrinsics
#ccall, abs_float, add_float, add_int, and_int, ashr_int,
#box, bswap_int, checked_fptosi32,
#checked_fptosi64, checked_fptoui32, checked_fptoui64, checked_sadd,
#box, bswap_int, checked_fptosi, checked_fptoui, checked_sadd,
#checked_smul, checked_ssub, checked_uadd, checked_umul, checked_usub,
#nan_dom_err, copysign_float, ctlz_int, ctpop_int, cttz_int,
#div_float, eq_float, eq_int, eqfsi64, eqfui64, flipsign_int,
Expand Down
4 changes: 2 additions & 2 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function eval_user_input(ast::ANY, show_value)
println("SYSTEM: show(lasterr) caused an error")
end
iserr, lasterr = true, err
bt = backtrace()
bt = catch_backtrace()
end
end
println()
Expand Down Expand Up @@ -341,7 +341,7 @@ function _start()
run_repl()
end
catch err
display_error(err,backtrace())
display_error(err,catch_backtrace())
println()
exit(1)
end
Expand Down
2 changes: 1 addition & 1 deletion base/darray2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ end
# get array of start indexes for dividing sz into nc chunks
function defaultdist(sz::Int, nc::Int)
if sz >= nc
linspace(1, sz+1, nc+1)
iround(linspace(1, sz+1, nc+1))
else
[[1:(sz+1)], zeros(Int, nc-sz)]
end
Expand Down
12 changes: 12 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,19 @@ for (fun,typ) in {(:randexp,:Exponential), (:randg,:Gamma), (:randbeta,:Beta), (
")
end

const IOString = IOBuffer
export IOString
const PipeString = PipeBuffer
export PipeString

# @spawnlocal deprecated

# 0.2

@deprecate localize localpart
@deprecate expr(hd, a...) Expr(hd, a...)
@deprecate expr(hd, a::Array{Any,1}) Expr(hd, a...)

@deprecate logb exponent
@deprecate ilogb exponent
@deprecate ref_shape index_shape
Expand All @@ -153,6 +161,10 @@ end
@deprecate safe_char(c) (is_valid_char(char(c))||error())&&char(c)
@deprecate check_ascii(x) (is_valid_ascii(x)?x:error())
@deprecate check_utf8(x) (is_valid_utf8(x)?x:error())
@deprecate each_line eachline
@deprecate each_match eachmatch
@deprecate function_loc functionloc
@deprecate compile_hint precompile

# note removed macros: str, B_str, I_str, E_str, L_str, L_mstr, I_mstr, E_mstr

Expand Down
23 changes: 20 additions & 3 deletions base/error.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# pseudo-definitions to show how everything behaves
#
# throw(label, val) = # throw a value to a dynamically enclosing block
#
# function rethrow(val)
# global current_exception = val
# throw(current_handler(), current_exception)
# end
#
# rethrow() = rethrow(current_exception)
#
# function throw(val)
# global catch_backtrace = backtrace()
# rethrow(val)
# end

## native julia error handling ##

error(e::Exception) = throw(e)
Expand All @@ -9,9 +25,10 @@ macro unexpected()
:(error("unexpected branch reached"))
end

rethrow() = ccall(:jl_rethrow, Void, ())
rethrow(e) = ccall(:jl_rethrow_other, Void, (Any,), e)
backtrace() = ccall(:jl_get_backtrace, Array{Any,1}, ())
rethrow() = ccall(:jl_rethrow, Void, ())::None
rethrow(e) = ccall(:jl_rethrow_other, Void, (Any,), e)::None
backtrace() = ccall(:jl_backtrace_from_here, Array{Ptr{Void},1}, ())
catch_backtrace() = ccall(:jl_get_backtrace, Array{Ptr{Void},1}, ())

## system error handling ##

Expand Down
Loading

0 comments on commit 3759a22

Please sign in to comment.