Closed hurak closed 3 years ago
This is a great question. I'm not 100% fluent on the package system, either (it's quite complex), but I will try to explain best I can.
tldr; StaticArrays is installed as a dependency with Altro. To actually use the package, you need to add it your environment.
Julia distinguishes between packages installed directly and those installed as dependencies from other packages. Packages installed directly via Pkg.add
are added to the environment's Project.toml
file, and will never change version on you unless explicitly asked (via Pkg.update
).
Packages installed as dependencies are not added to the Project.toml
file and are free to change version to meet the various requirements imposed by the installed packages. You will notice this whenever you install a new package, since it prints out all the dependencies that were added or changed version.
So while StaticArrays is technically installed when installing Altro, you can't actually import it (via using StaticArrays
) until you install it. That way Julia can guarantee that you use the same version of StaticArrays each time you import it. Hopefully that answers your question!
As a side note, I'm in the process of updating the Altro ecosystem to support StaticArrays v1.0.
Many thanks.
After installing Altro into a clean environment (adding manually just RobotZoo to run the example), it appears that StaticArrays is not added automatically even though it is stated in Altro's Project.tom, .
I am still not quite fluent with Julia's Pkg system. Do I understand it incorrectly that if a package is mentioned in the Project.toml, then it is automatically installed? Here in order to get the Altro example going, I had to add StaticArrays manually.