Author Topic: [fixed] Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)  (Read 3237 times)

macuser

  • Guest
Hello,

compiling MegaGlest from trunk (as described in Wiki entry "MG/Mac Compiling") does not work for Mac OS X (10.6.5):
"svn co https://megaglest.svn.sourceforge.net/svnroot/megaglest/trunk megaglest" works ok, of course.
But "cmake -GXcode" in directory "megaglest" ends with a problem about XerxesC:
Code: [Select]
mb:megaglest macuser$ cmake -GXcode
-- Build type for this compile will be:
-- Detected GNUC Compiler...
CMake Error at /opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find XercesC (missing: XERCESC_LIBRARY XERCESC_INCLUDE_DIR)
Call Stack (most recent call first):
  /opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  mk/cmake/Modules/FindXercesC.cmake:23 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  source/shared_lib/CMakeLists.txt:54 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!

How did you compile this from trunk for Mac OS X 10.6.5?
Thanks for your hints and a Happy New Year 2011!
« Last Edit: 18 June 2016, 14:15:44 by filux »

macuser

  • Guest
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #1 on: 12 January 2011, 07:13:29 »
Sorry to bump, but someone had this compiled, or not? Any hints are welcome, thanks.

By the way, the above linked Wiki "MG/Mac Compiling" seems to miss something re. the 3rd party libraries:
Quote
Retrieve the 3rd libraries from here : and extract the contact of the archive in your library directory ~/Library/Frameworks
After "here:" there is no link, so were do we get these from?

Now I tried again (after update of Xcode), but it failed again:
Code: [Select]
Updated to revision 1518.
mb:megaglest macuser$ cmake -GXcode
-- Build type for this compile will be:
-- Detected GNUC Compiler...
-- Found CURL: /usr/lib/libcurl.dylib
-- curl version=[7.19.7]
-- (please visit http://curl.haxx.se/libcurl/ to find a newer version)
CMake Error at source/shared_lib/CMakeLists.txt:69 (message):
   CURL version = [7.19.7] we require AT LEAST [7.21.0]

-- Configuring incomplete, errors occurred!

How do I update curl to at least 7.21.0 on Mac OS X? The following did not work:
Code: [Select]
bash-3.2$ sudo port update curl
Password:
dlopen(/opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib, 10): no suitable image found.  Did find:
/opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib: no matching architecture in universal wrapper
    while executing
"load /opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib"
    ("package ifneeded macports 1.0" script)
    invoked from within
"package require macports"
    (file "/opt/local/bin/port" line 39)
« Last Edit: 12 January 2011, 07:21:16 by macuser »

m0ellemeister

  • Guest
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #2 on: 13 January 2011, 01:34:00 »
Hi macuser,

at the moment i'm working on modifications to get MG build on FreeBSD using cmake. After that is finnished sucessfully i'll try to get into it on MacOSX. I don't have any skills in Xcode, but if we work together maybe we can get MG working on OSX :-)

macuser

  • Guest
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #3 on: 13 January 2011, 07:49:26 »
Hello m0ellemeister,

that sounds great, and I am looking forward to contribute to testing etc. While my experience with Xcode is also limited, I am glad to help in any way.
I have realized that my problem with cmake and the seemingly outdated version of curl could not be resolved, because I had used the macports version for OS X Leopard, while meanwhile running OS X Snow Leopard. There is a .dmg package available on the macports website also for Snow Leopard.
Then "sudo port selfupdate; sudo port upgrade outdated" should help to also update curl, which I cannot test right now (have to leave).

I read that a lot of people have problems with macports after upgrading OS X Leopard to Snow Leopard.
Reportedly, the best way is to completly re-install macports after OS X upgrade.

Sorry to post very OS X- (or rather macports) related stuff here, but it may help to get MG running on OS X, too, hopefully.

PS:
An alternative to macports to get the necessary building tools (i.e. those which are not included with Xcode as far as I understand it) on board is fink.
If there are any further OS X users around, please let us know your hints on how to get MG running, maybe incl. some background info re. Xcode etc., too. Thanks.
« Last Edit: 13 January 2011, 17:37:23 by macuser »

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #4 on: 13 January 2011, 21:37:45 »
The biggest issue here stopping people from helping you is the fact you are on a mac. Macs are the lowest minority here, and are not generally the choice option for a programmer. There was one guy who did have a mac and was trying to keep up to date Mac versions, but I'm not sure if he's still active on the board.

Sorry, but using a mac is going to make this a lot harder. You could try also installing a free Linux operating system alongside that mac for gaming, etc; You may even find linux preferable over the mac (it's a lot different, but also more popular among the tech experienced who aren't hypnotized by the apple logo).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

macuser

  • Guest
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #5 on: 14 January 2011, 07:22:47 »
While I appreciate your hint using Linux instead, I would like to express that I am not hypnotized by the Apple logo. :)
I simply use my Macbook for daily stuff, and it works like a charm. Besides, I also use a virtualized Ubuntu on my Macbbook, which also works nicely for developing and testing stuff (I use it to continuously update my router FW from an svn repository/ project) but virtualization is a little bit too slow for MG or other decent games. Of course it works nicely with dualboot, but booting down OS X and booting up Linux whenever I would like to have a short game session is a little bit annoying. Anyway, I stick to my MB and eventually MG will run on it... or not. ;)

m0ellemeister

  • Guest
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #6 on: 29 January 2011, 00:29:10 »
short Update.

I'm not able to generate a valid Xcode Project file using cmake. But doing it the "unix" way using gnumake for compiling i had come so far:

Code: [Select]
[ 26%] Built target streflop
[ 26%] Building C object source/shared_lib/CMakeFiles/libglest.dir/sources/platform/miniupnpc/miniupnpc.c.o
~/Downloads/MegaGlest-svn/megaglest/source/shared_lib/sources/platform/miniupnpc/miniupnpc.c: In function ‘upnpDiscover’:
~/Downloads/MegaGlest-svn/megaglest/source/shared_lib/sources/platform/miniupnpc/miniupnpc.c:493: error: ‘IP_MULTICAST_IF’ undeclared (first use in this function)
~/Downloads/MegaGlest-svn/megaglest/source/shared_lib/sources/platform/miniupnpc/miniupnpc.c:493: error: (Each undeclared identifier is reported only once
~/Downloads/MegaGlest-svn/megaglest/source/shared_lib/sources/platform/miniupnpc/miniupnpc.c:493: error: for each function it appears in.)
gnumake[2]: *** [source/shared_lib/CMakeFiles/libglest.dir/sources/platform/miniupnpc/miniupnpc.c.o] Error 1
gnumake[1]: *** [source/shared_lib/CMakeFiles/libglest.dir/all] Error 2
gnumake: *** [all] Error 2

I don't know which dependency is missing.... Maybe someone can point me on it?

Because i'm not able to solve the issue, that cmake won't generate a valid xcode project file, i'll keep my focus on building MG using cmake/gnumake. As soon as i'm able to build MG this way, i'll try to build with Xcode using the Unix style Makefile.

m0ellemeister

  • Guest
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #7 on: 29 January 2011, 00:52:50 »
I could solf this by myself. I had to tweak the miniupnp.c file at the top:
Code: [Select]
#if defined(__APPLE__)
#define _DARWIN_C_SOURCE
#endif

But now i have a new problem:

Code: [Select]
Linking CXX executable ../../../data/glest_game/glest.bin
ld: warning: in /Library/Frameworks//SDL.framework/SDL, missing required architecture x86_64 in file
ld: warning: in /Library/Frameworks//OpenAL.framework/OpenAL, missing required architecture x86_64 in file
Undefined symbols:
  "_SDL_GetKeyState", referenced from:
      Shared::PlatformCommon::isKeyDown(int)  in liblibglest.a(platform_common.cpp.o)
« Last Edit: 29 January 2011, 12:53:45 by m0ellemeister »

m0ellemeister

  • Guest
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #8 on: 30 January 2011, 00:46:35 »
At the moment i'm stuck at this point:

Code: [Select]
[ 94%] Building CXX object source/glest_game/CMakeFiles/glest.bin.dir/world/world.cpp.o
cc1plus: note: -ftree-vectorize enables strict aliasing.  -fno-strict-aliasing is ignored when Auto Vectorization is used.
Linking CXX executable ../../../data/glest_game/glest.bin
[ 94%] Built target glest.bin
Scanning dependencies of target run
[ 94%] Generating mg.tmp
[ 95%] Built target run
Scanning dependencies of target glest_editor
[ 96%] Building CXX object source/glest_map_editor/CMakeFiles/glest_editor.dir/main.cpp.o
cc1plus: note: -ftree-vectorize enables strict aliasing.  -fno-strict-aliasing is ignored when Auto Vectorization is used.
In file included from /usr/include/wx-2.8/wx/mac/glcanvas.h:4,
                 from /usr/include/wx-2.8/wx/glcanvas.h:60,
                 from ~/Downloads/MegaGlest-svn/megaglest/source/glest_map_editor/main.h:19,
                 from ~//Downloads/MegaGlest-svn/megaglest/source/glest_map_editor/main.cpp:12:
/usr/include/wx-2.8/wx/mac/carbon/glcanvas.h:49: warning: ‘AGLDrawable’ is deprecated (declared at /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/AGL.framework/Headers/agl.h:48)
/usr/include/wx-2.8/wx/mac/carbon/glcanvas.h:53: warning: ‘AGLDrawable’ is deprecated (declared at /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/AGL.framework/Headers/agl.h:48)
[ 96%] Building CXX object source/glest_map_editor/CMakeFiles/glest_editor.dir/map.cpp.o
cc1plus: note: -ftree-vectorize enables strict aliasing.  -fno-strict-aliasing is ignored when Auto Vectorization is used.
[ 96%] Building CXX object source/glest_map_editor/CMakeFiles/glest_editor.dir/program.cpp.o
cc1plus: note: -ftree-vectorize enables strict aliasing.  -fno-strict-aliasing is ignored when Auto Vectorization is used.
[ 97%] Building CXX object source/glest_map_editor/CMakeFiles/glest_editor.dir/renderer.cpp.o
cc1plus: note: -ftree-vectorize enables strict aliasing.  -fno-strict-aliasing is ignored when Auto Vectorization is used.
Linking CXX executable ../../../data/glest_game/glest_editor
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.6.o
     (maybe you meant: _SDL_main)
ld: symbol(s) not found
collect2: ld returned 1 exit status
gnumake[2]: *** [../data/glest_game/glest_editor] Error 1
gnumake[1]: *** [source/glest_map_editor/CMakeFiles/glest_editor.dir/all] Error 2
gnumake: *** [all] Error 2

The error occurred on compiling the glest_editor, so i was hoping that glest.bin was build successfully. But:

Code: [Select]
./glest.bin
v3.4.0-dev-GNUC: 40201-Jan 30 2011 01:17:00, SVN: [Rev: 1647]
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
******************************************************
    #2 An error occurred and MegaGlest will close.
Error msg = [Could not open file [data/core/menu/textures/line_horizontal.tga]
Stack Trace:
1   glest.bin                           0x000d5130 _ZN5Glest4Game9glestMainEiPPc + 15056 address [0xd5130]
2   glest.bin                           0x000dd351 -[SDLMain applicationDidFinishLaunching:] + 65 address [0xdd351]
3   Foundation                          0x91eac4df _nsnote_callback + 176 address [0x91eac4df]
4   CoreFoundation                      0x9634f793 __CFXNotificationPost + 947 address [0x9634f793]
5   CoreFoundation                      0x9634f19a _CFXNotificationPostNotification + 186 address [0x9634f19a]
6   Foundation                          0x91ea1384 -[NSNotificationCenter postNotificationName:object:userInfo:] + 128 address [0x91ea1384]
7   Foundation                          0x91eae789 -[NSNotificationCenter postNotificationName:object:] + 56 address [0x91eae789]
8   AppKit                              0x9591c422 -[NSApplication _postDidFinishNotification] + 125 address [0x9591c422]
9   AppKit                              0x9591c332 -[NSApplication _sendFinishLaunchingNotification] + 74 address [0x9591c332]
10  AppKit                              0x95a734ed -[NSApplication:NSAppleEventHandling) _handleAEOpen:] () address [0x95a734ed]
11  AppKit                              0x95a7310d -[NSApplication:NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] () address [0x95a7310d]
12  Foundation                          0x91ee17a4 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 511 address [0x91ee17a4]
13  Foundation                          0x91ee1568 _NSAppleEventManagerGenericHandler + 228 address [0x91ee1568]
14  AE                                  0x97ddff58 _Z20aeDispatchAppleEventPK6AEDescPS_mPh + 166 address [0x97ddff58]
]

Please report this bug to contact@megaglest.org
******************************************************
[2011-01-30 01:23:33] *ERROR* In [~/Downloads/MegaGlest-svn/megaglest/source/glest_game/main/main.cpp::handleRuntimeError Line: 268] [Could not open file [data/core/menu/textures/line_horizontal.tga]] gameInitialized = 0, program = 0x2058710
[2011-01-30 01:23:33] *ERROR* In [~/Downloads/MegaGlest-svn/megaglest/source/glest_game/main/main.cpp::handleRuntimeError Line: 357] [Could not open file [data/core/menu/textures/line_horizontal.tga]
Stack Trace:
1   glest.bin                           0x000d5130 _ZN5Glest4Game9glestMainEiPPc + 15056 address [0xd5130]
2   glest.bin                           0x000dd351 -[SDLMain applicationDidFinishLaunching:] + 65 address [0xdd351]
3   Foundation                          0x91eac4df _nsnote_callback + 176 address [0x91eac4df]
4   CoreFoundation                      0x9634f793 __CFXNotificationPost + 947 address [0x9634f793]
5   CoreFoundation                      0x9634f19a _CFXNotificationPostNotification + 186 address [0x9634f19a]
6   Foundation                          0x91ea1384 -[NSNotificationCenter postNotificationName:object:userInfo:] + 128 address [0x91ea1384]
7   Foundation                          0x91eae789 -[NSNotificationCenter postNotificationName:object:] + 56 address [0x91eae789]
8   AppKit                              0x9591c422 -[NSApplication _postDidFinishNotification] + 125 address [0x9591c422]
9   AppKit                              0x9591c332 -[NSApplication _sendFinishLaunchingNotification] + 74 address [0x9591c332]
10  AppKit                              0x95a734ed -[NSApplication:NSAppleEventHandling) _handleAEOpen:] () address [0x95a734ed]
11  AppKit                              0x95a7310d -[NSApplication:NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] () address [0x95a7310d]
12  Foundation                          0x91ee17a4 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 511 address [0x91ee17a4]
13  Foundation                          0x91ee1568 _NSAppleEventManagerGenericHandler + 228 address [0x91ee1568]
14  AE                                  0x97ddff58 _Z20aeDispatchAppleEventPK6AEDescPS_mPh + 166 address [0x97ddff58]
]

Current directory is: megaglest/data/glest_game

The file which could not be loaded is there:

Code: [Select]
ls -lahrt data/core/menu/textures/line_horizontal.tga
-rw-r--r--  1 user  staff   3,8K  9 Jan 23:36 data/core/menu/textures/line_horizontal.tga

I guess the crash of MG is related to one of used the Libraries, but i'm not sure.

Next steps i could do in this:
- try to compile the whole stuff using Xcode
- reinstall MacOSX (this woun't happen in the near time) and start from scratch (i've the feeling, that i broke some of the Apple Frameworks installed by default)
« Last Edit: 30 January 2011, 00:50:27 by m0ellemeister »

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #9 on: 30 January 2011, 02:32:26 »
run the --verbose on commandline AND turn on the following debugging flags in glestuser.ini:

Code: [Select]
DebugMode=true
DebugNetwork=true
DebugSound=true

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #10 on: 30 January 2011, 03:01:46 »
That's probably not of much use, but it probably doesn't hurt either... People have previously run into this error message about line_horizontal.tga. However, in their case it was because they either did not install the data updates (from 3.3.7.2 to 3.4.0 beta2), unpacked them to the wrong directory (or to a subdirectory of the data directory, creating a data/data/... structure), or unpacked them with incorrect permissions.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Compiling MegaGlest from trunk does not work for Mac OS X (10.6.5)
« Reply #11 on: 30 January 2011, 04:19:45 »
It should look for this file in the same folder as other menu textures (example from the source code in order):

/menu/textures/back.tga
/misc_textures/fire_particle.tga
/misc_textures/snow_particle.tga
/menu/textures/custom_texture.tga
/menu/textures/logo.tga
/misc_textures/water_splash.tga
/menu/textures/button_small.tga
/menu/textures/button_big.tga

/menu/textures/line_horizontal.tga

.. etc. Concerning the root folder, it is configured as:

<some custom path>data/core

where <some custom path> may be directly specified on commandline, for example from mk/build (where I build using the cmake scripts) I run:

../mk/linux/glest.bin --ini-path=../mk/linux/ --data-path=../mk/linux/

if the custom path is not specified it is assumed the data/core/ etc is found in the current folder where you run MG from.

Thanks

 

anything