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

允我心安 提交于 2019-12-10 13:00:49

问题


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?


回答1:


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



回答2:


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



来源:https://stackoverflow.com/questions/30785333/how-do-i-switch-between-different-versions-of-julia-specifically-between-v0-3-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!