Julia: Difference between revisions

use of "source" tags caused MediaWiki to find Syntax-highlighting errors
No edit summary
(use of "source" tags caused MediaWiki to find Syntax-highlighting errors)
Line 7: Line 7:
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.
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
[hahn@gra-login2 ~]$ module load gcc/7.3.0 hdf5 julia/1.0.2
julia> using Libdl
[hahn@gra-login2 ~]$ julia
julia> push!(Libdl.DL_LOAD_PATH, ENV["HDF5_DIR"] * "/lib")
julia> using Libdl
julia> using Pkg
julia> push!(Libdl.DL_LOAD_PATH, ENV["HDF5_DIR"] * "/lib")
julia> Pkg.add("JLD")
julia> using Pkg
julia> using JLD
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>.)
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>.)
cc_staff
653

edits