Pages: 1
  Print  
Author Topic: OSX Trials and Tribulations  (Read 3099 times)
Offline (Unknown gender) sorlok_reaves
Posted on: August 26, 2014, 02:06:54 AM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Hello all,

So, I've been trying to get ENIGMA running on OSX Mavericks, but it seems that it's been some time since anyone used it. (If there are any OSX ENIGMA users out there, please chime in.) Problems are listed in order of appearance.

The compiler still hardcodes the include "/opt/X11/include", when it should be "/opt/local/include" (assuming MacPorts).

The application links "./ENIGMA" as the project path, when it should link "../ENIGMA" (or possibly ../../ENIGMA) due to how the working directory functions.

The built application is missing an Info.plist, so OSX complains it can't launch it. (This is probably related to the next issue.)

Adding an Info.plist to the built app and telling it "this is a Cocoa app" will cause the app to launch a terminal describing the current working directory, and then there's no further output. No OpenGL window is shown.

I'd really like to figure out how to get around these errors, but I'm not experienced with Mac development. Anyone have any ideas?
Logged
Offline (Unknown gender) TGMG
Reply #1 Posted on: August 26, 2014, 11:59:51 AM

Developer
Joined: Jun 2008
Posts: 107

View Profile WWW Email
Did you do this:
After cloning the repository run the following command in terminal to install the main binary files
python install.py mac

What do you mean ./ENIGMA in the project path? what project, the xcode project?

I still seems to work for me...
Logged
me
GMbed 2.0 :: Embed you gm games in websites.
Offline (Unknown gender) sorlok_reaves
Reply #2 Posted on: August 26, 2014, 12:17:34 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Did you do this:
After cloning the repository run the following command in terminal to install the main binary files
python install.py mac

What do you mean ./ENIGMA in the project path? what project, the xcode project?

I still seems to work for me...

Thanks for the feedback; I noticed that you've fixed a lot of OSX things in the past.

I actually ran "python install.py", but not "python install.py mac". I will try that.

In terms of ./ENIGMA in the path, I am trying to run a default (empty) project from LateralGM. So, I run "java -jar lateralgm.jar", then click "Run". The gcc output line includes "-I./ENIGMA", but it can't find the Preprocessor_Environment_Editable files (that ShellMain #includes) until I add "-I../ENIGMA".
Logged
Offline (Male) Josh @ Dreamland
Reply #3 Posted on: August 26, 2014, 09:20:32 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
Expert timing, TGMG. Nice to see you're still alive!

FWIW, uname -s works on the two operating systems you're trying to get install.py to support. :P

Anyway, cheeseboy moved those preprocessor_etc files since TGMG wrote the OS X port. It's probably a simple matter of figuring out where they end up on OS X and updating paths in the XCode project. I wouldn't own an Apple, so I can't be much help.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) sorlok_reaves
Reply #4 Posted on: August 30, 2014, 06:47:34 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Ok, thanks for the advice. I've had some luck building simple games; I'll update everyone once Iji builds.
Logged
Offline (Unknown gender) sorlok_reaves
Reply #5 Posted on: August 31, 2014, 08:33:26 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
We have progress:


Unfortunately, the game crashes immediately upon switching rooms with the following error message:
Code: [Select]
2014-08-31 18:19:03.027 EnigmaXcode[24227:7c03] self is not first responder
Bus error: 10
logout

I'll be working on OSX support as I can find time. However, I must note that the current code is NOT sufficient (or I am doing something very wrong). In particular:
  • The default compiler on OSX (gcc-llvm) does not work correctly; JDI is unable to find the definition for std::string. I traced this for a while --it's looking at the right file, but it gets confused somewhere along the way. So, I had to switch to gcc48 from Macports.
  • The file MacOS/build/Release/EnigmaXcode.app/Contents/Info.plist was missing (I copied it from a previous, revoked branch). In some cases, MacOS/build/Release/EnigmaXcode.app/Contents/Resources/English.lproj/MainMenu.nib would disappear (I think python install brings it in, but not sure.).
  • The Cocoa bindings are missing some functionality (key mappings). This is to be expected (xlib was missing them too previously).
  • The path errors I mentioned earlier.

The Iji port is so very close to working on OSX, but I think I've reached the limits of my creativity. I'll revisit this later, but if anyone knows what the "Bus error: 10" or "self is not first responder" messages mean, I'd really appreciate some feedback. For the record, I'm compiling with Lateral GM and gcc-4.8 from Macports.
Logged
Offline (Male) Josh @ Dreamland
Reply #6 Posted on: August 31, 2014, 08:57:13 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
The JDI bug... concerns me, vaguely. Do you know what JDI git revision ENIGMA master is on? This is probably something I've already fixed. If not, I'll ask you to send me a preprocessed version of the engine so I can triage it.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) sorlok_reaves
Reply #7 Posted on: August 31, 2014, 09:12:34 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
What's the easiest way to tell what JDI revision master is on? Also, I guess I am slightly off of master on my branch. The JDI I am using is this:
https://drive.google.com/file/d/0B1P7NepPcOslOVNsa0Y4eUNHb3c

Fixing so that this works with the default OSX gcc would be great, but I think it probably won't fix the runtime error I'm seeing.
Logged
Offline (Unknown gender) sorlok_reaves
Reply #8 Posted on: September 01, 2014, 12:41:09 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Ok, strangely, although compiling on OS-X is still not working right, I can cross-compile from Linux and the resulting binary runs on OS-X. Behold!
https://www.youtube.com/watch?v=qg-aRfj-_WI&feature=youtu.be

Thanks to everyone for your help on this; I guess for now I'm pretty happy to be able to compile for all 3 systems from Linux, as it's faster and easier for me.
Logged
Offline (Male) Goombert
Reply #9 Posted on: September 01, 2014, 02:48:02 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
I'd like to add that I am honestly surprised there are not a million more errors on Mac considering I've been contributing to that part of the repository for months without testing.

But I would like to ask how are you compiling for Windows from Linux? Using a VM or a cross-compiler?
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) sorlok_reaves
Reply #10 Posted on: September 01, 2014, 03:11:15 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Using a cross-compiler, detailed here:
http://enigma-dev.org/docs/Wiki/CrossCompileWithAudio

I am still having problems loading MP3s using this approach, so there's at least 1 thing I'm doing wrong.... but WAVs work.
Logged
Offline (Male) Goombert
Reply #11 Posted on: September 02, 2014, 10:36:35 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
I think you built OpenAL wrong because you need to compile it with the formats you expect to use. For instance take a look at sound_add it just reads the binary and then hands it to OpenAL.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) sorlok_reaves
Reply #12 Posted on: September 04, 2014, 10:01:40 AM
Contributor
Joined: Dec 2013
Posts: 261

View Profile


UPDATE: I would appreciate it if the OS-X developers could have a look at the following pull request and provide any feedback or criticism. (In addition to the normal devs, of course.)
https://github.com/enigma-dev/enigma-dev/pull/813



I think you built OpenAL wrong because you need to compile it with the formats you expect to use. For instance take a look at sound_add it just reads the binary and then hands it to OpenAL.

Thanks, I'm beginning to suspect that I did in fact build it wrong. This bug is high on my list; 150MB of WAV files is no fun for an 8 year old game.
Logged
Pages: 1
  Print