-
Notifications
You must be signed in to change notification settings - Fork 8
Template for startup.jl
AndreaNeumayr edited this page Feb 4, 2021
·
10 revisions
- Copy the template below
- Whenever Julia is started, this
startup.jl
file is executed. - Store the template file under
<path-to-julia-home>\.julia\config\startup.jl
- Whenever Julia is started, this
- Create your folder, where you'd like to work.
- Adapt the
juliaWorkingDir
variable to your needs (line 5) and save it, (be aware of using /)
- Adapt the
- Do you want to use Modia3D for 3D simulations and also visualize your results? Skip this point if you're doing the lightweight installation guide!
- Download and install the free DLR SimVis Community Edition, e.g. with https://visualization.ltx.de/
- Set an environment variable or add it to the startup.jl file (remove # in last line of template)
ENV["DLR_VISUALIZATION"] = "<path-to-library>/Visualization/Extras/SimVis"
- remove # in last line of template, and adapt
<path-to-library>
# Julia startup file
# This file should contain site-specific commands to be executed on Julia startup;
# Users may store their own personal commands in `~/.julia/config/startup.jl`.
# set variable: juliaWorkingDir, be aware of using /
juliaWorkingDir = "D:/work/julia"
println("... executing startup file ", @__FILE__)
println("... Julia package directories: ", DEPOT_PATH)
# Change Directory of Julia package directory (default: in %USERPROFILE%\.julia)
cd(juliaWorkingDir)
println("... Starting Julia in " * pwd())
# Support revise() in order that code changes are automatically compiled
# (https://timholy.github.io/Revise.jl/stable/config.html)
#=
try
@eval using Revise
# Turn on Revise's automatic-evaluation behavior
Revise.async_steal_repl_backend()
println("... Revise started")
catch err
@warn "... Could not load Revise."
end
=#
# Package Makie is used for plotting (it's installed at the first time using ModiaMath), other options are PyPlot/Makie/Nothing
# ENV["MODIA_PLOT_PACKAGE"] = "Makie"
# println("... ENV[\"MODIA_PLOT_PACKAGE\"] = \"", ENV["MODIA_PLOT_PACKAGE"], "\"")
# If you want to use the DLR Visualization Library for visualizing 3D models you need adapt the path to SimVis installation
# ENV["DLR_VISUALIZATION"] = "<path-to-library>/Visualization/Extras/SimVis"