Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are blocks and libdispatch available on linux?

I would love to try out grand central dispatch, but all I have to develop on is an Ubuntu workstation. Is libdispatch, and the blocks extension to c/obj-c etc... available on linux? If so, how do I get them?

like image 592
mummey Avatar asked Apr 12 '11 18:04

mummey


3 Answers

You may need to use the LLVM Clang (available on Ubuntu) compiler to get blocks at this time (I don't think this is available in gcc yet, but I haven't been keeping up with gcc, so I could be wrong.)

There are efforts underway to port libdispatch (home for the open source libdispatch) to Linux. Most of the effort seems to be on Debian so far, but some on other distributions, too. See these discussion threads:

  • linux + libdispatch + clang + blocks
  • libdispatch porting status update
  • Grand Central Dispatch available for Debian (archived link)
like image 167
Gary W. Longsine Avatar answered Nov 16 '22 00:11

Gary W. Longsine


I've done some work to get the OS X Mountain Lion version of libdispatch working on Linux; the result is up at Github: http://nickhutchinson.me/libdispatch/.

like image 34
Nick Hutchinson Avatar answered Nov 16 '22 00:11

Nick Hutchinson


Use clang-3.4.

  • sudo apt-get install libdispatch-dev
  • sudo apt-get install libblocks-runtime-dev
  • Compile with -fblocks
  • Link with -lBlocksRuntime -ldispatch
like image 22
sheffler Avatar answered Nov 16 '22 01:11

sheffler