Julia 0.6 and 0.7 living together in harmony in one environment

Currently they are not doing this. I have Julia 0.7 installed with JULIA_BINDIR set and its libraries added to the LD_LIBRARY_PATH and it’s working just fine. I have Julia 0.6 installed elsewhere with an alias to its executable and its libraries are also added to LD_LIBRARY_PATH (is that part even necessary?). On trying to launch Julia 0.6 I get

ERROR: could not load library "/opt/julia/lib/julia/sys.so"
/opt/julia/bin/../lib/libjulia.so.0.7: symbol LLVMInitializeAMDGPUTargetMC, version JL_LLVM_3.9 not defined in file libLLVM-3.9.so with link time reference

It’s looking in the wrong directory: I have Julia 0.6 in /opt/julia0p6, Julia 0.7 is in /opt/julia. Funny thing is, I could have sworn I did the same thing on another machine and it worked just fine. Anyway, is it looking in the wrong path because of JULIA_BINDIR?

How do I fix this so that I can use both versions?

This is probably not the “correct” solution, but I solved this by exporting JULIA_BINDIR as the binary directory for 0.7 and JULIA_HOME as the binary directory for 0.6. Happily 0.7 does not throw the deprecation warning about JULIA_HOME when this is done.

I don’t think it’s necessary to add Julia’s libraries to LD_LIBRARY_PATH, and I would certainly expect problems from trying to add two versions of Julia to that path.

I currently have Julia v0.3, v0.4, v0.5, v0.6, and v0.7 installed on my Ubuntu machine and they have no issues coexisting. I’ve just downloaded each one to a folder in my home directory and done:

sudo ln -s /home/apps/julia-xx/bin/julia /usr/local/bin/julia-xx
1 Like

Confirmed, you don’t need to set LD_LIBRARY_PATH. I think the reason I was doing that had something to do with pyjulia. It wasn’t the cause of the problem, however.

You also shouldn’t need to set JULIA_HOME or JULIA_BINDIR to anything. Julia will automatically pick up its home from wherever the binary lives if those environment variables are not set. e.g.

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.2 (2017-05-06 16:34 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-pc-linux-gnu

julia> JULIA_HOME
"/home/rdeits/apps/julia-0.5.2/bin"
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.2 (2017-12-13 18:08 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-pc-linux-gnu

julia> JULIA_HOME
"/home/rdeits/apps/julia-0.6.2/bin"
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.3740 (2018-02-07 15:44 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit e87982096a (19 days old master)
|__/                   |  x86_64-pc-linux-gnu

julia> Sys.BINDIR
"/home/rdeits/apps/julia-0.7-e87982096a/bin"
1 Like

This is an ideal case for using software modules.
https://lmod.readthedocs.io/en/latest/

Modules are the de facto way in which HPC sites manage multiple versions of software packages.
I have modules for 0.5 and 0.6 on my cluster. I could add 0.7 for a trial if this is of interest.
Or give anyone some coaching in getting Modules set up.

(ps - how should I highligh a code block? Sorry…)

#%Module1.0#######################################################################
## hwloc modulefile
##
proc ModulesHelp { } {

        puts stderr "\tAdds the Julia language to your environment"
}

module-whatis   "Adds Julia to your environment"

setenv             JULIA_HOME /pscratch/jhearns/julia-903644385b/bin
setenv             JULIA_PKGDIR /pscratch/jhearns/.julia
setenv             JULIA_HISTORY /pscratch/jhearns/.julia_history
setenv             JULIA_LOAD_PATH /pscratch/jhearns/julia-903644385b/lib/julia

prepend-path     PATH         /pscratch/jhearns/julia-903644385b/bin