Julia: Difference between revisions
(Created page with "[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_d...") |
(how to tell Julia's Pkg system how to find libraries in CVMFS.) |
||
Line 1: | Line 1: | ||
[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. | ||
{{Draft}} | |||
== Compiling Packages == | |||
Julia should be have properly when compiling packages: files will be added to <code>~/.julia</code>; but 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 desktop, Julia attempts to install such a dependency by spawning yum/apt operations with sudo. This doesn't work on ComputeCanada systems; instead, some extra information must be provided to allow the Pkg build system to find the HDF5 library. | |||
<source> | |||
[hahn@gra-login2 ~]$ module load gcc/7.3.0 hdf5 julia/1.0.2 | |||
[hahn@gra-login2 ~]$ julia | |||
julia> using Libdl | |||
julia> push!(Libdl.DL_LOAD_PATH, ENV["HDF5_DIR"] * "/lib") | |||
julia> using Pkg | |||
julia> Pkg.add("JLD") | |||
julia> using JLD | |||
</source> | |||
This example happens to work on Graham without the <code>Libdl.DL_LOAD_PATH</code>, because Graham happens to have a copy of HDF5 installed system-wide from Centos. It fails on Cedar because Cedar's base image doesn't happen to include HDF5. And the real point is that we should probably want to use the ComputeCanada version anyway, which we load via "module", and works uniformly on all systems. (The HDF5 module provides the <code>HDF5_DIR</code> environment setting, which we use to show Pkg how to find and load via <code>Libdl</code>.) | |||
== Package file usage (and storage quotas) == | |||
In the example above, installing just the JLD package creates a ~/.julia tree with 18673 files/directories and using 236M of space. It's worth thinking about this, since you may hit the space and file/directory count limits on your home directory. |
Revision as of 20:20, 1 February 2019
Julia is a programming language that was designed from the beginning for performance, ease of use and portability. It is is available as a module on Compute Canada clusters.
This is not a complete article: This is a draft, a work in progress that is intended to be published into an article, which may or may not be ready for inclusion in the main wiki. It should not necessarily be considered factual or authoritative.
Compiling Packages
Julia should be have properly when compiling packages: files will be added to ~/.julia
; but you may run into problems if the package depends on system-provided libraries. For instance, JLD depends on a system-provided HDF5 library. On a desktop, Julia attempts to install such a dependency by spawning yum/apt operations with sudo. This doesn't work on ComputeCanada systems; instead, some extra information must be provided to allow the Pkg build system to find the HDF5 library.
[hahn@gra-login2 ~]$ module load gcc/7.3.0 hdf5 julia/1.0.2
[hahn@gra-login2 ~]$ julia
julia> using Libdl
julia> push!(Libdl.DL_LOAD_PATH, ENV["HDF5_DIR"] * "/lib")
julia> using Pkg
julia> Pkg.add("JLD")
julia> using JLD
This example happens to work on Graham without the Libdl.DL_LOAD_PATH
, because Graham happens to have a copy of HDF5 installed system-wide from Centos. It fails on Cedar because Cedar's base image doesn't happen to include HDF5. And the real point is that we should probably want to use the ComputeCanada version anyway, which we load via "module", and works uniformly on all systems. (The HDF5 module provides the HDF5_DIR
environment setting, which we use to show Pkg how to find and load via Libdl
.)
Package file usage (and storage quotas)
In the example above, installing just the JLD package creates a ~/.julia tree with 18673 files/directories and using 236M of space. It's worth thinking about this, since you may hit the space and file/directory count limits on your home directory.