Bnes-libretro compile fails on Mac OS X

I can’t get bnes-libretro to compile on Mac OS X, here is the output when I try:

Build environment: Mac OS X 10.8.2 Xcode version: 4.5 (4G182) (latest version for Mac OS X 10.8)

make -j9
c++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/interface/interface.cpp -o obj/nes-interface.o
c++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/system/system.cpp -o obj/nes-system.o
c++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/scheduler/scheduler.cpp -o obj/nes-scheduler.o
c++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/input/input.cpp -o obj/nes-input.o
c++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/cartridge/cartridge.cpp -o obj/nes-cartridge.o
c++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/memory/memory.cpp -o obj/nes-memory.o
c++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/cpu/cpu.cpp -o obj/nes-cpu.o
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
c++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/apu/apu.cpp -o obj/nes-apu.o
c++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/ppu/ppu.cpp -o obj/nes-ppu.o
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from nes/scheduler/scheduler.cpp:1:
In file included from ./nes/nes.hpp:22:
./nall/array.hpp:6:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
         ^
In file included from nes/interface/interface.cpp:1:
In file included from ./nes/nes.hpp:22:
./nall/array.hpp:6:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
         ^
In file included from nes/system/system.cpp:1:
In file included from ./nes/nes.hpp:22:
./nall/array.hpp:6:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
         ^
In file included from nes/cartridge/cartridge.cpp:1:
In file included from ./nes/nes.hpp:22:
./nall/array.hpp:6:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
         ^
In file included from nes/cpu/cpu.cpp:1:
In file included from ./nes/nes.hpp:22:
./nall/array.hpp:6:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
         ^
In file included from nes/input/input.cpp:1:
In file included from ./nes/nes.hpp:22:
./nall/array.hpp:6:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
         ^
In file included from nes/memory/memory.cpp:1:
In file included from ./nes/nes.hpp:22:
./nall/array.hpp:6:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
         ^
In file included from nes/ppu/ppu.cpp:1:
In file included from ./nes/nes.hpp:22:
./nall/array.hpp:6:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
         ^
In file included from nes/apu/apu.cpp:1:
In file included from ./nes/nes.hpp:22:
./nall/array.hpp:6:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
         ^
1 error generated.
make: *** [obj/nes-scheduler.o] Error 1
make: *** Waiting for unfinished jobs....
1 error generated.
make: *** [obj/nes-interface.o] Error 1
1 error generated.
1 error generated.
make: *** [obj/nes-system.o] Error 1
make: *** [obj/nes-input.o] Error 1
1 error generated.
make: *** [obj/nes-memory.o] Error 1
1 error generated.
make: *** [obj/nes-ppu.o] Error 1
1 error generated.
make: *** [obj/nes-cpu.o] Error 1
1 error generated.
make: *** [obj/nes-apu.o] Error 1
1 error generated.
make: *** [obj/nes-cartridge.o] Error 1

Thanks!

byuu-related cores cannot yet be compiled on OS X

It can with some extra effort. Install and setup homebrew then use it to install the ‘gcc’ package.

On line 66 in the bnes Makefile delete the ‘-Wl,–no-undefined’ argument, finally build with ‘CC=gcc-4.7 CXX=g+±4.7 make’.

bsnes builds just fine with the default clang compiler.

You can also build them using MacPorts’ gcc packages, which is what I did for my libretro bundles.

One warning: it seems that libretro-bnes is unstable on OS X and can sometimes bring the whole system down. :open_mouth:

Ah, thanks for all the info, looks like I’ll just wait until it’s working/compiling properly and use the FCEU core in the interim.

Thanks!

It can with some extra effort. Install and setup homebrew then use it to install the ‘gcc’ package.

On line 66 in the bnes Makefile delete the ‘-Wl,–no-undefined’ argument, finally build with ‘CC=gcc-4.7 CXX=g+±4.7 make’.

bsnes builds just fine with the default clang compiler.[/quote]

Oh sure, with gcc you can compile on OS X but with clang there’s still some issues - bugs in the compiler and also issues with BSNES’ use of c++11 features. Some details here: http://board.byuu.org/viewtopic.php?f=7&t=3057