Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

OpenCL fails to build on OSX Mavericks 10.9.1: c2hs cannot parse resource.h #40

Open
burtonageo opened this issue Dec 24, 2013 · 7 comments
Labels

Comments

@burtonageo
Copy link

On my machine, I cannot seem to be able to install OpenCL, as the following error appears:

Georges-MacBook-Pro:Downloads georgeburton$ cabal install opencl
Resolving dependencies...
Configuring OpenCL-1.0.3.4...
Building OpenCL-1.0.3.4...
Preprocessing library OpenCL-1.0.3.4...
c2hs: C header contains errors:

/usr/include/sys/resource.h:349: (column 75) [ERROR]  >>> Syntax error !
The symbol `=' does not fit here.

Failed to install OpenCL-1.0.3.4
cabal: Error: some packages failed to install:
OpenCL-1.0.3.4 failed during the building phase. The exception was:
ExitFailure 1

My GHC version is:
The Glorious Glasgow Haskell Compilation System, version 7.6.3

And my cabal version is:
cabal-install version 1.18.0.2
using version 1.18.1.2 of the Cabal library

@zhensydow
Copy link
Contributor

I apologized, I cann't test it nor prepare a fix. If someone can send a patch, I'll put in the hackage.

@burtonageo
Copy link
Author

What is the best way to dig deeper into cabal build problems? I'd like to know what's going on

@zhensydow
Copy link
Contributor

Well, the best way to test it is with a clone of the source repository instead of install the cabal package.

git clone git@github.com:IFCA/opencl.git

Or maybe with a fork. And then try get a fix it in your computer.

If the fix is founded and don't break current working versions (i'll test on linux) I can upload it to hackage.

@eccstartup
Copy link

I have exactly the same problem.

@dagit
Copy link
Contributor

dagit commented Mar 20, 2014

I just ran into this as well. The problem is that c2hs uses Language.C to parse headers and sometimes it's buggy or missing support for vendor specific extensions. Using a different FFI tool like hsc2hs would prevent problems like this. That's because hsc2hs uses gcc to process any C files and headers.

@zhensydow
Copy link
Contributor

I should try to switch to hsc2hs, but currently I don't have too much time.

@mietek
Copy link

mietek commented Jun 3, 2014

This is now haskell/c2hs#85.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants