7

I am working on some projects using Julia v0.3. However, I'd like to test my code in both v0.3 and v0.4 (since some of the people that are going to be using it are already using v0.4). I'm running Ubuntu 14.04 and have installed Julia using apt-get. I know v0.4 is available through the PPA julianightlies, but if I add this, v0.3 is replaced. Is there a way I can install and quickly switch between both versions for testing purposes?

harts12
  • 245
  • 2
  • 9
  • 2
    Install v0.3 using binaries from the site, install 0.4 from GitHub source in a different location, set your bash preferences so that `julia4` and `julia3` invoke the separate versions. – Alex A. Jun 11 '15 at 18:04
  • 2
    Use the `Generic Linux Binaries`. They come with an executable which you can alias or symlink something to. – Zach Jun 11 '15 at 18:25
  • @AlexA. I'm feeling a little sheepish that I didn't think about getting 0.4 direct from GitHub instead of the PPA. – harts12 Jun 11 '15 at 21:31
  • @harts12: It happens. :) If the approach I mentioned in my comment ends up working for you I'll post it as an answer. – Alex A. Jun 11 '15 at 21:32
  • @AlexA.: Go for it. I kept the v0.3 install from apt-get, and then followed your suggestion for v0.4, adding a `julia4` sym link to the compiled executable from GitHub in /usr/local/bin. I just left v0.3 as `julia`. – harts12 Jun 11 '15 at 23:42

2 Answers2

6

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
Alex A.
  • 5,466
  • 4
  • 26
  • 56
1

Install by compiling and then change your she-bang in the start of the file as

#!/path_to/julia3

or

#!/path_to/julia4

That will do the trick

Sandri_Nenes
  • 153
  • 8