Grand Central Dispatch (GCD) GCD is a concurrent programming framework first shipped with Mac OS X Snow Leopard. This package is an open source bundling of libdispatch, the core user space library implementing GCD. At the time of writing, support for the BSD kqueue API, and specifically extensions introduced in Mac OS X Snow Leopard and FreeBSD 9-CURRENT, are required to use libdispatch. Support for Linux is a work in progress (see Linux notes below). Other systems are currently unsupported. Configuring and installing libdispatch GCD is built using autoconf, automake, and libtool, and has a number of compile-time configuration options that should be reviewed before starting. An uncustomized install requires: sh autogen.sh ./configure make make install The following configure options may be of general interest: --with-apple-libpthread-source Specify the path to Apple's libpthread package, so that appropriate headers can be found and used. --with-apple-libplatform-source Specify the path to Apple's libplatform package, so that appropriate headers can be found and used. --with-apple-libclosure-source Specify the path to Apple's Libclosure package, so that appropriate headers can be found and used. --with-apple-xnu-source Specify the path to Apple's XNU package, so that appropriate headers can be found and used. --with-blocks-runtime On systems where -fblocks is supported, specify an additional library path in which libBlocksRuntime can be found. This is not required on OS X, where the Blocks runtime is included in libSystem, but is required on FreeBSD. The following options are likely to only be useful when building libdispatch on OS X as a replacement for /usr/lib/system/libdispatch.dylib: --with-apple-objc4-source Specify the path to Apple's objc4 package, so that appropriate headers can be found and used. --disable-libdispatch-init-constructor Do not tag libdispatch's init routine as __constructor, in which case it must be run manually before libdispatch routines can be called. This is the default when building on OS X. For /usr/lib/system/libdispatch.dylib the init routine is called automatically during process start. --enable-apple-tsd-optimizations Use a non-portable allocation scheme for pthread per-thread data (TSD) keys when building libdispatch for /usr/lib/system on OS X. This should not be used on other OS's, or on OS X when building a stand-alone library. Typical configuration commands The following command lines create the configuration required to build libdispatch for /usr/lib/system on OS X El Capitan: clangpath=$(dirname `xcrun --find clang`) sudo mkdir -p "$clangpath/../local/lib/clang/enable_objc_gc" LIBTOOLIZE=glibtoolize sh autogen.sh cflags='-arch x86_64 -arch i386 -g -Os' ./configure CFLAGS="$cflags" OBJCFLAGS="$cflags" CXXFLAGS="$cflags" \ --prefix=/usr --libdir=/usr/lib/system --disable-static \ --enable-apple-tsd-optimizations \ --with-apple-libpthread-source=/path/to/10.11.0/libpthread-137.1.1 \ --with-apple-libplatform-source=/path/to/10.11.0/libplatform-73.1.1 \ --with-apple-libclosure-source=/path/to/10.11.0/libclosure-65 \ --with-apple-xnu-source=/path/to/10.11.0/xnu-3247.1.106 \ --with-apple-objc4-source=/path/to/10.11.0/objc4-680 make check Typical configuration line for FreeBSD 8.x and 9.x to build libdispatch with clang and blocks support: sh autogen.sh ./configure CC=clang --with-blocks-runtime=/usr/local/lib make check Instructions for building on Linux. Initial focus is on ubuntu 15.04. Prepare your system 1. Install compiler, autotools sudo apt-get install clang sudo apt-get install autoconf libtool pkg-config 2. Install dtrace (to generate provider.h) sudo apt-get install systemtap-sdt-dev 3. Install libdispatch pre-reqs sudo apt-get install libblocksruntime-dev libkqueue-dev libbsd-dev Initialize git submodules: We are using git submodules to incorporate a specific revision of the upstream pthread_workqueue library into the build. git submodule init git submodule update Build: sh autogen.sh ./configure make Note: the build currently fails building tests, but libdispatch.so should build successfully.