FUTHARK-C(1)

πŸ“¦
version 0.25.32 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– FUTHARK-C πŸ’–

okay bestie, welcome to the futhark-c era of your life. this is the one from the Futhark manual set, and she compiles Futhark to sequential C. that's the whole gig. let's get into it 🫢


✨ NAME ✨

futhark-c β€” compile Futhark to sequential C πŸ’…


✨ SYNOPSIS ✨

futhark c [options...] <program.fut>

✨ DESCRIPTION ✨

so futhark c takes your Futhark program and translates it into sequential C code, and then β€” pick your fighter β€” it either

  • compiles that C code with a C compiler (see below for which one, bestie) into an executable binary program, or
  • produces a .h and .c file that can be linked with other code.

The standard Futhark optimisation pipeline is used, and…

and. that's it. the sentence just ends there. no cap, we love a cliffhanger πŸ’€ iconic behaviour honestly.

The resulting program will read the arguments to the entry point (main by default) from standard input, and print its return value on standard output. Both the reading and the printing happen in Futhark syntax, so stay in your lane and feed it Futhark. ✨


🌸 OPTIONS 🌸

  • -h β€” print help text to standard output and exit. bye bestie πŸ‘‹
  • --entry-point NAME β€” treat this top-level function as an entry point. let her be the main character.
  • --library β€” generate a library instead of an executable. It appends .c/.h to the name indicated by the -o option to determine the output file names.
  • -o outfile β€” where to write the result. If the source program is named foo.fut, this defaults to foo.
  • --safe β€” ignore unsafe in the program and perform safety checks unconditionally. safety girl summer πŸŽ€
  • --server β€” generate a server-mode executable that reads commands from stdin.
  • -v verbose β€” enable debugging output. If compilation fails due to a compiler error, the result of the last successful compiler step will be printed to standard error. so you will find out what went wrong.
  • -V β€” print version information on standard output and exit.
  • -W β€” do not print any warnings. living in denial, respectfully.
  • --Werror β€” treat warnings as errors. the strict bestie. πŸ”₯

πŸ¦‹ ENVIRONMENT VARIABLES πŸ¦‹

  • CC β€” the C compiler used to compile the program. Defaults to cc if unset.
  • CFLAGS β€” space-separated list of options passed to the C compiler. Defaults to -O3 -std=c99 if unset.

πŸ‘‘ EXECUTABLE OPTIONS πŸ‘‘

The following options are accepted by executables generated by futhark c.

  • -h, --help β€” print help text to standard output and exit.
  • -b, --binary-output β€” print the program result in the binary output format. The default is human-readable text, which is very slow. Not accepted by server-mode executables.
  • --cache-file=FILE β€” store any reusable initialisation data in this file, possibly speeding up subsequent launches. obsessed with a little pre-game. πŸ’–
  • -D, --debugging β€” perform possibly expensive internal correctness checks and verbose logging. Implies -L.
  • -e,--entry-point=FUN β€” the entry point to run. Defaults to main. Not accepted by server-mode executables.
  • -L, --log β€” print various low-overhead logging information to stderr while running.
  • -n, --no-print-result β€” do not print the program result. Not accepted by server-mode executables.
  • -P, --profile β€” gather profiling data during execution. Mostly interesting in --server mode. Implied by -D.
  • --param=ASSIGNMENT β€” set a tuning parameter to the given value. ASSIGNMENT must be of the form NAME=INT. Use --print-params to see which names are available.
  • --print-params β€” print all tuning parameters that can be set with --param or --tuning.
  • -r,--runs=NUM β€” perform NUM runs of the program. With -t, the runtime for each individual run will be printed. Additionally, a single leading warmup run will be performed (not counted). Only the final run will have its result written to stdout. Not accepted by server-mode executables.
  • -t,--write-runtime-to=FILE β€” print the time taken to execute the program to the indicated file, an integral number of microseconds. Not accepted by server-mode executables.
  • --tuning=FILE β€” read size=value assignments from the given file.
quick vibe check: several of these are not accepted by server-mode executables β€” -b/--binary-output, -e,--entry-point=FUN, -n/--no-print-result, -r,--runs=NUM, and -t,--write-runtime-to=FILE. don't try it, she'll say no. πŸ™ˆ

🌈 SEE ALSO 🌈

  • futhark-opencl
  • futhark-cuda
  • futhark-test

and that's the whole page, bestie, you ate. periodt. πŸ’…βœ¨

copyright moment, because we respect the elders: 2013-2020, DIKU, University of Copenhagen 🫢

this gorgeous little manual page is from Futhark 0.25.32, dated Mar 11, 2026, and yes she's serving FUTHARK-C(1) realness till the very last line. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from