Bureaucrats, cc_docs_admin, cc_staff
2,879
edits
(add translate tags, remove Draft) |
(Marked this version for translation) |
||
Line 2: | Line 2: | ||
<translate> | <translate> | ||
<!--T:1--> | |||
[[Category:Software]] | [[Category:Software]] | ||
<!--T:2--> | |||
[https://julialang.org Julia] is a programming language that was designed from the beginning for performance, ease of use and portability. It is is available as a [[Utiliser_des_modules/en | module]] on Compute Canada clusters. | [https://julialang.org Julia] is a programming language that was designed from the beginning for performance, ease of use and portability. It is is available as a [[Utiliser_des_modules/en | module]] on Compute Canada clusters. | ||
= Compiling packages = | = Compiling packages = <!--T:3--> | ||
<!--T:4--> | |||
When compiling packages for Julia, files will normally be added to <code>~/.julia</code>. However, you may run into problems if the package depends on system-provided libraries. For instance, [https://github.com/JuliaIO/JLD.jl JLD] depends on a system-provided HDF5 library. On a personal computer, Julia attempts to install such a dependency using [https://en.wikipedia.org/wiki/Yum_(software) yum] or [https://en.wikipedia.org/wiki/APT_(Debian) apt] with [https://en.wikipedia.org/wiki/Sudo sudo]. This will not work on a Compute Canada cluster; instead, some extra information must be provided to allow Julia's package manager (Pkg) to find the HDF5 library. | When compiling packages for Julia, files will normally be added to <code>~/.julia</code>. However, you may run into problems if the package depends on system-provided libraries. For instance, [https://github.com/JuliaIO/JLD.jl JLD] depends on a system-provided HDF5 library. On a personal computer, Julia attempts to install such a dependency using [https://en.wikipedia.org/wiki/Yum_(software) yum] or [https://en.wikipedia.org/wiki/APT_(Debian) apt] with [https://en.wikipedia.org/wiki/Sudo sudo]. This will not work on a Compute Canada cluster; instead, some extra information must be provided to allow Julia's package manager (Pkg) to find the HDF5 library. | ||
[hahn@gra-login2 ~]$ module load gcc/7.3.0 hdf5 julia/1.0.2 | <!--T:5--> | ||
[hahn@gra-login2 ~]$ module load gcc/7.3.0 hdf5 julia/1.0.2 | |||
[hahn@gra-login2 ~]$ julia | [hahn@gra-login2 ~]$ julia | ||
julia> using Libdl | julia> using Libdl | ||
Line 18: | Line 22: | ||
julia> using JLD | julia> using JLD | ||
<!--T:6--> | |||
If we were to omit the <code>Libdl.DL_LOAD_PATH</code> line from the above example, it would happen to work on Graham because Graham has HDF5 installed system-wide. It would fail on Cedar because Cedar does not. The best practice on ''any'' Compute Canada system, though, is that shown above: Load the appropriate [[Utiliser_des_modules/en | module]] first, and use the environment variable defined by the module (<code>HDF5_DIR</code> in this example) to extend <code>Libdl.DL_LOAD_PATH</code>. This will work uniformly on all systems. | If we were to omit the <code>Libdl.DL_LOAD_PATH</code> line from the above example, it would happen to work on Graham because Graham has HDF5 installed system-wide. It would fail on Cedar because Cedar does not. The best practice on ''any'' Compute Canada system, though, is that shown above: Load the appropriate [[Utiliser_des_modules/en | module]] first, and use the environment variable defined by the module (<code>HDF5_DIR</code> in this example) to extend <code>Libdl.DL_LOAD_PATH</code>. This will work uniformly on all systems. | ||
= Package files and storage quotas = | = Package files and storage quotas = <!--T:7--> | ||
<!--T:8--> | |||
In the example above, installing just the JLD package creates a <code>~/.julia</code> tree with 18673 files and directories and using 236M of space, almost 5% of a standard user's quota for /home. It's worth remembering that installing a lot of packages will consume a lot of space. | In the example above, installing just the JLD package creates a <code>~/.julia</code> tree with 18673 files and directories and using 236M of space, almost 5% of a standard user's quota for /home. It's worth remembering that installing a lot of packages will consume a lot of space. | ||
= Available versions = | = Available versions = <!--T:9--> | ||
<!--T:10--> | |||
We have removed earlier versions of Julia (< 1.0) because the old package manager was creating vast numbers of small files which in turn caused performance issues on the parallel file systems. Please start using Julia 1.0.2, or newer versions. | We have removed earlier versions of Julia (< 1.0) because the old package manager was creating vast numbers of small files which in turn caused performance issues on the parallel file systems. Please start using Julia 1.0.2, or newer versions. | ||
<!--T:11--> | |||
{{Command | {{Command | ||
|module spider julia | |module spider julia | ||
Line 37: | Line 45: | ||
You will need to load all module(s) on any one of the lines below before the "julia/1.0.2" module is available to load. | You will need to load all module(s) on any one of the lines below before the "julia/1.0.2" module is available to load. | ||
nixpkgs/16.09 gcc/7.3.0 | <!--T:12--> | ||
nixpkgs/16.09 gcc/7.3.0 | |||
[...] | [...] | ||
}} | }} | ||
Line 44: | Line 53: | ||
}} | }} | ||
== Porting code from Julia 0.x to 1.x == | == Porting code from Julia 0.x to 1.x == <!--T:13--> | ||
<!--T:14--> | |||
In the summer of 2018 the Julia developers released version 1.0, in which they stabilized the language API and removed deprecated (outdated) functionality. | In the summer of 2018 the Julia developers released version 1.0, in which they stabilized the language API and removed deprecated (outdated) functionality. | ||
To help updating Julia programs for version 1.0, the developers also released version 0.7.0. | To help updating Julia programs for version 1.0, the developers also released version 0.7.0. |