Vscode-julia doesn't find intel MKL shared objects

Intel MKL and compiler have provides scripts to control library path, which is/are required to be sourced before starting up the MKL linked julia; can someone point out how to work around this when using julia linked with intel MKL and vscode-julia 1.0.10?

source /opt/intel/bin/compilervars.sh intel64
source /opt/intel/parallel_studio_xe_2020/bin/psxevars.sh &> /dev/null

which works with terminal access:

Julia Version 1.5.2
Commit 539f3ce943* (2020-09-23 23:17 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
  LIBM: libimf
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake

Here is the error when intel libraries are not in path:

INTEL MKL ERROR: /usr/local/bin/../lib/julia/libmkl_core.so: cannot open shared object file: No such file or directory.
Intel MKL FATAL ERROR: Cannot load libmkl_core.so.

Reproduce behaviour:

compile julia 1.4.x - 1.7.x with recent Intel MKL and gcc 9.2.x or up, install vscode-julia module v1.0.10 and try to execute a julia code line within a source file opened in vscode


The terminal process "/usr/local/bin/julia '-i', '--banner=no', '--project=/home/steven/.julia/environments/v1.5', '/home/steven/.vscode/extensions/julialang.language-julia-1.0.10/scripts/terminalserver/terminalserver.jl', '/tmp/vsc-julia-repl-1970947', '/tmp/vsc-jl-cr-1970947', 'USE_REVISE=true', 'USE_PLOTPANE=true', 'DEBUG_MODE=undefined'" failed to launch (exit code: 2).

Tried work around:

Tried @fredrikekre method to run julia in an external terminal – with MKL and Intel math lib sourced, but no success.

It seems likely your environment isn’t the same in VSCode as in your shell. Do you rely on sourcing those files in .bashrc or whatever to get Julia running?

I am using the standard .bashrc method, it it follows as:

source /opt/intel/bin/compilervars.sh intel64
source /opt/intel/parallel_studio_xe_2020/bin/psxevars.sh

do you happened to know a better way to do this? – or a temporary workaround?

So the reason this doesn’t work is because we don’t go through bash to start Julia. You should be able to start VSCode from within bash so that your environment is inherited though.

1 Like

Thank you for replying and pointing out. Unfortunately the suggestion doesn’t work.

Starting code from shell crossed my mind (didn’t work), and turned to this forum to see if anyone else is experiencing this problem. In fact it took me several weeks to understand the problem of language server not starting is rooted in julia being compiled against MKL.

Maybe someone could help me – or point me to the direction – on how to set up a debug environment with vscode-julia plugin, so I could identify the problem?

I am having the same problem. despite trying the suggested fix.

1 Like

Do you happened to be familiar with TypeScript development cycle (make debug, make dist), and the way the code base is set up?

Developing the Julia extension is super easy, just

  1. Clone the repo somewhere.
  2. git submodule init
  3. Open that directory in VSCode.
  4. Press F5.
  5. Play around in the newly opened VSCode window.

Thanks! I was able to reproduce the error. I had to install webpack-cli to make F5 work. Can you please let me know how to fill the directories below with the content? – for now I copied them over from a working version. But there must be a way to do this?

steven@io:/tmp/julia-vscode/scripts/packages$ tree -L 2
β”œβ”€β”€ ChromeProfileFormat
β”œβ”€β”€ CodeTracking
β”œβ”€β”€ CSTParser
β”œβ”€β”€ DebugAdapter
β”œβ”€β”€ DocumentFormat
β”œβ”€β”€ FilePathsBase
β”œβ”€β”€ JSON
β”œβ”€β”€ JSONRPC
β”œβ”€β”€ JuliaInterpreter
β”œβ”€β”€ LanguageServer
β”œβ”€β”€ PackageCompiler
β”œβ”€β”€ StaticLint
β”œβ”€β”€ SymbolServer
β”œβ”€β”€ Tokenize
β”œβ”€β”€ URIParser
β”œβ”€β”€ VSCodeDebugger
β”‚   β”œβ”€β”€ Project.toml
β”‚   β”œβ”€β”€ src
β”‚   └── test
└── VSCodeServer
    β”œβ”€β”€ Project.toml
    β”œβ”€β”€ src
    └── test

Ah, you need to git submodule init.

1 Like

OK, I have a working version for MKL, with the updated environment variables – verified in vscode. How can I bundle julia-vscode and try it in my live vscode editor?

1 Like

In PR #1839 the passed environment variable is augmented with the original process.env environment:

        env: Object.assign(process.env, {
            JULIA_DEPOT_PATH: path.join(...) + ':' + oldDepotPath,

as well as the JULIA_DEPOT_PATH with the oldDepotPath and a closing : token so the REPL can use its default DEPOT_PATH.

affected files: extensions.ts and interactive/repl.ts

I am not quite certain if these updates make sense in the bigger context, please let me know if it causes any misbehaviour, etc… In any event it fixed my problems with MKL.