Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JuliaLang/julia
Browse files Browse the repository at this point in the history
* 'master' of github.com:JuliaLang/julia:
  Consistently use (c) with lowercase "c".
  Put installation instructions in a separate file.
  We are almost in 2012 now...
  Update copyright.
  In README.md, rename for consistency: test/perf.cxx => test/perf.cpp
  • Loading branch information
StefanKarpinski committed Dec 31, 2011
2 parents f0de485 + 83ccee0 commit 63b89fa
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 135 deletions.
133 changes: 133 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
## Julia Compilation and Installation instructions

<a name="Required-Build-Tools-External-Libraries"/>
## Required Build Tools & External Libraries

- **[GNU make][]** — building dependencies.
- **[gcc, g++, gfortran][gcc]** — compiling and linking C, C++ and Fortran code.
- **[curl][]** — to automatically download external libraries:
- **[LLVM][]** — compiler infrastructure.
- **[fdlibm][]** — a portable implementation of much of the system-dependent libm math library's functionality.
- **[MT][]** — a fast Mersenne Twister pseudorandom number generator library.
- **[OpenBLAS][]** — a fast, open, and maintained [basic linear algebra subprograms (BLAS)](http:https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) library, based on [Kazushige Goto's](http:https://en.wikipedia.org/wiki/Kazushige_Goto) famous [GotoBLAS](http:https://www.tacc.utexas.edu/tacc-projects/gotoblas2/).
- **[LAPACK][]** — a 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.
- **[SuiteSparse][]** - a library of linear algebra routines for sparse matrices
- **[ARPACK][]** — a collection of subroutines designed to solve large, sparse eigenvalue problems.
- **[FFTW][]** — library for computing fast Fourier transforms very quickly and efficiently.
- **[PCRE][]** — Perl-compatible regular expressions library.
- **[GNU readline][]** — library allowing shell-like line editing in the terminal, with history and familiar key bindings.
- **[D3][]** — javascript visualization library.

[GNU make]: http:https://www.gnu.org/software/make/
[gcc]: http:https://gcc.gnu.org/
[curl]: http:https://curl.haxx.se/
[fdlibm]: http:https://www.netlib.org/fdlibm/readme
[MT]: http:https://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
[OpenBLAS]: https://github.com/xianyi/OpenBLAS#readme
[LAPACK]: http:https://www.netlib.org/lapack/
[SuiteSparse]: http:https://www.cise.ufl.edu/research/sparse/SuiteSparse/
[ARPACK]: http:https://www.caam.rice.edu/software/ARPACK/
[FFTW]: http:https://www.fftw.org/
[PCRE]: http:https://www.pcre.org/
[GNU readline]: http:https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
[LLVM]: http:https://www.llvm.org/
[D3]: http:https://mbostock.github.com/d3/

<a name="Supported-Platforms"/>
## Supported Platforms

- **GNU/Linux:** x86/64 (64-bit); x86 (32-bit).
- **Darwin/OS X:** x86/64 (64-bit); x86 (32-bit) is untested but should work.

<a name="Binary-Installation"/>
## Binary Installation

Julia's binary installs ship as platform-specific tarballs:

- **GNU/Linux x86/64:** <https://github.com/downloads/JuliaLang/julia/julia-08b1e294ed-Linux-x86_64.tar.gz>
- **Darwin/OS X x86/64:** <https://github.com/downloads/JuliaLang/julia/julia-08b1e294ed-Darwin-x86_64.tar.gz>
- **GNU/Linux x86:** <https://github.com/downloads/JuliaLang/julia/julia-618b93c22c-Linux-i686.tar.gz>

Download the appropriate tarball and untar it somewhere;
for example, if you are on an OS X (Darwin) x86/64 system, do the following:

curl -OLk https://github.com/downloads/JuliaLang/julia/julia-08b1e294ed-Darwin-x86_64.tar.gz
tar zxvf julia-08b1e294ed-Darwin-x86_64.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:

export PATH="$(pwd)/julia:$PATH"

Now you should be able to run julia like this:

julia

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](https://github.com/JuliaLang/julia/wiki/Getting-Started) in the manual.

<a name="Source-Download-Compilation"/>
## Source Download & Compilation

First, acquire the source code either by cloning the git repository (requires **[git](http:https://git-scm.com/)** to be installed):

git clone git:https://github.com/JuliaLang/julia.git

or, if you don't have git installed, by using curl and tar to fetch and unpack the source:

mkdir julia && curl -Lk https://github.com/JuliaLang/julia/tarball/master | tar -zxf- -C julia --strip-components 1

Next, enter the `julia/` directory and run `make` to build the `julia` executable.
When compiled the first time, it will automatically download and build its [external dependencies](#Required-Build-Tools-External-Libraries).
This takes a while, but only has to be done once.
*Note:* the build process will not work if any of the build directory's parent directories have spaces in their names (this is due to a limitation in GNU make).

Once it is built, 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:

export PATH="$(pwd)/julia:$PATH"

Now you should be able to run julia like this:

julia

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](https://github.com/JuliaLang/julia/wiki/Getting-Started) in the manual.

<a name="Platform-Specific-Notes"/>
### Platform-Specific Notes

On some Linux distributions (for instance Ubuntu 11.10) you may need to change how the readline library is linked. If you get a build error involving readline, try changing the value of `USE_SYSTEM_READLINE` in `Make.inc` to `1`.

On Ubuntu, you may also need to install the package `libncurses5-dev`.

If OpenBLAS fails to build in `getarch_2nd.c`, you need to specify the architecture of your processor in Make.inc.

<a name="Directories"/>
## Directories

attic/ old, now-unused code
contrib/ emacs and textmate support for julia
examples/ example julia programs
external/ external dependencies
install/ used for creating binary installs
j/ source code for julia's standard library
lib/ shared libraries loaded by julia's standard libraries
src/ source for julia language core
test/ unit and function tests for julia itself
ui/ source for various front ends

<a name="Editor-Terminal-Setup"/>
## Editor & Terminal Setup

Julia support is currently available for [Emacs](https://github.com/JuliaLang/julia/tree/master/contrib#Emacs), [Vim](https://github.com/JuliaLang/julia/tree/master/contrib#Vim), and [TextMate](https://github.com/JuliaLang/julia/tree/master/contrib#TextMate).
Support files and instructions for configuring these editors can be found in [`contrib/`](https://github.com/JuliaLang/julia/tree/master/contrib).

Adjusting your terminal bindings is optional; everything will work fine without these key bindings.
For the best interactive session experience, however, make sure that your terminal emulator (`Terminal`, `iTerm`, `xterm`, etc.) sends the `^H` sequence for `Backspace` (delete key) and that the `Shift-Enter` key combination sends a `\n` newline character to distinguish it from just pressing `Enter`, which sends a `\r` carriage return character.
These bindings allow custom readline handlers to trap and correctly deal with these key sequences; other programs will continue behave normally with these bindings.
The first binding makes backspacing through text in the interactive session behave more intuitively.
The second binding allows `Shift-Enter` to insert a newline without evaluating the current expression, even when the current expression is complete.
(Pressing an unmodified `Enter` inserts a newline if the current expression is incomplete, evaluates the expression if it is complete, or shows an error if the syntax is irrecoverably invalid.)

On Linux systems, the `Shift-Enter` binding can be set by placing the following line in the file `.xmodmaprc` in your home directory:

keysym Return = Return Linefeed
5 changes: 3 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Julia is licensed under the MIT License.

Copyright (c) 2009-2011, Jeff Bezanson, Stefan Karpinski, Viral B. Shah, Stephan Boyer
Copyright (c) 2009-2012, Jeff Bezanson, Stefan Karpinski, Viral B. Shah,
Stephan Boyer, George Xing, and others. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -28,7 +29,7 @@ Julia is licensed under the MIT License.
repl-readline.c is licensed under the GNU General Public License Version 2.

repl-readline.c: Julia REPL with readline support.
Copyright (C) 2009-2011, Jeff Bezanson, Stefan Karpinski, Viral B. Shah.
Copyright (c) 2009-2012, Jeff Bezanson, Stefan Karpinski, Viral B. Shah.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
140 changes: 7 additions & 133 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For a more in-depth discussion of the rationale and advantages of Julia over oth
Julia's LLVM-based JIT compiler combined with the language's design allow it to approach and often match the performance of C/C++.
To get a sense of relative performance of Julia compared to other languages that can or could be used for numerical and scientific computing, we've written a small set of micro-benchmarks in a variety of languages.
The source code for the various implementations can be found here:
[C++](https://github.com/JuliaLang/julia/blob/master/test/perf.cxx#L1),
[C++](https://github.com/JuliaLang/julia/blob/master/test/perf.cpp#L1),
[Julia](https://github.com/JuliaLang/julia/blob/master/test/perf.j#L1),
[Python](https://github.com/JuliaLang/julia/blob/master/test/perf.py#L1),
[Matlab/Octave](https://github.com/JuliaLang/julia/blob/master/test/perf.m#L1),
Expand Down Expand Up @@ -101,7 +101,7 @@ end
```

As you can see, the code is quite clear, and should feel familiar to anyone who has programmed in other mathematical languages.
Although C++ beats Julia in the random matrix statistics benchmark by a significant factor, consider how much simpler this code is than the [C++ implementation](https://github.com/JuliaLang/julia/blob/master/test/perf.cxx#L145).
Although C++ beats Julia in the random matrix statistics benchmark by a significant factor, consider how much simpler this code is than the [C++ implementation](https://github.com/JuliaLang/julia/blob/master/test/perf.cpp#L137).
There are more compiler optimizations planned that we hope will close this performance gap in the future.
By design, Julia allows you to range from low-level loop and vector code, up to a high-level programming style, sacrificing some performance, but gaining the ability to express complex algorithms easily.
This continuous spectrum of programming levels is a hallmark of the Julia approach to programming and is very much an intentional feature of the language.
Expand Down Expand Up @@ -141,6 +141,11 @@ See [LICENSE](https://github.com/JuliaLang/julia/blob/master/LICENSE) for the fu
[LGPL]: http:https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License
[BSD]: http:https://en.wikipedia.org/wiki/BSD_licenses

<a name="Installation"/>
## Installation

See detailed instructions for installation in [INSTALL.md](https://github.com/JuliaLang/julia/blob/master/INSTALL.md)

<a name="Resources"/>
## Resources

Expand All @@ -150,134 +155,3 @@ See [LICENSE](https://github.com/JuliaLang/julia/blob/master/LICENSE) for the fu
- **Git clone URL:** <git:https://github.com/JuliaLang/julia.git> (see [below](#Download-Compilation))
- **Documentation:** <https://github.com/JuliaLang/julia/wiki>

<a name="Required-Build-Tools-External-Libraries"/>
## Required Build Tools & External Libraries

- **[GNU make][]** — building dependencies.
- **[gcc, g++, gfortran][gcc]** — compiling and linking C, C++ and Fortran code.
- **[curl][]** — to automatically download external libraries:
- **[LLVM][]** — compiler infrastructure.
- **[fdlibm][]** — a portable implementation of much of the system-dependent libm math library's functionality.
- **[MT][]** — a fast Mersenne Twister pseudorandom number generator library.
- **[OpenBLAS][]** — a fast, open, and maintained [basic linear algebra subprograms (BLAS)](http:https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) library, based on [Kazushige Goto's](http:https://en.wikipedia.org/wiki/Kazushige_Goto) famous [GotoBLAS](http:https://www.tacc.utexas.edu/tacc-projects/gotoblas2/).
- **[LAPACK][]** — a 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.
- **[SuiteSparse][]** - a library of linear algebra routines for sparse matrices
- **[ARPACK][]** — a collection of subroutines designed to solve large, sparse eigenvalue problems.
- **[FFTW][]** — library for computing fast Fourier transforms very quickly and efficiently.
- **[PCRE][]** — Perl-compatible regular expressions library.
- **[GNU readline][]** — library allowing shell-like line editing in the terminal, with history and familiar key bindings.
- **[D3][]** — javascript visualization library.

[GNU make]: http:https://www.gnu.org/software/make/
[gcc]: http:https://gcc.gnu.org/
[curl]: http:https://curl.haxx.se/
[fdlibm]: http:https://www.netlib.org/fdlibm/readme
[MT]: http:https://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
[OpenBLAS]: https://github.com/xianyi/OpenBLAS#readme
[LAPACK]: http:https://www.netlib.org/lapack/
[SuiteSparse]: http:https://www.cise.ufl.edu/research/sparse/SuiteSparse/
[ARPACK]: http:https://www.caam.rice.edu/software/ARPACK/
[FFTW]: http:https://www.fftw.org/
[PCRE]: http:https://www.pcre.org/
[GNU readline]: http:https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
[LLVM]: http:https://www.llvm.org/
[D3]: http:https://mbostock.github.com/d3/

<a name="Supported-Platforms"/>
## Supported Platforms

- **GNU/Linux:** x86/64 (64-bit); x86 (32-bit).
- **Darwin/OS X:** x86/64 (64-bit); x86 (32-bit) is untested but should work.

<a name="Binary-Installation"/>
## Binary Installation

Julia's binary installs ship as platform-specific tarballs:

- **GNU/Linux x86/64:** <https://github.com/downloads/JuliaLang/julia/julia-08b1e294ed-Linux-x86_64.tar.gz>
- **Darwin/OS X x86/64:** <https://github.com/downloads/JuliaLang/julia/julia-08b1e294ed-Darwin-x86_64.tar.gz>
- **GNU/Linux x86:** <https://github.com/downloads/JuliaLang/julia/julia-618b93c22c-Linux-i686.tar.gz>

Download the appropriate tarball and untar it somewhere;
for example, if you are on an OS X (Darwin) x86/64 system, do the following:

curl -OLk https://github.com/downloads/JuliaLang/julia/julia-08b1e294ed-Darwin-x86_64.tar.gz
tar zxvf julia-08b1e294ed-Darwin-x86_64.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:

export PATH="$(pwd)/julia:$PATH"

Now you should be able to run julia like this:

julia

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](https://github.com/JuliaLang/julia/wiki/Getting-Started) in the manual.

<a name="Source-Download-Compilation"/>
## Source Download & Compilation

First, acquire the source code either by cloning the git repository (requires **[git](http:https://git-scm.com/)** to be installed):

git clone git:https://github.com/JuliaLang/julia.git

or, if you don't have git installed, by using curl and tar to fetch and unpack the source:

mkdir julia && curl -Lk https://github.com/JuliaLang/julia/tarball/master | tar -zxf- -C julia --strip-components 1

Next, enter the `julia/` directory and run `make` to build the `julia` executable.
When compiled the first time, it will automatically download and build its [external dependencies](#Required-Build-Tools-External-Libraries).
This takes a while, but only has to be done once.
*Note:* the build process will not work if any of the build directory's parent directories have spaces in their names (this is due to a limitation in GNU make).

Once it is built, 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:

export PATH="$(pwd)/julia:$PATH"

Now you should be able to run julia like this:

julia

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](https://github.com/JuliaLang/julia/wiki/Getting-Started) in the manual.

<a name="Platform-Specific-Notes"/>
### Platform-Specific Notes

On some Linux distributions (for instance Ubuntu 11.10) you may need to change how the readline library is linked. If you get a build error involving readline, try changing the value of `USE_SYSTEM_READLINE` in `Make.inc` to `1`.

On Ubuntu, you may also need to install the package `libncurses5-dev`.

If OpenBLAS fails to build in `getarch_2nd.c`, you need to specify the architecture of your processor in Make.inc.

<a name="Directories"/>
## Directories

attic/ old, now-unused code
contrib/ emacs and textmate support for julia
examples/ example julia programs
external/ external dependencies
install/ used for creating binary installs
j/ source code for julia's standard library
lib/ shared libraries loaded by julia's standard libraries
src/ source for julia language core
test/ unit and function tests for julia itself
ui/ source for various front ends

<a name="Editor-Terminal-Setup"/>
## Editor & Terminal Setup

Julia support is currently available for [Emacs](https://github.com/JuliaLang/julia/tree/master/contrib#Emacs), [Vim](https://github.com/JuliaLang/julia/tree/master/contrib#Vim), and [TextMate](https://github.com/JuliaLang/julia/tree/master/contrib#TextMate).
Support files and instructions for configuring these editors can be found in [`contrib/`](https://github.com/JuliaLang/julia/tree/master/contrib).

Adjusting your terminal bindings is optional; everything will work fine without these key bindings.
For the best interactive session experience, however, make sure that your terminal emulator (`Terminal`, `iTerm`, `xterm`, etc.) sends the `^H` sequence for `Backspace` (delete key) and that the `Shift-Enter` key combination sends a `\n` newline character to distinguish it from just pressing `Enter`, which sends a `\r` carriage return character.
These bindings allow custom readline handlers to trap and correctly deal with these key sequences; other programs will continue behave normally with these bindings.
The first binding makes backspacing through text in the interactive session behave more intuitively.
The second binding allows `Shift-Enter` to insert a newline without evaluating the current expression, even when the current expression is complete.
(Pressing an unmodified `Enter` inserts a newline if the current expression is incomplete, evaluates the expression if it is complete, or shows an error if the syntax is irrecoverably invalid.)

On Linux systems, the `Shift-Enter` binding can be set by placing the following line in the file `.xmodmaprc` in your home directory:

keysym Return = Return Linefeed

0 comments on commit 63b89fa

Please sign in to comment.