simonmar / parconc-examples

Sample code to accompany the book "Parallel and Concurrent Programming in Haskell"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AccelerateCompat.hs compiling failed

HuangFJ opened this issue · comments

When i run the command below:

ghc -O2 fwaccel-gpu.hs -threaded

it states:

AccelerateCompat.hs:3:27:
     error: token is not a valid binary operator in a preprocessor subexpression
#if MIN_VERSION_accelerate(0, 14, 0)
    ~~~~~~~~~~~~~~~~~~~~~~^
1 error generated.

I googled it and found the solution here:
http://stackoverflow.com/questions/12546757/how-do-i-use-cabals-min-version-and-other-macros-with-ghci

I need the flags "-optP-include -optPdist/build/autogen/cabal_macros.h" when run ghc:

ghc -O2 fwaccel-gpu.hs -threaded -optP-include -optPdist/build/autogen/cabal_macros.h