-
Notifications
You must be signed in to change notification settings - Fork 17
Trouble building applications with Haskell GLUT and freeglut on OS X with GHC 7.10.1 #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It might also be worth mentioning that this occurs when trying to compile a module that uses template haskell. |
Do you have an example which fails without using TH? |
Same problem. GLUT Occurs when trying to load GLUT to GHCi. I tried loading the OSX's To be sure I checked the OSX's |
OK, so this seems to be unrelated to TH and to the specific Mac OS X version. Do you have GHC 7.8.3 or 7.8.4 on your Mac to check if this is a GHC 7.10 regression? In the meantime I'll try to get 7.10 running on a Mac, but this might take some time, normally I develop on Windows + Linux only, so some help would be appreciated. |
I checked it under GHC |
Thanks for the quick reply! So this really seems to be a GHC regression, and there's probably not much I can do about it. I'll try to find some hints in the various Haskell mailing lists, maybe there is some workaround. I don't think there's something special about GLUT, so other people probably already reported similar problems with other libraries. |
Thanks for looking into this, everyone! I haven't had time to respond since I originally filed this, and since it was unclear which piece of the toolchain was responsible for this issue, this seemed like a good guess as to where to file a bug and start looking. :) @svenpanne, my intuition was also that this probably has nothing specifically to do with GLUT, and the situation isn't helped by the fact that googling for my specific linking error yields results that are non-Haskell-related and many years old. I originally ran into this on a machine where GHC 7.8 worked fine but 7.10 yielded this behavior, to add to @jakzale's findings. |
The consensus seems to be that this is a GHC 7.8.4 => 7.10.1 regression, so I'll close this issue. If there are strong indicators that this is really caused by the GLUT package, then feel free to re-open this issue. |
@svenpanne So there is basically nothing I can do except rollback to 7.8.4? Can this be related to this: haskell/cabal#2330 |
To be honest, I don't have a clue if this is a Cabal problem or a GHC problem, and I don't have a Mac to test any kind of hypothesis, So your best bet is to ask on the ghc-users mailing list and/or open a bug on GHC's trac and Cabal's issue tracker... :-/ It would be good to know what causes this, and if there is a workaround which I might be able to incorporate in the GLUT package. |
Rydgel It would be great if you could file a ghc bug for 7.10.1, putting the word regression in the subject and stating that we would like it fixed by 7.10.3. 7.10.2 is about to ship. I have a Mac and would be happy to also test any fixes from ghc |
This GHC bug looks a lot like our problem: https://ghc.haskell.org/trac/ghc/ticket/10322 |
This is actually https://ghc.haskell.org/trac/ghc/ticket/10458, and not OS-specific. |
Oops I didn't read carefully enough. It's actually a separate issue (and has already been filed as https://ghc.haskell.org/trac/ghc/ticket/10568). |
Just letting you guys know a small work-around found by darchon for now.
|
OK, this confirms my theory about newer Cabals incorrectly dropping the GLUT framework during linking, although it is mentioned in GLUT's .cabal file. |
@svenpanne it's worse than that, there might be actually 2 bugs: https://ghc.haskell.org/trac/ghc/ticket/10568 |
Once https://phabricator.haskell.org/D1115 is merged in GHC, and haskell/cabal#2747 is merged in Cabal, this issue will be fixed. |
This is great news 👍 |
Recently I saw that it is not yet decided whether a ghc-7.10.3 release will actually happen, so perhaps we should make some noise over on the ghc mailing list to see this come to fruition. See also: |
That's a good idea, but at the moment I don't have access to a Mac, and I've lost track of which necessary changes are already in 7.10.2 and which ones aren't, so probably somebody with a Mac should make some noise. 😉 |
I'm a Mac and it's not working in 7.10.2. Trying to use github builds to fix it until 7.10.3 is released. |
@mostlyfabulous they probably won't release a 7.10.3. You can use my work-around with 7.10.2 tho. |
@Rydgel I'm quite new to git. Would I just download the latest master of Cabal and install it with: $ cabal install and then do the same for GHC? |
Well you could probably do that yes. To me it seems easier to reinstall GLUT in the projects you need with:
Up to you. |
Just to confirm, I wouldn't need to update Cabal from what you said right? All I have to do is reinstall with those flags? Thanks for the help as well. |
@mostlyfabulous exactly, just regular GHC and cabal worked for me. |
Doesn't seem like those flags work with GHC 7.10.2. I get this error when I try to use GLUT.
This happens multiple times during cabal install: "ld: warning: /System/Library/Frameworks//GLUT.framework/GLUT, ignoring unexpected dylib file" amongst other errors. I'll add the log file here incase anyone knows what went wrong. I ran "otool -L" and put the log at the bottom of the file. |
@mostlyfabulous You can ignore that error, that error is about linking the profiling lib (which is static). That is, using The
and all is well with the world. |
@christiaanb Thanks very much for explaining what's going on! I have no idea how to troubleshoot the errors I get from using the GLUT module now. I get this error when executing "main" for the Hello World example from: https://wiki.haskell.org/OpenGLTutorial1
And this error for executing "display (Go 30)" from a Haskell tutorial.
|
I'm seeing the same errors on my machine (OS X Yosemite). Indeed, the fixes I wrote for GHC and Cabal just made sure that the, as far as I knew, correct linker flags were passed. I never actually tested whether a GLUT application actually worked in ghci. My only test was to check if This seems worthy of a new GHC bug report. |
I'm also running OS X Yosemite (10.10.5). Agreed, it definitely deserves a bug report! |
Just for the record, in case you're using stack and until the bug is fixed, adding the following to
Then |
Hey guys. I am having the same issue: |
When I depend on the
GLUT
Haskell package (2.6
or newer) on GHC7.10.1
on OS X10.9.5
, the GLUT package builds and installs successfully, but applications that depend onGLUT
fail duringcabal install
with this kind of linking error:I'm not sure whether this is GHC's fault or an interaction between OS X, GHC 7.10.1, etc., but this seemed like a good place to report this.
The text was updated successfully, but these errors were encountered: