Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JuliaLang/julia
Browse files Browse the repository at this point in the history
Conflicts:
	Makefile
	base/client.jl
	base/file.jl
	base/multi.jl
	base/show.jl
	base/stat.jl
	base/sysimg.jl
	base/version.jl
	deps/Makefile
	src/ccall.cpp
	src/gf.c
	test/runtests.jl
	ui/Makefile
	ui/webserver/Makefile
  • Loading branch information
vtjnash committed Jan 2, 2013
2 parents c2393f9 + 9195df4 commit 96a97d8
Show file tree
Hide file tree
Showing 151 changed files with 8,595 additions and 3,517 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Julia now has a [package manager](https://github.com/JuliaLang/METADATA.jl). Mos

The Julia team uses [GitHub issues](https://github.com/JuliaLang/julia/issues) to track and discuss problems, feature requests, and pull requests.

You can make pull requests for incomplete features to get code review. The convention is to prefix the pull request title with "WIP:" or "RFC:" as appropriate to indicate that the work is incomplete, so that it is not accidentally merged.
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.

Before submitting, make sure that all tests pass by running `make testall`. Add your own tests for the new functionality in `test/`. If your contribution includes changes to Makefiles or external dependencies, make sure you can build Julia from a clean tree using `git clean -fdx` or equivalent (be careful – this command will delete any files lying around that aren't checked into git). Make sure that [Travis](http:https://www.travis-ci.org) greenlights the pull request with a `Good to merge` message.

Expand Down
1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ External libraries, if used, include their own licenses:
- [DOUBLE-CONVERSION](https://code.google.com/p/double-conversion/)
- [DSFMT](http:https://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/LICENSE.txt)
- [OPENLIBM](https://github.com/JuliaLang/openlibm/blob/master/LICENSE.md)
- [FADDEEVA](http:https://ab-initio.mit.edu/Faddeeva)
- [FEMTOLISP](https://github.com/JeffBezanson/femtolisp)
- [FFTW](http:https://fftw.org/doc/License-and-Copyright.html)
- [GLPK](http:https://www.gnu.org/software/glpk)
Expand Down
67 changes: 48 additions & 19 deletions Make.inc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# -*- mode: makefile-gmake -*-

# include twice to pickup user definitions
-include $(JULIAHOME)/Make.user

JULIA_VERSION = $(shell cat $(JULIAHOME)/VERSION)
JULIA_COMMIT = $(shell git rev-parse --short=10 HEAD)

USR = $(JULIAHOME)/usr
USRBIN = $(USR)/bin
USRINC = $(USR)/include
LLVMROOT = $(USR)
BUILD = $(USR)
LLVMROOT = $(BUILD)
BUILD = $(JULIAHOME)/usr

# List of "private" libraries, e.g. ones that get installed to lib/julia
JL_PRIVATE_LIBS = Rmath openlibm julia-release suitesparse_wrapper tk_wrapper gmp_wrapper glpk_wrapper random
Expand All @@ -24,9 +24,33 @@ JL_PRIVATE_LIBDIR = lib/$(MULTIARCH)/julia
JL_LIBDIR = lib/$(MULTIARCH)/
endif

OS = $(shell uname)
# Cross-compile
#HOST = i686-w64-mingw32

ifeq ($(HOST),)
CROSS_COMPILE=
else
ifeq ($(HOST),i686-w64-mingw32)
override OS = WINNT
override ARCH = i686
#override OPENBLAS_DYNAMIC_ARCH = 1
override CROSS_COMPILE=$(HOST)-
export WINEPATH := $(BUILD)/lib;$(shell $(CROSS_COMPILE)gcc -print-search-dirs | grep programs | sed 's/^programs: =https://' | sed 's/:/;/g');$(WINEPATH)
else
$(error "unknown HOST variable set")
endif
endif

# Figure out OS and architecture
BUILD_OS = $(shell uname)
OS = $(BUILD_OS)
ARCH = $(shell uname -m)

# Use 64-bit libraries by default on 64-bit architectures
ifeq ($(ARCH), x86_64)
USE_LIB64 = 1
endif

USE_MKL = 0
MKLLIB = /path/to/mkl/lib/intel64

Expand All @@ -53,9 +77,6 @@ USE_COPY_STACKS = 1

# Compiler specific stuff

FC = gfortran
JFFLAGS = -O2 $(fPIC)

ifeq ($(CC), clang)
USEGCC = 0
USECLANG = 1
Expand All @@ -76,8 +97,8 @@ endif
endif

ifeq ($(USEGCC),1)
CC = gcc
CXX = g++
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
JCFLAGS = -std=gnu99 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
JCXXFLAGS = -pipe $(fPIC) -fno-rtti
DEBUGFLAGS = -ggdb3 -DDEBUG
Expand All @@ -88,8 +109,8 @@ endif
endif

ifeq ($(USECLANG),1)
CC = clang
CXX = clang++
CC = $(CROSS_COMPILE)clang
CXX = $(CROSS_COMPILE)clang++
JCFLAGS = -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
JCXXFLAGS = -pipe $(fPIC) -fno-rtti
DEBUGFLAGS = -g -DDEBUG
Expand All @@ -101,6 +122,14 @@ JCFLAGS += -D_LARGEFILE_SOURCE -D_DARWIN_USE_64_BIT_INODE=1
endif
endif

FC = $(CROSS_COMPILE)gfortran
JFFLAGS = -O2 $(fPIC)
CPP = $(CC) -E
AR := $(CROSS_COMPILE)ar
AS := $(CROSS_COMPILE)as
LD := $(CROSS_COMPILE)ld
RANLIB := $(CROSS_COMPILE)ranlib

# if not absolute, then relative to JULIA_HOME
JCFLAGS += '-DJL_SYSTEM_IMAGE_PATH="../$(JL_PRIVATE_LIBDIR)/sys.ji"'

Expand Down Expand Up @@ -149,7 +178,7 @@ endif
ifeq ($(USE_SYSTEM_LIBUNWIND), 1)
LIBUNWIND=-lunwind-generic -lunwind
else
LIBUNWIND=$(USR)/lib/libunwind-generic.a $(USR)/lib/libunwind.a
LIBUNWIND=$(BUILD)/lib/libunwind-generic.a $(BUILD)/lib/libunwind.a
endif

ifeq ($(USE_SYSTEM_LLVM), 1)
Expand All @@ -161,19 +190,19 @@ endif
ifeq ($(USE_SYSTEM_READLINE), 1)
READLINE = -lreadline
else
READLINE = $(USR)/lib/libreadline.a
READLINE = $(BUILD)/lib/libreadline.a
endif

ifneq ($(OS),WINNT)
READLINE += -lncurses
else
READLINE += $(USR)/lib/libhistory.a
READLINE += $(BUILD)/lib/libhistory.a
endif

ifeq ($(USE_SYSTEM_PCRE), 1)
PCRE_CONFIG = pcre-config
else
PCRE_CONFIG = $(USRBIN)/pcre-config
PCRE_CONFIG = $(BUILD)/bin/pcre-config
endif

ifeq ($(USE_SYSTEM_BLAS), 1)
Expand All @@ -185,7 +214,7 @@ LIBBLAS = -lblas
LIBBLASNAME = libblas
endif
else
LIBBLAS = -L$(USR)/lib -lopenblas
LIBBLAS = -L$(BUILD)/lib -lopenblas
LIBBLASNAME = libopenblas
endif

Expand Down Expand Up @@ -307,7 +336,7 @@ $$(abspath $(1)):
@mkdir -p $$@
endef

ifeq ($(OS), WINNT)
ifeq ($(BUILD_OS), WINNT)
define mingw_to_dos
$(subst /,\\,$(subst $(shell $(2) pwd),$(shell $(2) cmd //C cd),$(abspath $(1))))
endef
Expand Down
38 changes: 23 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ DIRS = $(BUILD)/bin $(BUILD)/lib $(BUILD)/$(JL_PRIVATE_LIBDIR) $(BUILD)/share/ju
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
$(foreach link,extras base test doc examples ui,$(eval $(call symlink_target,$(link),$(BUILD)/share/julia)))

MAKEs = $(MAKE)
QUIET_MAKE =
ifeq ($(USE_QUIET), 1)
MAKEs += -s
QUIET_MAKE = -s
endif

debug release: | $(DIRS) $(BUILD)/share/julia/extras $(BUILD)/share/julia/base $(BUILD)/share/julia/test $(BUILD)/share/julia/doc $(BUILD)/share/julia/examples $(BUILD)/share/julia/ui
@$(MAKEs) julia-$@
@$(MAKE) $(QUIET_MAKE) julia-$@
@export JL_PRIVATE_LIBDIR=$(JL_PRIVATE_LIBDIR) && \
$(MAKEs) LD_LIBRARY_PATH=$(BUILD)/lib JULIA_EXECUTABLE=$(JULIA_EXECUTABLE_$@) $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji
$(MAKE) $(QUIET_MAKE) LD_LIBRARY_PATH=$(BUILD)/lib JULIA_EXECUTABLE=$(JULIA_EXECUTABLE_$@) $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji

julia-debug julia-release:
@-git submodule update
@$(MAKEs) -C deps
@$(MAKEs) -C src lib$@
@$(MAKEs) -C base
@$(MAKEs) -C extras
@$(MAKEs) -C ui $@
@$(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
Expand All @@ -42,8 +42,8 @@ JL_LIBS = julia-release julia-debug
# private libraries, that are installed in $(PREFIX)/lib/julia
JL_PRIVATE_LIBS = amd arpack cholmod colamd fftw3 fftw3f fftw3_threads \
fftw3f_threads glpk glpk_wrapper gmp gmp_wrapper grisu \
history openlibm pcre random readline Rmath spqr \
suitesparse_wrapper tk_wrapper umfpack z openblas
history Faddeeva_wrapper openlibm pcre random readline \
Rmath spqr suitesparse_wrapper tk_wrapper umfpack z openblas

PREFIX ?= julia-$(JULIA_COMMIT)
install: release
Expand All @@ -70,6 +70,8 @@ ifeq ($(shell uname),MINGW32_NT-6.1)
-for dllname in "libgfortran-3" "libquadmath-0" "libgcc_s_dw2-1" "libstdc++-6,pthreadgc2" ; do \
cp /mingw/bin/$${dllname}.dll $(PREFIX)/$(JL_LIBDIR) ; \
done
else
@echo 'Warning: system libraries "libgfortran-3" "libquadmath-0" "libgcc_s_dw2-1" "libstdc++-6,pthreadgc2" not included in install'
endif
endif

Expand All @@ -96,6 +98,7 @@ clean: | $(CLEAN_TARGETS)
rm -f julia-$${buildtype}-$${repltype}; \
done \
done
@rm -f julia
@rm -f *~ *# *.tar.gz
@rm -fr $(BUILD)/$(JL_PRIVATE_LIBDIR)

Expand All @@ -105,13 +108,18 @@ cleanall: clean
# @$(MAKE) -C deps clean-uv

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

test: release
@$(MAKEs) -C test default
@$(MAKE) $(QUIET_MAKE) -C test default

testall: release
@$(MAKEs) -C test all
@$(MAKE) $(QUIET_MAKE) -C test all

test-%: release
@$(MAKEs) -C test $*
@$(MAKE) $(QUIET_MAKE) -C test $*

webrepl:
make -C deps install-lighttpd
make -C ui/webserver

12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This is the GitHub repository of Julia source code, including instructions for c
<a name="Resources"/>

- **Homepage:** <http:https://julialang.org>
- **Binaries:** <https:https://github.com/JuliaLang/julia/downloads>
- **Binaries:** <http:https://code.google.com/p/julialang/downloads/list>
- **Packages:** <https://github.com/JuliaLang/METADATA.jl>
- **Mailing lists:** <http:https://julialang.org/mailing_lists>
- **IRC:** <http:https://webchat.freenode.net/?channels=julia>
Expand Down Expand Up @@ -202,11 +202,6 @@ SuiteSparse is a special case, since it is typically only installed as a static
## Binary Installation

Because of the rapid pace of development at this point, we recommend installing the latest Julia from source, but platform-specific tarballs with pre-compiled binaries are also [available for download](https://github.com/JuliaLang/julia/downloads).
To install from source, download the appropriate tarball and untar it somewhere.
For example, if you are on an OS X (Darwin) x86/64 system, do the following:

wget https://github.com/downloads/JuliaLang/julia/julia-c4865bd18d-Darwin-i386.tar.gz
tar zxvf julia-c4865bd18d-Darwin-i386.tar.gz

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):

Expand All @@ -219,7 +214,8 @@ Now you should be able to run julia like this:
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:https://julialang.org/manual/getting-started) in the manual.

An [Arch Linux package](https://aur.archlinux.org/packages.php?ID=56877) is also available.
An [Arch Linux package](https://aur.archlinux.org/packages.php?ID=56877) is also available. Julia has also been added to [Debian](http:https://packages.debian.org/sid/julia). On OS X, julia is available through [homebrew](http:https://mxcl.github.com/homebrew/).


<a name="Editor-Terminal-Setup"/>
## Editor & Terminal Setup
Expand All @@ -242,7 +238,7 @@ On Linux systems, the `Shift-Enter` binding can be set by placing the following

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 -C deps install-lighttpd` to download and build the webserver.
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 `http:https://localhost:2000/`.
4. Try `plot(cumsum(randn(1000)))` and other things.
Expand Down
8 changes: 7 additions & 1 deletion base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PCRE_CONST = 0x[0-9a-fA-F]+|[-+]?\s*[0-9]+
all: pcre_h.jl errno_h.jl build_h.jl file_constants.jl

pcre_h.jl:
$(QUIET_PERL) $(CC) -E -dM $(shell $(PCRE_CONFIG) --prefix)/include/pcre.h | perl -nle '/^\s*#define\s+PCRE_(\w*)\s*\(?($(PCRE_CONST))\)?\s*$$/ and print "const $$1 = int32($$2)"' | sort > $@
$(QUIET_PERL) $(CPP) -dM $(shell $(PCRE_CONFIG) --prefix)/include/pcre.h | perl -nle '/^\s*#define\s+PCRE_(\w*)\s*\(?($(PCRE_CONST))\)?\s*$$/ and print "const $$1 = uint32($$2)"' | sort > $@

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 > $@
Expand All @@ -18,6 +18,12 @@ build_h.jl: ../Make.inc ../src/os_detect.h
$(QUIET_PERL) $(CC) -E -P -DJULIA ../src/os_detect.h | grep OS_NAME > $@
@echo "const libblas_name = \"$(LIBBLASNAME)\"" >> $@
@echo "const liblapack_name = \"$(LIBLAPACKNAME)\"" >> $@
ifeq ($(USE_LIB64), 1)
@echo "const USE_LIB64 = true" >> $@
else
@echo "const USE_LIB64 = false" >> $@
endif


clean:
rm -f *# *~
Expand Down
Loading

0 comments on commit 96a97d8

Please sign in to comment.