Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 401
    • Issues 401
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !584

Document how to use the FFI

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Thomas Koopman requested to merge thomas/sac2c:help-message into index-types Jan 21, 2026
  • Overview 0
  • Commits 3
  • Changes 1
thomas@debian:~/repos/sac2c/build_p$ ./sac2c_p -h ffi

---------------------------------------------------------------------------
 SAC - Single Assignment C
---------------------------------------------------------------------------

Name:    sac2c
Version: 2.0.0-Tintigny-528-g5fdbd

FOREIGN FUNCTION INTERFACE (FFI) HELP:

        If you want implement a function in C, but for use from SaC, e.g.
                external double[n] foo(int m, double[n] x);
        you would use sac_int in the C-file, so
                void foo(sac_int m, SACARG x);
        In the C-file, you need to include <sacinterface.h> and compile with    sac2c_p -cc ccmod. You can pass additional C-flags with -Xc.
        For example, replace
                gcc -mfma kernel.c -o kernel.o
        with
                sac2c_p -cc ccmod -Xc -mfma kernel.c -o kernel.o
Edited Jan 21, 2026 by Thomas Koopman
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: help-message