Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Sunday, 26 August 2012

The More I See

It is possible to use printf inside an OpenCL CPU kernel on OSX; however, remember to cast the string literal operand to (char const*) pointer to get it to compile.

Further, when running an OpenCL using program it is possible to force error logging to stdout (e.g. for .cl compile errors) via 

    CL_LOG_ERRORS=stdout program Args 

Wednesday, 22 August 2012

Disassemble

There is an offline compiler for OpenCL included in OSX 10.7, at /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/openclc 

This is pretty much a standard clang executable, and accepts common clang options. Sample arguments of interest, 

    -O3  -x cl -triple i386-applecl-darwin -S < loop.cl

Shows the assembly code for an OpenCL kernel.

    -x cl -triple i386-applecl-darwin -emit-llvm < loop.cl

Shows the LLVM textual-IR for a kernel.

The official documentation and example of this suggest the use of generating LLVM bit code offline, for 32 and 64 bit CPU and 32 bit GPU. More useful advice included in the OpenCL Mac programming guide.

Sunday, 14 August 2011

Hanger 18

Back to early 90's - XCOM aka UFO returns (via an open-source remake). Happily, nearly trivial to build on OSX.


Grab the source. Github has a nice OSX client, and the webpages have a wee button to spawn the OSX client and make the git clone process painless.


Get a packaging system for install Unix packages on OSX - the new hotness is Homebrew, in addition to fink or macports. Homebrew has the relevant dependencies, so it works (tm).


brew install yaml-cpp
brew install sdl
brew install sdl_gfx
brew install sdl_mixer


set the pkgconfig tools environment variable to find the installed stuff.


export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig


In the src directory of OpenXcom


make


And tis done. Copy the games data files to the relevant location, and all is well.