C compiler selection in cabal package

Posted by ony on Stack Overflow See other posts from Stack Overflow or by ony
Published on 2010-03-27T10:25:26Z Indexed on 2010/03/27 10:33 UTC
Read the original article Hit count: 509

Filed under:
|

Today I've tried C compiler (Clang) for C code I use in my haskell library and found that I can gain speed increase in comparsing with my system compiler (GCC 4.4.3) from 426.404 Gbit/s to 0.823 Tbit/s So I decided to add some flags to control the way that C source file is compiled (i.e. something like use-clang, use-intel etc.).

Snippet of cabal package description file:

  C-Sources:    c_lib/tiger.c
  Include-Dirs: c_lib
  Install-Includes:     tiger.h

  if flag(debug)
      GHC-Options: -debug -Wall -fno-warn-orphans
      CPP-Options: -DDEBUG
      CC-Options: -DDEBUG -g
  else
      GHC-Options: -Wall -fno-warn-orphans

Question is: which options in descritpion file need to be modified to change C compiler used to compile "c_lib/tiger.c"? I did found only CC-Options.

© Stack Overflow or respective owner

Related posts about haskell

Related posts about cabal