Closed mantielero closed 6 months ago
How should I use Futhark correctly?
You should allow Futhark to work the way its intended and create a single file. The idea behind Futhark is to allow you to import things just like you would in C, but it requires you to do all the imports in a single block so it can figure out what to generate and what not to generate.
Are the futhark outcomes thought to be included or imported?
Neither, you're supposed to import a module which has the Futhark importc
block in it. That being said if you want to ship wrappers without requiring the user to have Futhark or the original sources available then you should have a look at the shipping wrappers section in the README. This is really the only scenario where you're supposed to use outputPath
, otherwise you can just omit that line and let Futhark handle its own cache.
I have been working on a "project mode" for Futhark in which it will create Nim files analogous to the original C files to wrap a larger project. This isn't quite complete yet, but seems like maybe what you're trying to do. So keep an eye out for that once it launches. In the meantime just put all your C imports into a single Futhark statement, remove the outputPath
statement, and just let Futhark do its thing.
In order to generate smaller files, I am using the following pattern:
The works well until I get a message such as:
How should I use Futhark correctly? Is there a way to tell Futhark: don't create bindings for what has been created before?
Because I understand that this:
creates a single file.
Besides I always try to
import
and avoid usinginclude
. Are the futhark outcomes thought to be included or imported?