SVN Fails to Run in OS X

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

It should already use the proper frameworks under OSX:

Code: Select all

if test "x$is_macosx" = "xyes" ; then
      MACORPCLIBS="$OPENAL_LDOPTS -framework OpenAL"
      CHECK_FOR_OPENAL_LIB
    fi
    if test "x$have_openal_lib" = "xyes" ; then
      EPEE_DAY="september 30"
    else
      MACORPCLIBS="$OPENAL_LDOPTS -l$OPENAL_LIB_NAME"
      CHECK_FOR_OPENAL_LIB
    fi
I don't want to know what that EPEE_DAY is used for... :-P but it looks like it should *first* try the framework, and then the standard library.

Unfortnately I don't know enough about mac's to know why. Could you attach your latest config.log where it's using the wrong (/sw/) OpenAL library?
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

ace123 wrote:It should already use the proper frameworks under OSX:
Ahh, "SHOULD" -- great word.

I observe that config sets OpenAL to use the same directory as OpenGL. This is why I thought that an explicit "--with" command would work, if I knew the syntax to specify for it to use a framework.
Could you attach your latest config.log where it's using the wrong (/sw/) OpenAL library?
It is not using the *wrong* library. There is no OpenAL there for it to use.

As in the past, any effort to attach or append that file results in a time-out at sourceforge. I can send it in email if you give me an address to send it to.

****
[Edit -- been going through the config.log myself . . .]

Code: Select all

configure:13726: g++ -o conftest -g -O2 -I/Developer/SDKs/MacOSX10.2.8sdk/System/Library/Frameworks/Carbon.framework/Libraries/CIncludes  -Wno-long-double  conftest.cc  -framework OpenAL  >&5
/usr/bin/ld: warning /Library/Frameworks/OpenAL.framework/OpenAL cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
& later --

Code: Select all

configure:14065: g++ -c -g -O2 -I/Developer/SDKs/MacOSX10.2.8sdk/System/Library/Frameworks/Carbon.framework/Libraries/CIncludes  -Wno-long-double conftest.cc >&5
conftest.cc:150:22: error: AL/alext.h: No such file or directory
Two observations --

I have never had SDK 10.2.8 on this machine -- it is no longer included in XCode. Yesterday, I deleted SDK 10.3.9 SDK as it includes no code that runs on an Intel processor. By deleting it, I may more easily intercept & change additional references to it.

However, if I read this correctly, it did find the OpenAL framework; then rejected using it because the framework is not "universal" compiled. (Quotes because I don't really agree with Apple's choice of wording for code that runs only on PPC & i686 machines).
I want to live in Theory. Everything works in Theory.
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

This was appended as an edit to my last post -- but I just exceeded the line limit & sourceforge started timing out when I submitted it.

***
OpenAL.org is not currently functional, so I cannot compile it from source.

Apple claims that the installer that I used yesterday is the latest version & is waranted for 10.4.x. Implicitly, this means that Apple believes that it should run on an Intel processor as Apple requires "universal" binaries for 10.4.

***
Meanwhile, from the configure script, the problem code appears to me:

Code: Select all

if test "x$is_macosx" = "xyes" ; then
	CXXFLAGS="$CXXFLAGS -I/Developer/SDKs/MacOSX10.2.8sdk/System/Library/Frameworks/Carbon.framework/Libraries/CIncludes"
	CPPFLAGS="$CPPFLAGS -Wno-long-double"
        	VS_LIBS="$VS_LIBS -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks  -framework OpenGL -framework GLUT -framework CoreAudio"
    with_gl_inc=/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Libraries/CIncludes
    with_gl_libs=/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Libraries
    with_al_inc="/System/Library/Frameworks/OpenAL.framework/Headers -I/sw/include"
    with_al_libs="/System/Library/Frameworks/OpenAL.framework/ -L/sw/lib"
    PYTHON_LDOPTS="-L/System/Library/Frameworks/Python.framework"
    with_python_inc="/System/Library/Frameworks/Python.framework/Headers"
    VS_LIBS="$VS_LIBS -lobjc"
else
    VS_LIBS="$VS_LIBS -lutil"
fi
Notice the "-I/sw/include" & "-L/sw/lib" for OpenAL. These are the very switches that are causing the problem because there is no OpenAL available through Fink.

I have made the obvious change from the 10.2 to 10.4 SDK, but that is not enough to resolve the problem. This appears to be the only reference in the file to the obsolete SDK.
I want to live in Theory. Everything works in Theory.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

What happens if you comment out the "with_al" lines and let the m4scripts/VS_CHECK_OPENAL.m4 take over?
dandandaman
Artisan
Artisan
Posts: 1270
Joined: Fri Jan 03, 2003 3:27 am
Location: Perth, Western Australia
Contact:

Post by dandandaman »

okay, yeah, that 10.2.8 reference should not have been as it was ... good catch

and you seem to have been right on the ball with the openAL problem, it seems as if it is not being detected as universal at all....

from apples site I see
"OpenAL is delivered as part of Mac OS X v10.4 Tiger."

but that wasn't true for me... did you take the obvious option and download the creative version? I seriously doubt if that would be universal (release date is a little early :-) )...

if you did, i guess try and find the official version and install that guy ... probably in one of the xcode packages 'eh?

if not, then where did you get it from?

Dan
"Computers are useless. They can only give you answers."
-- Pablo Picasso
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

ace123 wrote:What happens if you comment out the "with_al" lines and let the m4scripts/VS_CHECK_OPENAL.m4 take over?
Good idea. I get a configure script that runs. Unfortunately, it also crashes.

If I run "make vegastrike" after a failed "make check", then I get:

Code: Select all

!10:[admin]> make vegastrike
g++  -g -O2 <snip: another 9800 characters of switches>
/usr/bin/ld: Undefined symbols:
_buffers
_sounds
collect2: ld returned 1 exit status
make: *** [vegastrike] Error 1
***
dandandaman wrote:okay, yeah, that 10.2.8 reference should not have been as it was ... good catch
I suggest officially switching to 10.4u SDK. A 10.3 user can download it from Apple & it will work on their machine (Or, search & replace with 10.3.9 if they don't want to give an email address to Apple). A 10.5 user will have it in XCode3 (I checked). It is the oldest SDK that supports both PPC & Intel.
and you seem to have been right on the ball with the openAL problem, it seems as if it is not being detected as universal at all....
It continues to test as PPC only. The website for OpenAL continues to be absent.
from apples site I see "OpenAL is delivered as part of Mac OS X v10.4 Tiger." but that wasn't true for me...
It was not in my install either.
did you take the obvious option and download the creative version?
Yes. The link from Apple goes to the Creative binary. Really, that was the only option, as openal.org will not load. However, Apple appears to expect for me to find a 1.2.x binary there instead of 1.0.13.
I seriously doubt if that would be universal (release date is a little early.
Not necessarily. Developers got the cross compile SDK & instructions on how to use it more than a year before that. Of course, given the way that software gets written in real life, I will need to concede your point.

In the developer FAQ, Apple writes:
Apple wrote:OpenAL v1.2. In Mac OS X v10.4Tiger, this version is packaged inside a 1.0 framework.
For Apple, if it claims that {software} runs in v10.4, it is *supposed* to mean that it runs on any production machine. BUT, that does not appear to be the case in this situation.

There is an "out" here, though -- the package available at creative is v1.0.13 -- i.e. not the version that Apple claims is current. Presumably, there exists source code & possibly binaries (somewhere) for something newer.

SO, if I compile from source, it should run on my machine. But, I cannot get the source code from where it is supposed to be & it does not appear to be mirrored anywhere obvious. I can look for a newer binary with some reasonable expectation that it might exist. But Creative does not currently offer it & neither Fink nor Apple do either.

The only other place I can think of to look for it is to re-install 10.5 & install XCode3 -- on the assumption that Apple finally *did* include it as of 10.5. Then, pillage the 10.5 file tree for the framework.
I want to live in Theory. Everything works in Theory.
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

I have now satisfied the OpenAL dependency, but still do not have a binary.

OpenAL --
OpenAL *is* included in the 10.4 base install. Frameworks for both OpenGL & OpenAL are located in "/System/Library/Frameworks". However, this OpenAL is the same one that I downloaded from creative. I.e., it is a PPC only compile.

I located a more recent compile of OpenAL in the same place in the 10.5 tree & updated my framework.

Configure --
This made no difference until I re-implemented the suggestion to comment the two "with_al" lines in the config script. The m4 check script has consistently & correctly located OpenAL in /System/Library/Frameworks/.

This, however, brings me back to exactly the same error as on Tuesday --

Code: Select all

!10:[admin]> make vegastrike
g++  -g -O2 <snip: another 9800 characters of switches>
/usr/bin/ld: Undefined symbols:
_buffers
_sounds
collect2: ld returned 1 exit status
make: *** [vegastrike] Error 1
It now appears that THIS error is not because of the OpenAL dependency at all.

THUS, I am back to "stuck".
I want to live in Theory. Everything works in Theory.
maddanio
Trader
Trader
Posts: 20
Joined: Tue May 30, 2006 9:01 pm
Location: Germany
Contact:

python

Post by maddanio »

I thought i'd throw in my 2 cents:

I just took vegastrike from svn. Installed all it's dependencies with macports which goes to /opt/local which I mirror (using stow) over to /usr/local. That makes configure quite happy. I only had to change the check for libpython.*.so to libpython.*.dylib. dylib is osx's extension for dynamic libs. I think there is an autoconf macro to check for the extension (also giving .dll on windows f.e.). then it just applies -lpython.* to lldflags which is ok.

I will report back when/if it builds ok.
--------------
Daniel Oberhoff
maddanio
Trader
Trader
Posts: 20
Joined: Tue May 30, 2006 9:01 pm
Location: Germany
Contact:

...build

Post by maddanio »

Hmmm, ok, apple's openal didn't do it (10.4 latest intel). So I installed openal from source using macports again. configure seems too happy with OpenAL.framework to accept my --with-openal-inc, so I had to beat it to it by adding /usr/local/include/openal to CPPFLAGS. That went up to linking. That failed because there are weird direct references into both the 10.2 SDK (which I dont have) and the 10.3 sdk (which I have but didnt really want there). So fixed that, also removed -lGL and -GLU and it worked. Funny thing is it worked without linking macports openal, so I assume the needed alut functions are there but no header for them or something (using macports lib actually distorted all sound, which I think is because of endianness issues that I have read about elsewhere). I don't get music though, although ogg was supposedly enabled, but otherwise, great ;). hope this helps with making svn smoother on osx tiger for the masses.
--------------
Daniel Oberhoff
maddanio
Trader
Trader
Posts: 20
Joined: Tue May 30, 2006 9:01 pm
Location: Germany
Contact:

finally...

Post by maddanio »

ok, I forgot the soundserver. so after make soundserver (applied the same corrections to the linkline), copying soundserver and vegastrike to their places in the 4.3 app bundle and building and using vssetp (./build sh macbuild.sh, fixed the references to gtk by using plain -lg* syntax) its all dandy. looks nice! hmm, is there a way to enable antiaaliasing? :)
--------------
Daniel Oberhoff
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

I am not clear how this is supposed to help me to duplicate your success --
You appear to have done exactly everything that I did, up to and including to replace OpenAL, and then NOT had the error that I end with.
I want to live in Theory. Everything works in Theory.
maddanio
Trader
Trader
Posts: 20
Joined: Tue May 30, 2006 9:01 pm
Location: Germany
Contact:

Post by maddanio »

Hmm, let's see, did you link against the replaced openal? because I only used the header alut.h to resolve the reference to alutWAVmemory in al_driver.cpp. I actually also tried linking against the other openal, and that worked except for messed up sound output (probably an endian issue) but that one was built from source, so maybe also different. hmm, also, you mentioned using a 10.5 framework. are you actually using leopard developer seed? or did you just replace the framework? the latter wil very probably result in missing links. also, did you link against the native or a fink python?
--------------
Daniel Oberhoff
Shissui
ISO Party Member
ISO Party Member
Posts: 433
Joined: Wed Feb 07, 2007 9:27 pm

Post by Shissui »

maddanio wrote:Hmm, let's see, did you link against the replaced openal? because I only used the header alut.h to resolve the reference to alutWAVmemory in al_driver.cpp.
Yes, in that I replaced the OpenAL provided by Apple & then allowed VS_CHECK_OPENAL.m4 to locate it as before.
I actually also tried linking against the other openal, and that worked except for messed up sound output (probably an endian issue) but that one was built from source, so maybe also different.
I have stored the 10.4 OpenAL & the creative OpenAL framework in trash [actually, they are the same PPC only framework -- hence why they failed], so that they will not be found by the configure script. Although I already verified that the m4 script looks for the framework in /System/Library/Frameworks/
hmm, also, you mentioned using a 10.5 framework. are you actually using leopard developer seed? or did you just replace the framework? the latter wil very probably result in missing links. also, did you link against the native or a fink python?
I am not using the developer seed, but I do have it available. My machine is booted from 10.4.9 with all updates through 07Mar16.

I copied the developer seed framework from the 10.5 drive to replace the framework provided by Apple (/System/Library/Frameworks/). I tried to get the source, but gave up trying to reach openal.org after 3 days of timeouts.

I linked explicitly to the fink python.

***
However, following from your example, I found that there is no alut.h in the 10.5 framework. I scavenged (al.h; alut.h) & put them where configure went to look for it first (/usr/include/).

Configure. Make vegastrike. Same error --

Code: Select all

/usr/bin/ld: Undefined symbols:
_buffers
_sounds
collect2: ld returned 1 exit status
make: *** [vegastrike] Error 1
Presumably, I have avoided some problem, but not the one that is blocking the compile.

The obvious next question -- what is supposed to be in "/usr/bin/ld" that it is not finding ?
I want to live in Theory. Everything works in Theory.
maddanio
Trader
Trader
Posts: 20
Joined: Tue May 30, 2006 9:01 pm
Location: Germany
Contact:

Post by maddanio »

Shissui wrote:
maddanio wrote:Hmm, let's see, did you link against the replaced openal? because I only used the header alut.h to resolve the reference to alutWAVmemory in al_driver.cpp.
Yes, in that I replaced the OpenAL provided by Apple & then allowed VS_CHECK_OPENAL.m4 to locate it as before.
Hi, dunno if this is still actual, but I didn't actually replace the framework from apple at all, I just phased in the alut.h header into the include path. So I am still linking Apple's OpenAL.
--------------
Daniel Oberhoff
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

for the record the openAL provided by apple has a race condition (removing the loop called "warming memory" will cause the race condition to become much more clear

in order to get working sound, you must use the linux openAL built on OS X and then adjust the frequency to 22050 I believe...
this was all done for the OS X 0.5.0 beta 1
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
maddanio
Trader
Trader
Posts: 20
Joined: Tue May 30, 2006 9:01 pm
Location: Germany
Contact:

Post by maddanio »

hellcatv wrote:for the record the openAL provided by apple has a race condition (removing the loop called "warming memory" will cause the race condition to become much more clear

in order to get working sound, you must use the linux openAL built on OS X and then adjust the frequency to 22050 I believe...
this was all done for the OS X 0.5.0 beta 1
Are there any detailed instructions on how to do that? I am actually haveing a bit of a hard time on figureing out on how to make an app use a private framework instead of a system one (on developer.apple.com I can only find how to do this with XCode). Also, how do I adjust the frequency (and why? does that mean I will have to live with lofi sound from now on?) :).
--------------
Daniel Oberhoff
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

I recommend just disabling sound "--disable-sound"... but if you are interested in hacking at openal... I don't have a Mac, so I'm not sure about the specifics.

Frequency is a setting in "vegastrike.config".

As to compiling with a custom framework it probably involves hacking at the command line you pass to GCC (i.e. copy whatever "make" gives you when linking (you know because it's the really long command line) and change it slightly.

I think what you want to do to build your copy of OpenAL is to download the linux openal source code, then compile it for the Mac with a ./configure, make, etc.

It should produce a ".a" library file, and copy the full path to that .a and add it to the vegastrike linking command line so that GCC will find it... at least that's how you do this in other Unix-based operating systems... I suspect the Mac's "framework" thing only makes it more complicated than this.
Post Reply