.. role:: ref(emphasis)

.. _futhark-ispc(1):

============
futhark-ispc
============

SYNOPSIS
========

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

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

``futhark ispc`` translates a Futhark program to a combination of C
and ISPC code, with ISPC used for parallel loops.  It otherwise
operates similarly to :ref:`futhark-multicore(1)`.  You need to have
``ispc`` on your ``PATH``.

OPTIONS
=======

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


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 -pthread`` if unset.

``ISPCFLAGS``

  Space-separated list of options passed to ``ispc``.  Defaults to
  ``-O3 --woff`` if unset.

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

Generated executables accept the same options as those generated by
:ref:`futhark-multicore(1)`.

LIBRARY USAGE
=============

When compiling a program ``foo.fut`` with ``futhark ispc --library``,
a ``foo.kernels.ispc`` file is produced that must be compiled with
``ispc`` and linked with the final program. For example::

  $ ispc -o foo.kernels.o foo.kernels.ispc --addressing=64 --pic --woff -O3

BUGS
====

Currently works only on Unix-like systems because of a dependency on
pthreads.  Adding support for Windows would likely not be difficult.

SEE ALSO
========

:ref:`futhark-multicore(1)`, :ref:`futhark-test(1)`
