-
Notifications
You must be signed in to change notification settings - Fork 8
Lightweight Installation Guide: Julia Modia3D
The following installation guidelines are for Julia v1.9.0 under Windows 10. If it is possible use a portable version. For Linux or Mac users the installation steps should be quite similar.
These installation guidelines are a lightweight version. Therefore, we use package Makie for plotting, and there is no 3D simulation. Thus, we can skip installing Python (Anaconda Python) for PyPlot and the DLR Visualization Library for 3D simulation. If you're interested see the extensive installation guide.
Julia might fill up your user profile so be aware by installing Julia under Windows. We'd recommend you creating a new environment variable JULIA_DEPOT_PATH = <path-to-julia-home>/.julia
before installing Julia. How to set an environment variable under Windows 10 is explained here. A path should not contain a whitespace.
Please read the following guidelines carefully.
For further information about ModiaSim project go to https://github.com/ModiaSim .
You need to define where all Julia packages like Modia3D and Modia are stored.
- Create an environment variable called
JULIA_DEPOT_PATH
- Set
JULIA_DEPOT_PATH = <path-to-julia-home>/.julia
(e.g.<path-to-julia-home>/.julia = D:/home/.julia
)
- Set
- Download the latest stable version of Julia, based on the platform you are using, if available use a portable version from the Julia homepage https://julialang.org/downloads/
- Unzip Julia (portable) in your Julia installation directory
<path-to-julia-installation>
- E.g.
<path-to-julia-installation> = D:/software/julia-1.9.0
- E.g.
- Add the Julia installation directory to the
PATH
environment variablePATH = <path-to-julia-installation>\bin
- Test Julia
- Open a command window (cmd), write down
julia
- This will open the Julia command window. The Julia command line is called
REPL
- This will open the Julia command window. The Julia command line is called
- If Julia starts: Congratulations!! 🥇 👍
- Otherwise open
<path-to-julia-installation>/bin/julia.exe
, if this works go back to step 3
- Open a command window (cmd), write down
- Close Julia window, or type
exit()
Downloading, installing and testing packages take some time, so be patient and drink a cup of coffee.
- Open a Julia
REPL
- Open a command window (cmd), write down
julia
. This opens a JuliaREPL
- Open a command window (cmd), write down
- Adding some packages, typing the following into the
REPL
(list might not be complete)] add Revise, Modia, Modia3D
-
Choose between several plot packages: one or more of the following packages should be installed.
-
] add SignalTablesInterface_GLMakie
-
NOTE: Set:
ENV["SignalTablesPlotPackage"] = "GLMakie"
in your startup.jl file
-
NOTE: Set:
-
] add SignalTablesInterface_WGLMakie
-
NOTE: Set:
ENV["SignalTablesPlotPackage"] = "WGLMakie"
in your startup.jl file
-
NOTE: Set:
-
] add SignalTablesInterface_CairoMakie
-
NOTE: Set:
ENV["SignalTablesPlotPackage"] = "CairoMakie"
in your startup.jl file
-
NOTE: Set:
-
- Update all installed packages
] update
- Configure Julia with a startup.jl file
- Create folder
config
under<path-to-julia-home>/.julia
- Open startup.jl template, adapt it to your needs and save it under
<path-to-julia-home>/.julia/config/startup.jl
- Create folder
- Test Modia3D and Modia packages
- Open a Julia
REPL
using Modia3D
include("$(Modia3D.path)/test/Tutorial/BouncingSphere.jl")
- Further tests are available under
include("$(Modia3D.path)/test/runtests.jl")
exit()
- Open a Julia
- Congratulations!! 🥇 👍
We recommend you using a portable VS Codium version as editor for Julia. VS Codium is a clone of VS Code. It’s identical to VS Code with the single biggest difference that unlike VS Code, VS Codium doesn’t track your usage data.
For further information see https://vscodium.com/
- Download VS Codium (Portable) https://portapps.io/app/vscodium-portable/
- Install VS Codium/Code
For further information see https://www.julia-vscode.org/docs/dev/gettingstarted/#Installation-and-Configuration-1
- Start or open VS Codium
<path-to-VSCodium>\vscodium-portable.exe
- Select View and then click Extensions to open Extension View.
- Enter the term
julia
in the marketplace search box. Click the green Install button to download the extension.
NOTE: It is recommended that you restart VS Codium after installation.
If you managed to start Julia from command window, which means you installed Julia into a standard location on Mac or Windows, or if the Julia binary is on your PATH
environment, the Julia VS Codium extension automatically finds your Julia installation. You do not need to configure the extension. Otherwise you have to configure your extension: see https://www.julia-vscode.org/docs/dev/gettingstarted/#Installation-and-Configuration-1
- Select File and then click Open Folder... and browse to folder
<path-to-julia-home>/.julia/packages/Modia3D
- Open
~/examples/Simulate_Pendulum.jl
- Select View and then click Command Palette... and choose Julia: Execute File
- If more tabs are opened in your editor the actual file will be executed
- You could create a shortcut for that
- See also https://www.julia-vscode.org/docs/dev/userguide/runningcode/
Juno, VS Code, Jupyter, Pluto.jl, Vim, Emacs, SublimeText, NotePad++ (see listed editors: Julia Editors)
For further remarks or if you encounter problems, please feel free to contact Andrea Neumayr (andrea.neumayr[at]dlr.de).