JUSTUS2/Software/Julia/VSCode: Difference between revisions

From bwHPC Wiki
< JUSTUS2‎ | Software‎ | Julia
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:


== Wrapper Script for Module Loading==
== Wrapper Script for Module Loading==
The Julia Extension of VS Code needs to run Julia, which requires loading the module.

Save the following wrapper script e.g. as $HOME/bin/julia_wrapper.sh and make it executable:
<pre>
#!/bin/bash

## Making module command available
## ------------------------------------------------------------
export MODULEPATH=/opt/bwhpc/ul/modulefiles/Core:/opt/bwhpc/common/modulefiles/Core:/etc/modulefiles:/usr/share/modulefiles:/usr/share/modulefiles/Linux:/usr/share/modulefiles/Core:/usr/share/lmod/lmod/modulefiles/Core

source /usr/share/lmod/lmod/init/profile

## ------------------------------------------------------------

# Load julia
module load math/julia/1.11.3

# Pass on all arguments to julia
exec julia "${@}"
</pre>

Next, we need to configure VSCode to use the script as Julia executable. You find the corresponding setting at File|Preferences|Settings → Tab “Remote” → Extensions|Julia → setting “Julia: Executable path“)


== Connect to Nodes ==
== Connect to Nodes ==

Revision as of 12:12, 7 March 2025

Setting Up VS Code for Interactive Julia Sessions

Wrapper Script for Module Loading

The Julia Extension of VS Code needs to run Julia, which requires loading the module.

Save the following wrapper script e.g. as $HOME/bin/julia_wrapper.sh and make it executable:

#!/bin/bash

## Making module command available
## ------------------------------------------------------------
export MODULEPATH=/opt/bwhpc/ul/modulefiles/Core:/opt/bwhpc/common/modulefiles/Core:/etc/modulefiles:/usr/share/modulefiles:/usr/share/modulefiles/Linux:/usr/share/modulefiles/Core:/usr/share/lmod/lmod/modulefiles/Core

source /usr/share/lmod/lmod/init/profile

## ------------------------------------------------------------

# Load julia
module load math/julia/1.11.3

# Pass on all arguments to julia
exec julia "${@}"

Next, we need to configure VSCode to use the script as Julia executable. You find the corresponding setting at File|Preferences|Settings → Tab “Remote” → Extensions|Julia → setting “Julia: Executable path“)

Connect to Nodes

  1. proxy jump
  2. SSH keys