Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Setup to AstroNbodySim #9

Closed
glanzkaiser opened this issue Jul 19, 2022 · 8 comments
Closed

Initial Setup to AstroNbodySim #9

glanzkaiser opened this issue Jul 19, 2022 · 8 comments
Labels
good first issue Good for newcomers

Comments

@glanzkaiser
Copy link

glanzkaiser commented Jul 19, 2022

I create a new folder and start an environment for AstroNbodySim.jl

But, I cannot run the example/04-collisions/04-collisions.jl

I have added some packages:
Reexport v1.2.2..

then when I add AstroIC I get:

1 dependency successfully precompiled in 82 seconds (300 already precompiled, 2 skipped during auto due to previous errors)
1 dependency errored. To see a full report either run import Pkg; Pkg.precompile() or load the package

Here is the screenshots:
Capture d’écran_2022-07-19_15-30-03

What should I do so I can run the collision example?

@islent islent added the good first issue Good for newcomers label Jul 19, 2022
@islent
Copy link
Member

islent commented Jul 19, 2022

Can you paste the output of calling versioninfo?

image

By the way, I have the same problem of precompiling AstroIC@v0.1. However, it can be successfully imported.
image

Here's my suggestions of running AstroNbodySim:

  • Install master branch of packages in JuliaAstroSim, because most of them are still under development. For example,
    pkg> add AstroIC#master
    
  • Use Julia v1.7.3 and above

@glanzkaiser
Copy link
Author

glanzkaiser commented Jul 20, 2022

I have try this:

julia> versioninfo()
pkg> build AstroIC
julia> using AstroIC

AstroIC can't be used.
Errors Messages:
1. LoadError: UndefVarError: Collection not defined
2. LoadError: Failed to precompile AstroIO [c85a633c-0c3f-44a2-bffe-7f9d0681b3e7] to /home/browni/.julia/compiled/v1.7/AstroIO/jl_jrhF9O.
3. Failed to precompile AstroIC [5b3ca070-48c3-41ea-b469-89825dd01fde] to /home/browni/.julia/compiled/v1.7/AstroIC/jl_d0F6ts.

Capture d’écran_2022-07-20_17-31-39
Capture d’écran_2022-07-20_17-32-39

why is the environment folder not containing the folders and codes from AstroNbodysim?

Capture d’écran_2022-07-20_17-34-02

@islent
Copy link
Member

islent commented Jul 20, 2022

I notice that you are using PhysicalParticles@v1.0.3 from your discourse post:
https://discourse.julialang.org/t/ann-astronbodysim-jl-unitful-and-differentiable-gravitational-n-body-simulation-code-in-julia/74782/30?u=islent

Updating PhysicalParticles.jl to the newest version may solve your problem (master branch is also recommanded).

@glanzkaiser
Copy link
Author

glanzkaiser commented Jul 20, 2022

I am not really an expert, still a newbie in Julia.

should I do git clone https://github.com/JuliaAstroSim/AstroNbodySim.jl.git inside my working environment?

I am able to pass build AstroIC,
Capture d’écran_2022-07-20_21-24-36

then what should I do?

@islent
Copy link
Member

islent commented Jul 21, 2022

should I do git clone https://github.com/JuliaAstroSim/AstroNbodySim.jl.git inside my working environment?

My suggestion is yes. Cloning a package does not much help running the package, but helps to search and understand source codes (if documentation is not well covered).

then what should I do?

You can start from the documentation https://juliaastrosim.github.io/AstroNbodySim.jl/dev/. Copy the raw codes, edit them, and run.

There is also a first user guide https://juliaastrosim.github.io/AstroNbodySim.jl/dev/#First-Time-User-Guide

@glanzkaiser
Copy link
Author

glanzkaiser commented Jul 21, 2022

I already get it,

after I git clone git clone https://github.com/JuliaAstroSim/AstroNbodySim.jl.git
then at the directory I do

julia --project="."
julia> ]

pkg> build AstroIC
pkg> add AstroIC#master

julia> include("/../AstroNbodySim.jl/examples/install_pkgs.jl")

julia> include("/../AstroNbodySim.jl/examples/04-collisions/04-collisions.jl")

I want to know why we need to
build AstroIC
before
add AstroIC#master

Then it said that I need CUDA.

Capture d’écran_2022-07-21_11-51-12

I am installing CUDA from this link:
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=18.04&target_type=deb_local

I want to know how to compile and install CUDA for the source tarball of CUDA, since I want to install CUDA on Linux OS (outside the commercial flags like Ubuntu, Fedora) made out of LFS book.

@islent
Copy link
Member

islent commented Jul 21, 2022

I want to know why we need to
build AstroIC
before
add AstroIC#master

This is not necessary. I was calling build AstroIC to trigger a fresh build of package, trying to find any error at build level. In daily usage, you can simply let Pkg automatically control building and precompiling procedures. All you need to do is, add a package, wait for building and precompiling, and using it.

Then it said that I need CUDA.

About the installation of CUDA, see their instructions: https://cuda.juliagpu.org/stable/installation/overview/

AstroNbodySim can also run without CUDA. For example, in example-4, you can turn off GPU computing by setting device = CPU()

@glanzkaiser
Copy link
Author

I think it works, with device = CPU()

But I have to wait 3 days. Hopefully in the future I can use CUDA so it will deliver the result faster. Simulating galaxy needs a lot of resources.

Capture d’écran_2022-07-21_15-05-55

Thanks @islent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants