futhark-pkg - manage Futhark packages
Contents
Bugs
Since the lib/ directory is populated with transitive dependencies as well, it is possible for a package
to depend unwittingly on one of the dependencies of its dependencies, without the futhark.pkg file
reflecting this.
There is no caching of package metadata between invocations, so the network traffic can be rather heavy.
Commands
futharkpkgaddPKGPATH[X.Y.Z]
Add the specified package of the given minimum version as a requirement to futhark.pkg. If no version is
provided, the newest one is used. If the package is already required in futhark.pkg, the new version
requirement will replace the old one.
Note that adding a package does not automatically download it. Run futharkpkgsync to do that.
futharkpkgcheck
Verify that the futhark.pkg is valid, that all required packages are available in the indicated versions.
This command does not check that these versions contain well-formed code. If a package path is defined
in futhark.pkg, also checks that .fut files are located at the expected location in the file system.
futharkpkginitPKGPATH
Create a new futhark.pkg defining a package with the given package path, and initially no requirements.
futharkpkgfmt
Reformat the futhark.pkg file, while retaining any comments.
futharkpkgremovePKGPATH
Remove a package from futhark.pkg. Does not remove it from the lib/ directory.
futharkpkgsync
Populate the lib/ directory with the packages listed in futhark.pkg. Warning: this will delete
everything in lib/ that does not relate to a file listed in futhark.pkg, as well as any local
modifications.
futharkpkgupgrade
Upgrade all package requirements in futhark.pkg to the newest available versions.
futharkpkgversionsPKGPATH
Print all available versions for the given package path.
Commit Versions
It is possible to use futharkpkg with packages that have not yet made proper releases. This is done via
pseudoversions of the form 0.0.0-yyyymmddhhmmss+commitid. The timestamp is not verified against the
actual commit. The timestamp ensures that newer commits take precedence if multiple packages depend on a
commit version for the same package. If futharkpkgadd is given a package with no releases, the most
recent commit will be used. In this case, the timestamp is merely set to the current time.
Commit versions are awkward and fragile, and should not be relied upon. Issue proper releases (even
experimental 0.x version) as soon as feasible. Released versions also always take precedence over commit
versions, since any version number will be greater than 0.0.0.
Copyright
2013-2020, DIKU, University of Copenhagen
0.25.27 Mar 02, 2025 FUTHARK-PKG(1)
Description
This tool is used to modify the package manifest (futhark.pkg) and download the required packages it
describes. futharkpkg is not a build system; you will still need to compile your Futhark code with the
usual compilers. The only purpose of futharkpkg is to download code (and perform other package
management utility tasks). This manpage is not a general introduction to package management in Futhark;
see the User’s Guide for that.
The futharkpkg subcommands will modify only two locations in the file system (relative to the current
working directory): the futhark.pkg file, and the contents of lib/. When modifying lib/, futharkpkg
constructs the new version in lib~new/ and backs up the old version in lib~old. If futharkpkg should
fail for any reason, you can recover the old state by moving lib~old back. These temporary directories
are erased if futharkpkg finishes without errors.
The futharkpkgsync and futharkpkginit subcommands are the only ones that actually modifies lib/; the
others modify only futhark.pkg and require you to manually run futharkpkgsync afterwards.
Most commands take a -v/--verbose option that makes futharkpkg write running diagnostics to stderr.
Packages must correspond to Git repositories, and all interactions are done by invoking git.
Examples
Create a new package that will be hosted at https://github.com/sturluson/edda:
futhark pkg init github.com/sturluson/edda
Add a package dependency:
futhark pkg add github.com/sturluson/hattatal
Download the dependencies:
futhark pkg sync
And then you’re ready to start hacking! (Except that these packages do not actually exist.)
Name
futhark-pkg - manage Futhark packages
See Also
futhark-test, futhark-doc
Synopsis
futhark pkg add PKGPATH [X.Y.Z]
futhark pkg check
futhark pkg init PKGPATH
futhark pkg fmt
futhark pkg remove PKGPATH
futhark pkg sync
futhark pkg upgrade
futhark pkg versions
