Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 614
harts12 Avatar asked Jun 11 '15 15:06

harts12


2 Answers

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
like image 199
Alex A. Avatar answered Nov 15 '22 01:11

Alex A.


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

like image 39
Sandri_Nenes Avatar answered Nov 14 '22 23:11

Sandri_Nenes