Closed virchau13 closed 1 year ago
It seems that Futhark isn't detecting any functions. Tracing funs
in the following line of code yields []
:
echo 'def main (x: i32): i32 = x + 1' > test.futhark futhark c test.futhark ./test
Futhark uses the .fut extension. It should work if you do
echo 'def main (x: i32): i32 = x + 1' > test.fut
futhark c test.fut
./test
(At which point it will wait for input. For instance, type 1
followed by enter Ctrl+D to compute 2.)
Though it's probably not the best UX to just do nothing when a file with the wrong extension is passed.
Oh wow, and here I was looking through source code... :)
I must ask though, why does Futhark care about the extension at all? Shouldn't it work with any filename?
There are a bunch of places where the extension is automatically added (e.g. when using import
), so complete extension-agnosticism is not feasible. It should definitely not just let it pass in silence, though.
Running
yields this exact output:
There appear to be no options for the entry point. The generated code contains:
And if you compile the code with
--library
, the manifest contains:However,
futhark run test.futhark
works perfectly fine.futhark defs
showsvalue main
.cabal run -- futhark test -i tests
from the source repository passes all the tests.Steps to reproduce:
gcc
NixOS container command that reproduces the issue:
sudo nixos-container create test --config 'environment.systemPackages = with pkgs; [ futhark gcc ];'
Sequence of Arch Linux commands to reproduce the issue in a fresh container using
docker run -it archlinux:latest
:There's probably some step I missed or a mistake I've made somewhere, but I can't find anything in the documentation about extra dependencies, and the Nix version of Futhark should contain all the dependencies, so I'm not exactly sure what's going wrong here.