Add compile options for OS X

Compilation checked in both OS X and Linux.