# Julia 0.6 and 0.7 living together in harmony in one environment

**URL:** <https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343>\
**Category:** General Usage\
**Created:** [February 26, 2018, 3:56pm UTC](https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343 "2018-02-26T15:56:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [February 26, 2018, 3:56pm UTC](https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343/1 "2018-02-26T15:56:31Z")

</div>

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

```julia
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?

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [February 26, 2018, 4:09pm UTC](https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343/2 "2018-02-26T16:09:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [February 26, 2018, 5:11pm UTC](https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343/3 "2018-02-26T17:11:27Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [February 26, 2018, 5:27pm UTC](https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343/4 "2018-02-26T17:27:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [February 26, 2018, 5:37pm UTC](https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343/5 "2018-02-26T17:37:08Z")

</div>

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.

```julia
   _ _ _(_)_ | 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"

```

```julia
   _ _ _(_)_ | 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"

```

```julia
   _ _ _(_)_ | 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"

```

---

<div class="post-metadata">

**Author:** ![John\_Hearns](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_hearns/32/1685_2.png) [@John\_Hearns](https://discourse.julialang.org/u/John_Hearns)\
**Post date:** [February 27, 2018, 3:25pm UTC](https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343/6 "2018-02-27T15:25:49Z")

</div>

This is an ideal case for using software modules.  
[https://lmod.readthedocs.io/en/latest/](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…)

```julia
#%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

```
