FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: Building on Mac OS Snow Leopard 10.6.8  (Read 3376 times)

frickler

  • Newbie
  • Posts: 4
    • View Profile
Building on Mac OS Snow Leopard 10.6.8
« on: February 04, 2014, 09:00:34 pm »

Hi everyone!

scons gave me this:

Code: [Select]
engine/core/ext/glee/GLee.cpp: In function 'void (* __GLeeGetProcAddress(const char*))()':
engine/core/ext/glee/GLee.cpp:73:38: error: invalid conversion from 'void*' to 'GLEE_FUNC {aka void (*)()}' [-fpermissive]
  return SDL_GL_GetProcAddress(extname);
                                      ^
scons: *** [build/engine/release/core/ext/glee/py_GLee.os] Error 1
scons: building terminated because of errors.

Running:
XCode 4.2
python 2.6
and all dependencies following this guide:
http://wiki.unknown-horizons.org/w/Build_OSX_Snow_Leopard

I have absolutely no clue what's going on, or on which level something went terribly wrong. Didn't find anything similar on Google. Would appreciate any hint!

Thanks!
« Last Edit: February 04, 2014, 09:07:51 pm by frickler »
Logged

helios

  • Developer
  • Jr. Member
  • *
  • Posts: 61
    • View Profile
Re: Building on Mac OS Snow Leopard 10.6.8
« Reply #1 on: February 05, 2014, 10:14:04 am »

Welcome frickler  :D

I think the problem was introduced with the new Glee version. The original problem is that building on MacOSX 10.9. failed. We have also an branch for that issue here https://github.com/fifengine/fifengine/tree/macosbuild

You can try different glee version, replace both glee files in fifengine/engine/core/ext/glee.
Here is the branch version http://www.file-upload.net/download-8589635/glee_branch.rar.html
and here the old version from last release http://www.file-upload.net/download-8589650/glee_old.rar.html

I hope this helps, keep us up to date.
Logged

frickler

  • Newbie
  • Posts: 4
    • View Profile
Re: Building on Mac OS Snow Leopard 10.6.8
« Reply #2 on: February 05, 2014, 12:04:11 pm »

Thanks for the quick reply, helios.

Though I have no more than basic understanding of C/C++, I actually found a solution out of pure curiosity, by changing the problematic line 73 from
Code: [Select]
return SDL_GL_GetProcAddress(extname);to
Code: [Select]
return (GLEE_FUNC)SDL_GL_GetProcAddress(extname);which matches the pattern of the other returns from the same if-block.

It compiled all the way through. :)

I didn't get to run Unknown Horizons anyway, because of some python version mismatch similar to this one:
http://forum.unknown-horizons.org/viewtopic.php?f=32&t=461

This method didn't work for me:
http://forums.fifengine.net/index.php?topic=308.15

It says:
Quote
The problems are many fold. First, scons from macports depends on python 2.6, which fink insists on compiling for itself. Also, the fink dependencies for the python packages (like yaml), are installed for macports python 2.6, NOT the system 2.6.

Furthermore, the fink python 2.6 builds as a framework, but it's broken. Consequently, when you build fife, it builds against the system python. Furthermore, the system python is installed as "python" but the macports python 2.6 is installed as "python2.6"

I don't use fink, but this makes sense so far and seems to apply.

Code: [Select]
$ port select --list python
Available versions for python:
none
python25-apple
python26 (active)
python26-apple
python27

Selecting python Version with
Code: [Select]
$ sudo port select python python26does work, and when running python from command line I get the right thing:
Code: [Select]
$ sudo port select python python27
Selecting 'python27' for 'python' succeeded. 'python27' is now active.
$ python -V
Python 2.7.6
Code: [Select]
$ sudo port select python python26
Selecting 'python26' for 'python' succeeded. 'python26' is now active.
$ python -V
Python 2.6.9

Building FIFE that way shows that the right version of python seems to be used:
Code: [Select]
... -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 ...because it changes when I select, say 2.7
Code: [Select]
... -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 ...which will get the known error
Code: [Select]
ld: symbol(s) not found for architecture x86_64
If I call:
Code: [Select]
$ otool -L <fife-dir>/build/release/_fife.soI get:
Code: [Select]
... /System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1) ...which obviously is python26-apple, exactly as dsrogers writes.

Then I followed the instructions:
Quote
1)
Fix the python2.6 framework so that fife can link against it.  Then fix all references to "python" in the tops of scripts to be "python2.6" (or symlink python2.6 as python, probably in ~/bin or something).
Made sure that macport python Framework is linked to 2.6:
Quote
$ cd /opt/local/Library/Frameworks/Python.framework
$ cd Versions
$ ln -s 2.6 Current
$ cd ..
$ ln -s Versions/Current/Python Python
$ ln -s Versions/Current/Headers Headers
$ ln -s Versions/Current/Resources Resources

Now, what confuses me, after rebuilding and checking with otool, I still see the system python linked.

Running UH of course causes:
Code: [Select]
$ python2.6 ./run_uh.py
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap
And python crashes.

Has anyone an idea what is going on?
Logged

frickler

  • Newbie
  • Posts: 4
    • View Profile
Re: Building on Mac OS Snow Leopard 10.6.8
« Reply #3 on: February 05, 2014, 01:54:04 pm »

It's a hackish "solution", but I linked the system's python in /System/Library/Frameworks/Python.framework to macports' python in /opt/local/Library/Frameworks/Python.framework.

It built FIFE and even got to call UH without version mismatch. I hope that helps anyone having the same problems.



After installing another bunch of dependencies I got stuck at:
Code: [Select]
$ python2.6 ./run_uh.py
Python(96495,0x7fff7098bcc0) malloc: *** error for object 0x102339220: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap

This may be just about anything. :-\
« Last Edit: February 05, 2014, 02:04:03 pm by frickler »
Logged

helios

  • Developer
  • Jr. Member
  • *
  • Posts: 61
    • View Profile
Re: Building on Mac OS Snow Leopard 10.6.8
« Reply #4 on: February 07, 2014, 10:58:29 am »

Thank you for the build fix :)

Do you get the same error on fife demos and tests?
Logged

frickler

  • Newbie
  • Posts: 4
    • View Profile
Re: Building on Mac OS Snow Leopard 10.6.8
« Reply #5 on: February 07, 2014, 11:05:40 am »

Haven't tried those yet, will post results as soon as find time.
Logged