
Hello, I would like your help, in order to understand how to modify a cabal file in order to compile an Haskell modules with .c files (containing OpenMP pragma). I use FFI and a bunch of .c and .h files for the computation part. thanks for your help. I am runnng hc on Debian stable. Cheers Frederic

How do you mean? I assume you aren't using hsc2hs or c2hs? Do you have something like hslua already? https://github.com/hslua/hslua/blob/master/hslua.cabal#L131 On 9/1/19 2:26 AM, PICCA Frederic-Emmanuel wrote:
Hello,
I would like your help, in order to understand how to modify a cabal file in order to compile an Haskell modules with .c files (containing OpenMP pragma). I use FFI and a bunch of .c and .h files for the computation part.
thanks for your help.
I am runnng hc on Debian stable.
Cheers
Frederic _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

How do you mean? I assume you aren't using hsc2hs or c2hs?
I use hsc2hs, just to write the FFI bindings of my local c files.
Do you have something like hslua already? https://github.com/hslua/hslua/blob/master/hslua.cabal#L131
Yes, but it seems to me that I need to gives gcc this [1]. So how can I says to ghc, to compile the .c files with OpenMP activated ? [1] https://gcc.gnu.org/onlinedocs/libgomp/Enabling-OpenMP.html

Ah, I see. In the cabal file you can make a flag with cc-options. It goes in the same place ghc-options would. That's probably the easiest way to do it :) Example: https://hackage.haskell.org/package/fast-arithmetic-0.6.4.2/fast-arithmetic.... On 9/1/19 1:14 PM, PICCA Frederic-Emmanuel wrote:
How do you mean? I assume you aren't using hsc2hs or c2hs? I use hsc2hs, just to write the FFI bindings of my local c files.
Do you have something like hslua already? https://github.com/hslua/hslua/blob/master/hslua.cabal#L131
Yes, but it seems to me that I need to gives gcc this [1]. So how can I says to ghc, to compile the .c files with OpenMP activated ?
[1] https://gcc.gnu.org/onlinedocs/libgomp/Enabling-OpenMP.html

Ok, I just added: cc-options: -fopenmp ld-options: -fopenmp and it worked. thanks a lot. Fred
participants (2)
-
PICCA Frederic-Emmanuel
-
Vanessa McHale