Well, PackageCompiler.jl is not immature at all.
Here are a few videos on how to use PackageCompiler.jl to create binary executables and shared libraries.
The documentation for this can be found below:
As for the REPL, if you do not want to use for its interactive features, I would consider using it as a development tool that implements a compilation cache.
PackageCompiler is amazing. But itβs also slow and creates truly enormous binaries. If youβre used to compiling go there will be no comparison. We need to be honest about that so peoples expectations will match reality.
Especially when the actual goal in this case appears to not be compilation but rather code organization.
Well, I am working on a C/C++ project with compilation times not below a few hours. Compared to that PackageCompiler is fast. And there is no need to run it after every change, I run it perhaps every other day and it takes never more than 15 minutes.
I am not using the .julia/dev folder. Instead, I have a repos folder where I check out my git projects. A complex Julia project usually consists of a number of related packages and (perhaps) a main project which is not a package. For me this looks like this:
ufechner@tuxedi:~/repos$ tree -d Kite*
KiteControllers.jl
βββ data
βββ doc
βββ src
βββ test
KiteModels.jl
βββ bin
βββ data
βββ docs
β βββ build
β β βββ assets
β β βββ themes
β βββ data
β βββ src
β βββ assets
βββ examples
βββ src
βββ test
KiteUtils.jl
βββ data
βββ docs
β βββ src
βββ src
βββ test
KiteViewer
βββ data
βββ doc
βββ src
βββ test
KiteViewers.jl
βββ bin
βββ data
βββ examples
βββ src
βββ test
30 directories
Iβm curious how large the actual C++ code is and if parallel compilation is used? Iβve only ever had one multi-hour compilation (and have built quite a few C++ packages over the years) and thatβs ParaView, which is a humongous build when its dependencies are included. Not trying to say you donβt have a multi-hour build, just trying to understand what kind of project youβre refering to.
Edit: this I donβt understand. C++ builds can easily to incremental compilation, saving lots of time, while with PackageCompiler that seems almost impossible (unless you build separate sysimages for subsets manually).
We are using Buildroot to create a system image for an embedded system. We have a fast machine with 16 cores and use ccache. And incremental builds often do NOT work if you use Buildroot (sometimes they work).
Well, I use PackageCompiler mainly to compile the packages I am currently NOT working at. The package I currently work at gets pre-compiled on load and compiled when running a function, but this usually only takes a few seconds, worst case 10 seconds.
Not my experience, and from what I hear having things break with minor versions is very rare (if it in fact happens at all).
Sorry, this is nonsense. Julia has great dependency management, and if you insist on building a static executable, you are probably not using the language efficiently.
No need to be inflammatory. I use Julia on my PhD and used it for my internship at Amazon (as an Applied Scientist). I consider it to be a mature language. It is just not designed with compilation to a binary in mind, as many other languages were not. Even so, it has packages that allow for it if it is strictly necessary.
All Iβve seen in example material are things like
] add MLDatasets
using MLDatasets
with no versioning at all. No one seems to mention dependency management. Iβve yet to hear any Julia intro material mention transitive dependencies.
Example 4 here 3. Managing Packages Β· Pkg.jl
Perhaps 3. Managing Packages Β· Pkg.jl
and 6. Compatibility Β· Pkg.jl
The versioning may be done via Project.toml/Manifest.toml. It is not necessarily spelled out in the command line.
If you wanted to do spell it out on the command line, that is also very possible by appending @major.minor.patch
. The default is to try to obtain the latest version that is also compatible with your current environment settings.
(@v1.7) pkg> ?add
add [--preserve=<opt>] pkg[=uuid] [@version] [#rev] ...
Add package pkg to the current project file. If pkg could refer to multiple different packages, specifying uuid
allows you to disambiguate. @version optionally allows specifying which versions of packages to add. Version
specifications are of the form @1, @1.2 or @1.2.3, allowing any version with a prefix that matches, or ranges
thereof, such as @1.2-3.4.5. A git revision can be specified by #branch or #commit.
If a local path is used as an argument to add, the path needs to be a git repository. The project will then track
that git repository just like it would track a remote repository online. If the package is not located at the top of
the git repository, a subdirectory can be specified with path:subdir/path.
Pkg resolves the set of packages in your environment using a tiered approach. The --preserve command line option
allows you to key into a specific tier in the resolve algorithm. The following table describes the command line
arguments to --preserve (in order of strictness).
Argument Description
ββββββββ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
all Preserve the state of all existing dependencies (including recursive dependencies)
direct Preserve the state of all existing direct dependencies
semver Preserve semver-compatible versions of direct dependencies
none Do not attempt to preserve any version information
tiered Use the tier which will preserve the most version information (this is the default)
β Julia 1.5
β
β Subdirectory specification requires at least Julia 1.5.
Examples
pkg> add Example
pkg> add --preserve=all Example
pkg> add Example@0.5
pkg> add Example#master
pkg> add Example#c37b675
pkg> add https://github.com/JuliaLang/Example.jl#master
pkg> add git@github.com:JuliaLang/Example.jl.git
pkg> add Example=7876af07-990d-54b4-ab0e-23690620f79a
See the Pkg.jl links above for more information.
Well, in the last year I had twice the situation that a specific package version was broken and I had to manually select an older version. This happened with StaticArrays and with Rotatationsβ¦