project-navigation
Personal tools

Author Topic: Problem with making a Mac universal binary  (Read 13225 times)

Offline sandrock

  • Cannon Fodder
  • **
  • Posts: 7
    • View Profile
Problem with making a Mac universal binary
« on: September 03, 2009, 07:31:52 am »
Hey folks - new to the forums, been lurking a bit.
After playing with the stable 2.2.1 release for a while, I thought I'd try my hand at SVN-ing and compiling the 2.3 development version.
So, I followed the directions here:http://ufoai.ninex.info/wiki/index.php/Compile_for_Mac
Using Macports. Oh, and I'm on a Macbook, Intel Core 2 Duo 2.16 GHz

Trouble is, after I've gone through make/make lang/make maps/make pk3 steps, and try the make bundle TARGET_CPU=universal command, i get this message in Terminal:
cp: ../../../../radiant/uforadiant: No such file or directory
make: *** [copybinaries] Error 1


it does make a UFOAI.app file, but when I click on the app, it gives me this dialogue box:
You can't open the application "UFOAI" because it is not supported on this architecture

I'm a bit new to all this compiling and whatnot (though i'm eager to learn) - can anyone point me in the right direction here?
How do I tell what architecture my system uses?

I'd really love to be able to compile the newest versions, make dmgs, and upload them for you all, since it only takes me a few hours to do the whole process, and it seems there's just a couple others on here who have Macs fast enough and with enough space to do that.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problem with making a Mac universal binary
« Reply #1 on: September 03, 2009, 07:38:22 am »
running

./configure --enable-universal && make && make macinstaller

should be all you need

Offline sandrock

  • Cannon Fodder
  • **
  • Posts: 7
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #2 on: September 03, 2009, 08:53:53 am »
Mattn, thank you for the quick response ;-)

i ran the command string you posted, and this is what I got back (well, the end of it):

cd src/ports/macosx/installer; make TARGET_CPU=universal
cp: ../../../../radiant/uforadiant: No such file or directory
make[1]: *** [copybinaries] Error 1
make: *** [macinstaller] Error 2


Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problem with making a Mac universal binary
« Reply #3 on: September 03, 2009, 09:00:15 am »
ups - also type

    make uforadiant

please

Offline sandrock

  • Cannon Fodder
  • **
  • Posts: 7
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #4 on: September 03, 2009, 09:59:19 am »
ups - also type

    make uforadiant

please

I did type "make uforadiant" and then tried "make macinstaller" again, but received the same error message as before.
Looking through the log of the "make uforadiant" action, it looks like i'm getting quite a few errors, though in all honesty i don't know code at all so they could be nothing.
Code: [Select]
[sandrock-meets-pascal:~/ufoai/trunk] sandrock% make uforadiant
 * [RAD] src/tools/radiant/plugins/model/plugin.cpp
In file included from src/tools/radiant/libs/debugging/debugging.h:30,
                 from src/tools/radiant/include/modulesystem.h:31,
                 from src/tools/radiant/include/iscenegraph.h:242,
                 from src/tools/radiant/plugins/model/plugin.cpp:30:
src/tools/radiant/libs/stream/textstream.h:36:18: error: glib.h: No such file or directory
In file included from src/tools/radiant/libs/debugging/debugging.h:30,
                 from src/tools/radiant/include/modulesystem.h:31,
                 from src/tools/radiant/include/iscenegraph.h:242,
                 from src/tools/radiant/plugins/model/plugin.cpp:30:
src/tools/radiant/libs/stream/textstream.h:36:18: error: glib.h: No such file or directory
src/tools/radiant/libs/stream/textstream.h: In function ‘TextOutputStreamType& ostream_write(TextOutputStreamType&, double)’:
src/tools/radiant/libs/stream/textstream.h:131: error: there are no arguments to ‘g_snprintf’ that depend on a template parameter, so a declaration of ‘g_snprintf’ must be available
src/tools/radiant/libs/stream/textstream.h:131: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
src/tools/radiant/libs/stream/textstream.h: In function ‘TextOutputStreamType& ostream_write(TextOutputStreamType&, const HexChar&)’:
src/tools/radiant/libs/stream/textstream.h:199: error: there are no arguments to ‘g_snprintf’ that depend on a template parameter, so a declaration of ‘g_snprintf’ must be available
src/tools/radiant/libs/stream/textstream.h: In function ‘TextOutputStreamType& ostream_write(TextOutputStreamType&, const FloatFormat&)’:
src/tools/radiant/libs/stream/textstream.h:218: error: there are no arguments to ‘g_snprintf’ that depend on a template parameter, so a declaration of ‘g_snprintf’ must be available
src/tools/radiant/libs/stream/textstream.h: In function ‘TextOutputStreamType& ostream_write(TextOutputStreamType&, const Decimal&)’:
src/tools/radiant/libs/stream/textstream.h:237: error: there are no arguments to ‘g_snprintf’ that depend on a template parameter, so a declaration of ‘g_snprintf’ must be available
src/tools/radiant/libs/stream/textstream.h: In function ‘TextOutputStreamType& ostream_write(TextOutputStreamType&, double)’:
src/tools/radiant/libs/stream/textstream.h:131: error: there are no arguments to ‘g_snprintf’ that depend on a template parameter, so a declaration of ‘g_snprintf’ must be available
src/tools/radiant/libs/stream/textstream.h:131: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
src/tools/radiant/libs/stream/textstream.h: In function ‘TextOutputStreamType& ostream_write(TextOutputStreamType&, const HexChar&)’:
src/tools/radiant/libs/stream/textstream.h:199: error: there are no arguments to ‘g_snprintf’ that depend on a template parameter, so a declaration of ‘g_snprintf’ must be available
src/tools/radiant/libs/stream/textstream.h: In function ‘TextOutputStreamType& ostream_write(TextOutputStreamType&, const FloatFormat&)’:
src/tools/radiant/libs/stream/textstream.h:218: error: there are no arguments to ‘g_snprintf’ that depend on a template parameter, so a declaration of ‘g_snprintf’ must be available
src/tools/radiant/libs/stream/textstream.h: In function ‘TextOutputStreamType& ostream_write(TextOutputStreamType&, const Decimal&)’:
src/tools/radiant/libs/stream/textstream.h:237: error: there are no arguments to ‘g_snprintf’ that depend on a template parameter, so a declaration of ‘g_snprintf’ must be available
src/tools/radiant/libs/string/string.h: In function ‘int string_compare_nocase(const char*, const char*)’:
src/tools/radiant/libs/string/string.h:88: error: ‘g_ascii_strcasecmp’ was not declared in this scope
src/tools/radiant/libs/string/string.h: In function ‘int string_compare_nocase_n(const char*, const char*, size_t)’:
src/tools/radiant/libs/string/string.h:97: error: ‘g_ascii_strncasecmp’ was not declared in this scope
src/tools/radiant/libs/string/string.h: In function ‘int string_compare_nocase(const char*, const char*)’:
src/tools/radiant/libs/string/string.h:88: error: ‘g_ascii_strcasecmp’ was not declared in this scope
src/tools/radiant/libs/string/string.h: In function ‘int string_compare_nocase_n(const char*, const char*, size_t)’:
src/tools/radiant/libs/string/string.h:97: error: ‘g_ascii_strncasecmp’ was not declared in this scope
src/tools/radiant/plugins/model/plugin.cpp: In function ‘void PicoPrintFunc(int, const char*)’:
src/tools/radiant/plugins/model/plugin.cpp:60: error: ‘g_message’ was not declared in this scope
src/tools/radiant/plugins/model/plugin.cpp:68: error: ‘g_warning’ was not declared in this scope
src/tools/radiant/plugins/model/plugin.cpp:76: error: ‘g_critical’ was not declared in this scope
src/tools/radiant/plugins/model/plugin.cpp: In function ‘void PicoPrintFunc(int, const char*)’:
src/tools/radiant/plugins/model/plugin.cpp:60: error: ‘g_message’ was not declared in this scope
src/tools/radiant/plugins/model/plugin.cpp:68: error: ‘g_warning’ was not declared in this scope
src/tools/radiant/plugins/model/plugin.cpp:76: error: ‘g_critical’ was not declared in this scope
lipo: can't figure out the architecture type of: /var/folders/I+/I+wF2o4r2RaxDU+1YuUSk++++TI/-Tmp-//ccUCOMBK.out
make: *** [debug-darwin-universal/tools/radiant/plugins_cpp/tools/radiant/plugins/model/plugin.o] Error 1

Offline Dorzak

  • Rookie
  • ***
  • Posts: 45
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #5 on: September 03, 2009, 07:08:35 pm »
ups - also type

    make uforadiant

please

Same errors I was getting, and yes according to macports the packages you mentioned not being installed are installed.


Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problem with making a Mac universal binary
« Reply #6 on: September 03, 2009, 08:25:54 pm »
i'm sorry - it works on my mac and not an experienced mac user - just bought it a few days ago. someone with more experience would have to take a look at this

Offline sandrock

  • Cannon Fodder
  • **
  • Posts: 7
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #7 on: September 03, 2009, 11:40:03 pm »
No worries, Mattn - i can still run the game from the Terminal command line, after all.
I certainly appreciate your willingness to help me figure it out ;-)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #8 on: September 03, 2009, 11:50:22 pm »
Ick.

Code: [Select]
Kleiman-ibook:~ michael$ port outdated
No installed ports are outdated.
Kleiman-ibook:~ michael$ sudo port install  gtkglext +universal  gtk2 +universal openal +universal
Password:
--->  Computing dependencies for gtkglext
--->  Building cairo
--->  Building cairo for architecture ppc
--->  Building cairo for architecture i386
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_cairo/work/cairo-1.8.8-i386" && /usr/bin/make -j1 all " returned error 2
Command output:       __get_pattern_ft_options in cairo-ft-font.o
      __cairo_ft_unscaled_font_create_for_pattern in cairo-ft-font.o
  "_FcPatternAddInteger", referenced from:
      __cairo_ft_font_options_substitute in cairo-ft-font.o
      __cairo_ft_font_options_substitute in cairo-ft-font.o
      __cairo_ft_font_options_substitute in cairo-ft-font.o
      __cairo_ft_scaled_font_create_toy in cairo-ft-font.o
      __cairo_ft_scaled_font_create_toy in cairo-ft-font.o
...

XCode version is 3.1.2.

Any clues? Anyone?

Can we go back to disabling radiant?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #9 on: September 04, 2009, 03:12:19 am »
I have the answer. It is a flaw in Macports

If you need port X for a program locally, it will be installed, usually with the default options.
If you then need it later with a different option, like "+universal", it will not be remade.

I've got a lot of ports to remake.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #10 on: September 05, 2009, 06:43:09 am »
OpenAl is not available in universal binary in Mac Ports.

If either Ufo or Radiant requires OpenAl, then it cannot be compiled as universal.

I've sent a message to the macports mailing list, but there is no current maintainer for this library.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problem with making a Mac universal binary
« Reply #11 on: September 05, 2009, 07:32:59 am »
the glib problem seems to only occur if you build an universal, too

the strange thing is that if you skip the --enable-universal in your configure call the pkg-config will deliver the correct CFLAGS (that also contains the include option for the include/glib2.0/ directory) - but if you enable universal only the LDFLAGS are set correctly, but the CFLAGS are not.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #12 on: September 05, 2009, 11:29:12 pm »
OpenAl is included in Mac OS 10.4 and higher:

Kleiman-ibook:Development michael$ ls /System/Library/Frameworks/OpenAL.framework/
total 16
4 CodeResources@   4 OpenAL@      0 Versions/
4 Headers@      4 Resources@

I'm going to punt on this issue; 10.2 and 10.3 people will have to wait.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #13 on: September 06, 2009, 02:19:25 am »
And it's a non-issue: Gtk2 requires 10.4.

Worse:
Quote from: Gtk mac home page@http://sourceforge.net/apps/trac/gtk-osx/wiki/GtkQuartz
Gtk+-2 is implemented on Macintosh OSX in gtk+-2/gdk/quartz and gtk+-2/gtk. The current list of files are provided below. Graphics and text rendering are provided by Cairo Graphics and Pango, respectively. As of this writing, the Quartz implementations of both Cairo and Pango appear to be actively maintained.

Sadly, the same cannot be said of Gtk+. The primary developer of both the contents of this project and of the Quartz backend for Gtk+, Richard Hult, has withdrawn from further work on any aspect of Gtk+ on OSX. When we pointedly asked on the gtk-devel mailing list if there was anyone with commit permission who was willing to commit to keeping the Quartz backend current, we were met with silence.

Meanwhile, I'm still having trouble getting this (gtk) to compile universal. Just grabbing a disk image and having it installed is almost looking favorable :-).

The error I'm getting is:
Code: [Select]
Making all in gtk
/usr/bin/make  gtk-update-icon-cache
make[3]: `gtk-update-icon-cache' is up to date.
GDK_PIXBUF_MODULE_FILE=../gdk-pixbuf/gdk-pixbuf.loaders ./gtk-update-icon-cache --force --ignore-theme-index \
   --source builtin_icons stock-icons > gtkbuiltincache.h.tmp &&        \
mv gtkbuiltincache.h.tmp gtkbuiltincache.h
gtk-update-icon-cache: The generated cache was invalid.
make[2]: *** [gtkbuiltincache.h] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with making a Mac universal binary
« Reply #14 on: September 06, 2009, 11:12:50 pm »
(Moved from the mac binary thread)
I managed to erase all macport installations needed to build gtk2, and just installed gtk2.

In the process, I ran into a bug in macport 1.8.0 (newest); it seems to build build tools before it builds libraries. If a build-tool needs a library, that library is only built for single machine, not for +universal.

So it looks like a true "from scratch" installation will take two separate build commands; one to make sure that libraries needed will be installed +universal, and a second to build the final programs with their build tools.

===

... and that is now questionable, as it seems I missed a few after all.

Still having trouble making a universal. This time with a better clean, and trouble on a different package. (Naturally, on 10.6 it compiles universal for i386 and x86_64 just fine.)