How to Switch Between Different Versions of Julia (Specifically Between V0.3 and V0.4 on Ubuntu)

How do I switch between different versions of Julia (specifically between v0.3 and v0.4 on Ubuntu)?

You can install different versions of Julia in different locations and set separate symlinks.

For example, you could download the v0.3 Linux binaries and install them to one location, then clone the GitHub source for v0.4 and install that in another location. Then set symlinks such as julia3 for v0.3 and julia4 for v0.4.

Run your code like:

$ julia3 somefile.jl
$ julia4 somefile.jl

Installing Julia v0.5 on Ubuntu 16.04 while v0.6 is installed

Firstly, you should really read the post that Reza Afzalan linked. It gives you everything you need to know about how to install. If you prefer a list:

  1. Go to the Julia download page.
  2. Download the Generic Linux Binary for your OS (probably 64-bit for Ubuntu 16).
  3. Install it.
  4. Find where the installed Julia binary executables are stored on your machine.
  5. Symlink Julia v0.5 and Julia v0.6 to different aliases, e.g. julia5 and julia6. You can store the symlinks in a directory like /usr/local/bin.
  6. Open julia5.
  7. Start downloading your packages with Pkg.add.

is there a page detailing incompatibilities between Julia versions

The Julialang/julia/NEWS.md page is used to describe to developers the language changes between the versions.

How to upgrade Julia to a new release?

How to upgrade Julia:

Windows & MacOS & Linux

The most trivial way of upgrading Julia is to go to the download page and manually install corresponding binaries. (UPDATE: if you're on old Julia, e.g. v0.6)If you're going to upgrade Julia to a new minor version(e.g. v0.5=>v0.6), you could easily reinstall your old packages by the following steps(Julia-v1.0 shipped with the new package manager, so there is no such hassle):

  1. julia> using Pkg # Pkg.init() if needed
  2. copy REQUIRE file from package directory of the old version to the new one (in this example from .julia/v0.5 to .julia/v0.6) overwriting the existing file
  3. julia> Pkg.resolve() # or Pkg.update()

MacOS

If you're using Homebrew and homebrew-julia, please follow the instructions here.

Linux

Use abelsiqueira's installer jill.

To OP's Question

1.Pkg.update() is used for updating Julia's packages, not Julia itself, so downloading the prebuild version and reinstalling seems to be the only way to upgrade Julia for now. Or you could build Julia from source following the instructions here.

2.The release notes are listed here:

  • https://github.com/JuliaLang/julia/blob/master/HISTORY.md
  • https://github.com/JuliaLang/julia/blob/master/NEWS.md

Get a warning when I overwrite a function in Julia?

In the context of modules and Base functions, Julia already does warn you if you overwrite a name. See the below examples that work on v0.4.5:

MODULES:

In modA.jl:

module modA

export test

function test()
println("modA")
end
end

In modB.jl:

module modB

export test

function test()
println("modB")
end
end

In REPL:

julia> using modA
julia> using modB
WARNING: Using modB.test in module Main conflicts with an existing identifier
julia> test()
"modA"

BASE FUNCTIONS:

In REPL:

julia> function +(x::Float64, y::Float64)
println("my addition")
end

julia> WARNING: module Main should explicitly import + from Base
WARNING: Method definition +(Float64, Float64) in module Base at float.jl:208
overwritten in module Main at none:2.

As far as I am aware, this does not work with user defined functions; see below:

julia> function test(x::Float64, y::Float64)
println("First Definition")
end

julia> test(1.0, 2.0)
First Definition

julia> function test(x::Float64, y::Float64)
println("Second Definition")
end

julia> test(1.0, 2.0)
Second Definition

Did you have a different context in mind for imported names?



Related Topics



Leave a reply



Submit