Making wine use the correct OpenGL libraries
-
- Level 2
- Posts: 21
- Joined: Wed Sep 02, 2009 11:56 pm
Making wine use the correct OpenGL libraries
I am trying to compile Wine under Snow Leopard and I finally managed to fix the issue where it could find the OpenGL development headers, but... having done that, it finds the wrong OpenGL libraries by default, in other words, running ./configure with:
./configure CPPFLAGS='-I/usr/X11/include'
Results in:
checking for GL/gl.h... yes
checking for GL/glx.h... yes
checking for GL/glu.h... yes
checking for up-to-date OpenGL version... yes
checking for -lGL... libGL.1.dylib
checking for -lGLU... libGLU.1.dylib
But at runtime it can't find the .1 versions of the libraries - I'm guessing because those aren't in the OpenGL framework folder. So, to make this work I'm assuming it needs to use libGL.dylib file instead. So, in a desperate attempt to fix this issue, I tried:
./configure CPPFLAGS='-I/usr/X11/include' LDFLAGS='-L/System/Library/Frameworks/OpenGL.framework/Libraries'
And this results in:
checking for GL/gl.h... yes
checking for GL/glx.h... yes
checking for GL/glu.h... yes
checking for up-to-date OpenGL version... yes
checking for -lGL... not found
checking for -lGL... not found
checking for -lGLU... libGLU.dylib
So now it finds the correct libGLU.dylib, but doesn't find libGL.dylib, which exists in the same directory. I think these problems are probably due to changes in Snow Leopard, in theory, all I should need to do is ./configure and it should all just work, but the OpenGL stuff is broken quite well.
./configure CPPFLAGS='-I/usr/X11/include'
Results in:
checking for GL/gl.h... yes
checking for GL/glx.h... yes
checking for GL/glu.h... yes
checking for up-to-date OpenGL version... yes
checking for -lGL... libGL.1.dylib
checking for -lGLU... libGLU.1.dylib
But at runtime it can't find the .1 versions of the libraries - I'm guessing because those aren't in the OpenGL framework folder. So, to make this work I'm assuming it needs to use libGL.dylib file instead. So, in a desperate attempt to fix this issue, I tried:
./configure CPPFLAGS='-I/usr/X11/include' LDFLAGS='-L/System/Library/Frameworks/OpenGL.framework/Libraries'
And this results in:
checking for GL/gl.h... yes
checking for GL/glx.h... yes
checking for GL/glu.h... yes
checking for up-to-date OpenGL version... yes
checking for -lGL... not found
checking for -lGL... not found
checking for -lGLU... libGLU.dylib
So now it finds the correct libGLU.dylib, but doesn't find libGL.dylib, which exists in the same directory. I think these problems are probably due to changes in Snow Leopard, in theory, all I should need to do is ./configure and it should all just work, but the OpenGL stuff is broken quite well.
Making wine use the correct OpenGL libraries
On Sep 4, 2009, at 6:35 AM, raziel2001au wrote:
path to X11, since Wine uses X and not system/Cocoa frameworks. Quick
and dirty:
export CC="gcc -arch i386 -m32"
export CXX="g++ -arch i386 -m32"
export CPPFLAGS="-I/usr/X11/include "
LDFLAGS="-L/usr/X11/lib "
LDFLAGS+="-framework CoreServices -lz -L/usr/X11/lib -lGL -lGLU "
export LDFLAGS
./configure
Once Wine is built and installed, you will also need to specify where
to look for libs at runtime as well:
DYLD_FALLBACK_LIBRARY_PATH="/usr/X11/lib:/usr/lib" wine progname.exe
So OpenGL is not broken; Mac OS X is picky, or broken to an extent,
and library search paths have to be set as such. I have had zero time
to touch Wine+Mac OS X recently. OpenGL apps work - at least simple
tests like wglgears - but I've run into some issues with the Direct3D
bits that I have, again, had zero time to investigate. I do have a
working Wine 1.1.29 built on Snow Leopard running a few OpenGL apps,
Firefox, etc., so a build is definitely doable.
ryan woodsmall
[email protected]
OpenGL stuff is not broken, just... changed. You need to specify theI am trying to compile Wine under Snow Leopard and I finally managed
to fix the issue where it could find the OpenGL development headers,
but... having done that, it finds the wrong OpenGL libraries by
default, in other words, running ./configure with:
...
But at runtime it can't find the .1 versions of the libraries - I'm
guessing because those aren't in the OpenGL framework folder. So, to
make this work I'm assuming it needs to use libGL.dylib file
instead. So, in a desperate attempt to fix this issue, I tried:
....
So now it finds the correct libGLU.dylib, but doesn't find
libGL.dylib, which exists in the same directory. I think these
problems are probably due to changes in Snow Leopard, in theory, all
I should need to do is ./configure and it should all just work, but
the OpenGL stuff is broken quite well.
path to X11, since Wine uses X and not system/Cocoa frameworks. Quick
and dirty:
export CC="gcc -arch i386 -m32"
export CXX="g++ -arch i386 -m32"
export CPPFLAGS="-I/usr/X11/include "
LDFLAGS="-L/usr/X11/lib "
LDFLAGS+="-framework CoreServices -lz -L/usr/X11/lib -lGL -lGLU "
export LDFLAGS
./configure
Once Wine is built and installed, you will also need to specify where
to look for libs at runtime as well:
DYLD_FALLBACK_LIBRARY_PATH="/usr/X11/lib:/usr/lib" wine progname.exe
So OpenGL is not broken; Mac OS X is picky, or broken to an extent,
and library search paths have to be set as such. I have had zero time
to touch Wine+Mac OS X recently. OpenGL apps work - at least simple
tests like wglgears - but I've run into some issues with the Direct3D
bits that I have, again, had zero time to investigate. I do have a
working Wine 1.1.29 built on Snow Leopard running a few OpenGL apps,
Firefox, etc., so a build is definitely doable.
ryan woodsmall
[email protected]
-
- Level 2
- Posts: 21
- Joined: Wed Sep 02, 2009 11:56 pm
Sorry, but I can't agree with you there... firstly, I haven't run into the 64-bit compilation issue you've mentioned at all - it seems to automatically set -m32 for me.
With regards to OpenGL, I would say it is very much broken because it refuses to use the OpenGL library file it should be using. If you do a ./configure (without parameters), it should automatically pick up the correct library/headers, but on Snow Leopard it doesn't. The header issue can be fixed with a -I/usr/X11/include. At this point it picks up GL libraries automatically, but it picks up libGL.1.dylib, which is NOT the correct library, it should be using the one in the frameworks folder (libGL.dylib), otherwise you'll run into the situation where you have to specify library fallback paths for it to work. On top of this, it is not guaranteed to work on other systems, if another user only has libGL.dylib, it won't work. You can force it to look in /System/Library/Frameworks/OpenGL.framework/Libraries, but it refuses to see libGL.dylib, which is the library it should be using. It really just skips over it for some reason. If I'm not mistaken I think the full path to that file is even hardcoded in the configure script - but it gets skipped and picks libGL.1.dylib instead.
The reason you have to enter a fallback library path is because your compiles are not using the correct GL library, as in, the one in the OpenGL.framework folder. If you compile under Leopard and transfer the binaries over to Snow Leopard, you do not need to specify fallback library paths or anything ridiculous like that - it just works and the result is transferrable to other Mac systems.
With regards to OpenGL, I would say it is very much broken because it refuses to use the OpenGL library file it should be using. If you do a ./configure (without parameters), it should automatically pick up the correct library/headers, but on Snow Leopard it doesn't. The header issue can be fixed with a -I/usr/X11/include. At this point it picks up GL libraries automatically, but it picks up libGL.1.dylib, which is NOT the correct library, it should be using the one in the frameworks folder (libGL.dylib), otherwise you'll run into the situation where you have to specify library fallback paths for it to work. On top of this, it is not guaranteed to work on other systems, if another user only has libGL.dylib, it won't work. You can force it to look in /System/Library/Frameworks/OpenGL.framework/Libraries, but it refuses to see libGL.dylib, which is the library it should be using. It really just skips over it for some reason. If I'm not mistaken I think the full path to that file is even hardcoded in the configure script - but it gets skipped and picks libGL.1.dylib instead.
The reason you have to enter a fallback library path is because your compiles are not using the correct GL library, as in, the one in the OpenGL.framework folder. If you compile under Leopard and transfer the binaries over to Snow Leopard, you do not need to specify fallback library paths or anything ridiculous like that - it just works and the result is transferrable to other Mac systems.
-
- Level 2
- Posts: 21
- Joined: Wed Sep 02, 2009 11:56 pm
Oh, just out of interest sake, I'm not 100% sure exactly which GL libs it should be using and what I'm saying is pretty much based on guesswork. What I can tell you is that Leopard compiles seem to 'just work' without setting funny environment variables and stuff... plus the fact that it's linking to libGL.1.dylib sounds incorrect to me.
All I'm saying is that the Wine devs will need to look at what the problem is. As things stand it definitely isn't okay. It took me 3 days to get a working compile, but the compile requires you to set that library fallback path whenever you need to run wine, furthermore, I want to distribute my compiles and this compile is definitely not fit for public consumption. At least, not when compiles are floating around without these funky library issues.
All I'm saying is that the Wine devs will need to look at what the problem is. As things stand it definitely isn't okay. It took me 3 days to get a working compile, but the compile requires you to set that library fallback path whenever you need to run wine, furthermore, I want to distribute my compiles and this compile is definitely not fit for public consumption. At least, not when compiles are floating around without these funky library issues.
Making wine use the correct OpenGL libraries
On Sep 5, 2009, at 3:53 AM, raziel2001au wrote:
Wine is an X11 program, no matter what *nix platform (Linux, BSD, OS
X) you're running on. It *has* to use the libGL provided by X11. You
don't have an understanding of how GL/GLX work under X11 on OS X - the
GL libs under /usr/X11/lib are essentially wrappers around the the
OpenGL framework. However, you cannot simply link Wine directly
against the system framework since the X11 interface that Wine uses is
not provided by the system frameworks. This is fact.
Please, understand something before commenting on it or saying that
"Wine devs need to look at what the problem is." There is no
problem. I am not a Wine dev, but I can get a working compile, with
little to no legwork, on Snow Leopard. I sent you what I use to
compile and run Wine on Leopard/Snow Leopard; it works, I use it every
day. If you can't be bothered to do some research on how the pieces
snap together, tough. And if you want to distribute your packages:
the minute someone asks you a question on the Wine/X11/OS X
integration and you can't answer it, well double tough.
ryan woodsmall
[email protected]
Well, all I can say is you're wrong.Sorry, but I can't agree with you there... firstly, I haven't run
into the 64-bit compilation issue you've mentioned at all - it seems
to automatically set -m32 for me.
With regards to OpenGL, I would say it is very much broken because
it refuses to use the OpenGL library file it should be using. If you
do a ./configure (without parameters), it should automatically pick
up the correct library/headers, but on Snow Leopard it doesn't. The
header issue can be fixed with a -I/usr/X11/include. At this point
it picks up GL libraries automatically, but it picks up libGL.
1.dylib, which is NOT the correct library, it should be using the
one in the frameworks folder (libGL.dylib), otherwise you'll run
into the situation where you have to specify library fallback paths
for it to work. On top of this, it is not guaranteed to work on
other systems, if another user only has libGL.dylib, it won't work.
You can force it to look in /System/Library/Frameworks/
OpenGL.framework/Libraries, but it refuses to see libGL.dylib, which
is the library it should be using. It really just skips over it for
some reason. If I'm not mistaken I think the full path to that file is
even hardcoded in the configure script - but it gets skipped and
picks libGL.1.dylib instead.
The reason you have to enter a fallback library path is because your
compiles are not using the correct GL library, as in, the one in the
OpenGL.framework folder. If you compile under Leopard and transfer
the binaries over to Snow Leopard, you do not need to specify
fallback library paths or anything ridiculous like that - it just
works and the result is transferrable to other Mac systems.
Wine is an X11 program, no matter what *nix platform (Linux, BSD, OS
X) you're running on. It *has* to use the libGL provided by X11. You
don't have an understanding of how GL/GLX work under X11 on OS X - the
GL libs under /usr/X11/lib are essentially wrappers around the the
OpenGL framework. However, you cannot simply link Wine directly
against the system framework since the X11 interface that Wine uses is
not provided by the system frameworks. This is fact.
Please, understand something before commenting on it or saying that
"Wine devs need to look at what the problem is." There is no
problem. I am not a Wine dev, but I can get a working compile, with
little to no legwork, on Snow Leopard. I sent you what I use to
compile and run Wine on Leopard/Snow Leopard; it works, I use it every
day. If you can't be bothered to do some research on how the pieces
snap together, tough. And if you want to distribute your packages:
the minute someone asks you a question on the Wine/X11/OS X
integration and you can't answer it, well double tough.
ryan woodsmall
[email protected]
-
- Level 2
- Posts: 21
- Joined: Wed Sep 02, 2009 11:56 pm
Re: Making wine use the correct OpenGL libraries
Okay, I get what you're saying - I really wish they'd document the proper compilation command on the Mac wiki page along with instructions on running it because it would have saved me days of trouble...ryan woodsmall wrote: Well, all I can say is you're wrong.
Wine is an X11 program, no matter what *nix platform (Linux, BSD, OS
X) you're running on. It *has* to use the libGL provided by X11. You
don't have an understanding of how GL/GLX work under X11 on OS X - the GL libs under /usr/X11/lib are essentially wrappers around the the
OpenGL framework. However, you cannot simply link Wine directly
against the system framework since the X11 interface that Wine uses is
not provided by the system frameworks. This is fact.
Re: Making wine use the correct OpenGL libraries
The wiki can be edited by anyone. Feel free to update it.raziel2001au wrote: Okay, I get what you're saying - I really wish they'd document the proper compilation command on the Mac wiki page along with instructions on running it because it would have saved me days of trouble...
Making wine use the correct OpenGL libraries
dimensio:
I would help, but I'm trying to solve a long standing missing component from Richedit that several programs I use needs.
James McKenzie
And it is very out of date according to Austin.raziel2001au wrote:The wiki can be edited by anyone. Feel free to update it.Okay, I get what you're saying - I really wish they'd document the proper compilation command on the Mac wiki page along with instructions on running it because it would have saved me days of trouble...
I would help, but I'm trying to solve a long standing missing component from Richedit that several programs I use needs.
James McKenzie
-
- Level 2
- Posts: 21
- Joined: Wed Sep 02, 2009 11:56 pm
-
- Level 2
- Posts: 21
- Joined: Wed Sep 02, 2009 11:56 pm
Then just make a separate section for SL.raziel2001au wrote:The problem is, I don't know enough about how smoothly the compile goes under Leopard to really be qualified to alter the instructions... I know how to do it under Snow Leopard. But are these issues SN specific or do they apply to Leopard as well?
-
- Level 2
- Posts: 21
- Joined: Wed Sep 02, 2009 11:56 pm
Well, I've now made the appropriate alterations to the wiki. I finally see what the whole architecture issue is about, if you compile the newer unstable Wine releases, you don't run into the 32bit vs. 64bit compiling issue, it just works...
The stable build on the other hand just fails horribly to compile under Snow Leopard, even with Ryan's recommended environment variables it still fails to compile for me, so I also added an additional note that says that the stable release doesn't deal with the new compiler defaulting to 64 bit and is therefore a pain to get working. The unstable releases seem to compile relatively painlessly once you know what you're doing though.
The stable build on the other hand just fails horribly to compile under Snow Leopard, even with Ryan's recommended environment variables it still fails to compile for me, so I also added an additional note that says that the stable release doesn't deal with the new compiler defaulting to 64 bit and is therefore a pain to get working. The unstable releases seem to compile relatively painlessly once you know what you're doing though.
Making wine use the correct OpenGL libraries
On Sep 8, 2009, at 8:32 AM, raziel2001au wrote:
1. The stable build (1.0.1) is just old
2. Just use the newest release.
I have a prereq and wine compile/install script almost complete;
Austin English had worked on one previously, but I've lost the mail/
thread, apparently. Will hopefully have something preliminary (i.e.,
maybe working but buggy) to send tomorrow.
ryan woodsmall
[email protected]
Well, I've now made the appropriate alterations to the wiki. I
finally see what the whole architecture issue is about, if you
compile the newer unstable Wine releases, you don't run into the
32bit vs. 64bit compiling issue, it just works...
The stable build on the other hand just fails horribly to compile
under Snow Leopard, even with Ryan's recommended environment
variables it still fails to compile for me, so I also added an
additional note that says that the stable release doesn't deal with
the new compiler defaulting to 64 bit and is therefore a pain to get
working. The unstable releases seem to compile relatively painlessly
once you know what you're doing though.
1. The stable build (1.0.1) is just old
2. Just use the newest release.
I have a prereq and wine compile/install script almost complete;
Austin English had worked on one previously, but I've lost the mail/
thread, apparently. Will hopefully have something preliminary (i.e.,
maybe working but buggy) to send tomorrow.
ryan woodsmall
[email protected]
-
- Level 2
- Posts: 21
- Joined: Wed Sep 02, 2009 11:56 pm
Re: Making wine use the correct OpenGL libraries
I haven't actually run into the 64-bit issue on 1.1.29 though - it adds -m32 and such automagically for me - and it just works, Direct3D included. I don't know if that's what you meant.ryan woodsmall wrote:I have a prereq and wine compile/install script almost complete;
Austin English had worked on one previously, but I've lost the mail/
thread, apparently. Will hopefully have something preliminary (i.e.,
maybe working but buggy) to send tomorrow.
-
- Level 2
- Posts: 21
- Joined: Wed Sep 02, 2009 11:56 pm
As part of my additions to the Building wine the minimal way on OS X section, I also added a new section titled: "Wine hints and tips", which I believe is a section sorely needed. It has hints and tips for things you should consider after the basic make. It lists your usage options (install versus running from the source path), it also mentions the DYLD_FALLBACK_PATH environment variable which is needed to get OpenGL/Direct3D apps working - not to mention helping it find its own libraries as well.
I finally also wish to expand that section with one more tip when I have time, namely, creating a minimal wrapper shell script to set things like the prefix and do the DYLD_FALLBACK_PATH stuff automatically for you so you don't have to type that laborious command every time you want to run wine. I'll see how it goes though, hopefully in the near future.
I finally also wish to expand that section with one more tip when I have time, namely, creating a minimal wrapper shell script to set things like the prefix and do the DYLD_FALLBACK_PATH stuff automatically for you so you don't have to type that laborious command every time you want to run wine. I'll see how it goes though, hopefully in the near future.