packages feed

futhark-0.29.1: docs/man/futhark-wasm.rst

.. role:: ref(emphasis)

.. _futhark-wasm(1):

============
futhark-wasm
============

SYNOPSIS
========

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

DESCRIPTION
===========

``futhark wasm`` translates a Futhark program to sequential
WebAssembly code by first generating C as ``futhark c``, and then
using Emscripten (``emcc``).  For a program ``prog.fut``, this
produces an ES module ``prog.mjs``, along with the WebAssembly module
``prog.wasm``.  With ``--library``, the ES module exports the API
described in :ref:`js-api`.  Otherwise, ``prog`` is an executable
that runs the ES module with Node.js, and implements the Futhark
server protocol.

OPTIONS
=======

Accepts the same options as :ref:`futhark-c(1)`.

ENVIRONMENT VARIABLES
=====================

``CFLAGS``

  Space-separated list of options passed to ``emcc``.  Defaults
  to ``-O3 -msimd128`` if unset.

``EMCFLAGS``

  Space-separated list of options passed to ``emcc``.

EXECUTABLE OPTIONS
==================

The following options are accepted by executables generated by
``futhark wasm``.

-h, --help

  Print help text to standard output and exit.

-D, --debugging

  Perform possibly expensive internal correctness checks and verbose
  logging.  Implies ``-L``.

-L, --log

  Print various low-overhead logging information to stderr while
  running.

-P, --profile

  Enable the collection of profiling information.

--param=ASSIGNMENT

  Set a tuning parameter to the given value.  ``ASSIGNMENT`` must be of
  the form ``NAME=INT``.

--print-params

  Print all tuning parameters that can be set with ``--param`` or
  ``--tuning``.

--tuning=FILE

  Read size=value assignments from the given file.

--cache-file=FILE

  Accepted for compatibility with other backends, but has no effect.

SEE ALSO
========

:ref:`futhark-c(1)`, :ref:`futhark-wasm-multicore(1)`