1
votes

I have installed Julia on a remote High Performance Computing centre and am in the process of calling .jl-files via SLURM batch script. However, it seems like the "Pkg" command is not available because the following message pops up:

ERROR: LoadError: UndefVarError: Pkg not defined
Stacktrace:
 [1] top-level scope at /users/pa19/lanast/taskp/LAfem.jl:1
 [2] include at ./boot.jl:328 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1105
 [4] include(::Module, ::String) at ./Base.jl:31
 [5] exec_options(::Base.JLOptions) at ./client.jl:287
 [6] _start() at ./client.jl:460
in expression starting at /users/pa19/lanast/taskp/LAfem.jl:1

Could it be an issue with the installation of Julia? Does one have to provide the exact links for Julia to know where to fetch them from?

Thanks Lysandros

1
Can you share what code resulted in the error? In particular, what is on line 1 of /users/pa19/lanast/taskp/LAfem.jl from where the error is thrown? Maybe you just didnt load the Pkg module (using Pkg)? - fredrikekre
The first (and only line) is:Pkg.installed(). Now I tried to add before this line the using Pkgcommand but a different error appears, namely 'ERROR: LoadError: IOError: stat: permission denied (EACCES) for file "/users/apps/compilers/julia/1.3.1/share/julia/stdlib/v1.3/Pkg/src/Pkg.jl" ' Thank you - LysandrosAn
Please include the full stacktrace. - fredrikekre
For the first case, it is: ERROR: LoadError: UndefVarError: Pkg not defined Stacktrace: [1] top-level scope at /users/pa19/lanast/taskp/LAfem.jl:2 [2] include at ./boot.jl:328 [inlined] [3] include_relative(::Module, ::String) at ./loading.jl:1105 [4] include(::Module, ::String) at ./Base.jl:31 [5] exec_options(::Base.JLOptions) at ./client.jl:287 [6] _start() at ./client.jl:460 in expression starting at /users/pa19/lanast/taskp/LAfem.jl:2 - LysandrosAn
But we already solved that issue; you didn't load Pkg. What is it in the second case (the file permission one). - fredrikekre

1 Answers

0
votes

Thank you fredrikekre and Przemyslaw. If instead I write the two lines

using Pkg
Pkg.installed() 

then the following appears:

ERROR: LoadError: IOError: stat: permission denied (EACCES) for file "/users/apps/compilers/julia/1.3.1/share/julia/stdlib/v1.3/Pkg/src/Pkg.jl"
Stacktrace:
 [1] stat(::String) at ./stat.jl:69
 [2] isfile at ./stat.jl:311 [inlined]
 [3] isfile_casesensitive at ./loading.jl:9 [inlined]
 [4] entry_point_and_project_file_inside at ./loading.jl:438 [inlined]
 [5] entry_point_and_project_file(::String, ::String) at ./loading.jl:453
 [6] implicit_project_deps_get at ./loading.jl:605 [inlined]
 [7] project_deps_get(::String, ::String) at ./loading.jl:308
 [8] identify_package(::String) at ./loading.jl:220
 [9] identify_package(::Base.PkgId, ::String) at ./loading.jl:206
 [10] identify_package at ./loading.jl:200 [inlined]
 [11] require(::Module, ::Symbol) at ./loading.jl:882
 [12] include at ./boot.jl:328 [inlined]
 [13] include_relative(::Module, ::String) at ./loading.jl:1105
 [14] include(::Module, ::String) at ./Base.jl:31
 [15] exec_options(::Base.JLOptions) at ./client.jl:287
 [16] _start() at ./client.jl:460
in expression starting at /users/pa19/lanast/taskp/LAfem.jl:1

In order to build julia I use the script:

## LOAD MODULES ##
module purge            # clean up loaded modules 

# load necessary modules
module load intel/18.0.5
module load gnu/4.9.2
module load java/9.0
module load julia


## RUN CODE ##
date
julia LAfem.jl 
date

I will check whether the master node has different hardware than the worker node. But generally, only one node is used for this job. Kind regards