How run examples in AstronNbodySim

From the REPL, I installed the AstroNbodySim package by ]add AstroNbodySim. Next, inside my usual ~/Documents/julia directory for projects, I used ] generate Nbody and then ] activate Nbody.

I want to run some of the examples in the package’s Examples directory. But the installation I did, following the docs, did not seem to add the files from subdirectoires Benchmark, docs, examples, or test at GitHub - JuliaAstroSim/AstroNbodySim.jl: Unitful and differentiable gravitational N-body simulation code in Julia. So I downloaded the whole zip from there, unzipped, and moved the Benchmark, docs, examples, and test directories into ~/Documents/julia/Nbody.

Still, if I execute, say include("examples/07-solarsystem/07-solarsystem.jl"), I get `LoadError: ArgumentError: Package AstroPlot not found in current path:

  • Run import Pkg; Pkg.add("AstroPlot") to install the AstroPlot package.`

Please patiently explain to me what I am doing wrong.

I am still utterly flummoxed by Julia’s package and environment conceptual framework!

The example script you wanted to run attempts to import AstroPlot. It seems like your active environment doesn’t have the AstroPlot package, so you’ll have to follow its suggestion and add it.

OK, thanks! I misinterpreted the docs for AstroNbodySim as to say the various required package were included.

Alas, after adding no tonly AstroPlot, but other packages required for the example, I finally got LoadError: SystemError: opening file "output/success": No such file or directory, with the StackTrace indicating a call from ~/.julia/packages/CUDA/nYggH/src/initialization.jl. Since my iMac uses Radeon graphics, not nVidia, this suggests that this example, and possibly the others or anything done with the AstroNbodySim package are doomed to failure on my system.