Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Julia 1.0 Programming

You're reading from   Julia 1.0 Programming Dynamic and high-performance programming to build fast scientific applications

Arrow left icon
Product type Paperback
Published in Sep 2018
Publisher
ISBN-13 9781788999090
Length 196 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ivo Balbaert Ivo Balbaert
Author Profile Icon Ivo Balbaert
Ivo Balbaert
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Installing the Julia Platform FREE CHAPTER 2. Variables, Types, and Operations 3. Functions 4. Control Flow 5. Collection Types 6. More on Types, Methods, and Modules 7. Metaprogramming in Julia 8. I/O, Networking, and Parallel Computing 9. Running External Programs 10. The Standard Library and Packages 11. Other Books You May Enjoy

Installing Julia

The Julia platform, in binary (that is, executable) form, can be downloaded from http://julialang.org/downloads/. It exists for three major platforms (Windows, Linux, and OS X) in 32- and 64-bit format, and it is delivered as a package or in an archive version. FreeBSD 64-bit is also supported.

You should use the current official stable release when doing serious professional work with Julia. At the time of writing, Julia has reached its version 1.0 production release. The previous link contains detailed and platform-specific instructions for the installation. We will not repeat these instructions here completely, but we will summarize some important points.

Windows OS

Keep in mind that your Windows OS must be version 7 or higher. Now, follow the steps shown here:

  1. Download the julia-n.m.p-win64.exe file into a temporary folder (n.m.p is the version number, such as 0.7.0 or 0.1.0; win32/win64 are the 32- and 64-bit versions, respectively; a release candidate file looks like julia-1.0.0-rc1-nnnnnnn-win64 (where nnnnnnn is a checksum number such as 0480f1b)).
  2. Double-click on the file (or right-click and select Run as Administrator if you want Julia installed for all users on the machine). Click OK on the security dialog message. Then, choose the installation directory (for example, for C:\julia, the default installation folder is: C:\Users\UserName\AppData\Local\Julia-n.m.p (where n.m.p is the version number)) and the setup program will extract the archive into the chosen folder, producing the following directory structure, and taking some 800 MB of disk space:
The Julia folder structure in Windows
  1. A menu shortcut will be created which, when clicked, starts the Julia command-line version or Read Evaluate Print Loop (REPL), as shown in the following screenshot:
The Julia REPL
  1. On Windows, if you have chosen C:\Julia as your installation directory, this is the C:\Julia\bin\julia.exe file. Add C:\Julia\bin to your PATH variable if you want the REPL to be available on any command window.
  2. More information on Julia's installation for the Windows OS can be found at https://github.com/JuliaLang/julia/blob/master/README.windows.md.

OS X

Installation for OS X is straightforward, and can be done using the standard software installation tools for the platform. Add /Applications/Julia-n.m.app/Contents/Resources/julia/bin/Julia to make Julia available everywhere on your computer.

Linux OS

Generic Linux binaries for x86 can be downloaded. This will get you a compressed tar.gz archive that will have a name similar to julia-1.0-linux-x86_64.tar.gz, for example, in your ~/Downloads directory in Ubuntu. Open up a Terminal window and navigate to the Downloads directory using cd Downloads. Move the tar.gz file to a directory of your choice, and then extract the tar.gz file using the tar -zxvf julia-1.0-linux-x86_64.tar.gz command. A directory with the extracted contents will be generated in the same parent directory as the compressed archive with a name similar to julia-n.m.p, where n.m.p is Julia's version number.

This is the directory from which Julia will be run; no further installation is needed. To run it, simply navigate to the julia-n.m.p\bin directory in your Terminal and type: ./julia.

If you want to be at the bleeding edge of development, you can download the nightly builds instead of the stable releases from https://julialang.org/downloads/nightlies.html. The nightly builds are generally less stable, but will contain the most recent features. They are available for Windows, Linux, and OS X.

The path to the Julia executable is contained in the environment variable, JULIA_BINDIR (for example, in our installation procedure, this was C:\Julia\bin on Windows).

If you want code to be run whenever you start a Julia session, put it in /home/.juliarc.jl on Ubuntu, ~/.juliarc.jl on OS X, or C:\Users\username\.juliarc.jl on Windows.

Building from source

Download the source code, rather than the binaries, if you intend to contribute to the development of Julia itself, or if no Julia binaries are provided for your operating system or particular computer architecture. The Julia source code can be found on GitHub at https://github.com/JuliaLang/julia.git. Compiling the source code will get you the latest Julia version, not the stable version (if you want the latter, download the binaries, and refer to the previous section).

Because of the diversity of platforms and the possible issues involved, we refer you to https://github.com/JuliaLang/julia, and in that, the Source Download and Compilation section.

JuliaPro

Another alternative is JuliaPro, which is available from https://juliacomputing.com/products/juliapro.html. This is an Anaconda-style Julia repository, which, at present, is only up to version 0.6.4. It does come with about 200+ verified ready-to-go packages, and is a very good way for beginners to start. JuliaPro version 1.0 will probably become available after some time.

There are two ways of using Julia. As described in the previous section, we can use the Julia shell for interactive work. Alternatively, we can write programs in a text file, save them with a .jl extension, and let Julia execute the program by starting it by running julia program.jl.

You have been reading a chapter from
Julia 1.0 Programming - Second Edition
Published in: Sep 2018
Publisher:
ISBN-13: 9781788999090
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime