diff --git a/INSTALL.md b/INSTALL.md index 0096119d8..e30551887 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -41,7 +41,8 @@ Note that once libdispatch is installed into a Swift toolchain, that toolchain cannot be used to compile libdispatch again (you must 'make uninstall' libdispatch from the toolchain before using it to rebuild libdispatch). -To create the toolchain with libdispatch Using build-toolchain in Linux: +You can also use the build-toolchain script to create a toolchain +that includes libdispatch on Linux: 1. Add libdispatch and install-libdispatch lines to ./swift/utils/build-presets.ini under `[preset: buildbot_linux]` section, as following: @@ -151,15 +152,8 @@ on Ubuntu; currently supported versions are 14.04, 15.10 and 16.04. 1. The first thing to do is install required packages: - 1a. Install build tools and clang compiler. - `sudo apt-get install autoconf libtool pkg-config clang` + `sudo apt-get install autoconf libtool pkg-config clang systemtap-sdt-dev libbsd-dev` - 1b. Install dtrace (to generate provider.h) - `sudo apt-get install systemtap-sdt-dev` - - 1c. Install additional libdispatch dependencies - `sudo apt-get install libblocksruntime-dev libkqueue-dev libbsd-dev` - Note: compiling libdispatch requires clang 3.8 or better and the gold linker. If the default clang on your Ubuntu version is too old, see http://apt.llvm.org/ to install a newer version. diff --git a/README.md b/README.md index 0a5e3d93a..196c03230 100644 --- a/README.md +++ b/README.md @@ -4,27 +4,16 @@ Grand Central Dispatch (GCD or libdispatch) provides comprehensive support for c libdispatch is currently available on all Darwin platforms. This project aims to make a modern version of libdispatch available on all other Swift platforms. To do this, we will implement as much of the portable subset of the API as possible, using the existing open source C implementation. -## Project Goals - -We are currently very early in the development of this project. Our starting point is simply a mirror of the open source drop that corresponds with OS X El Capitan (10.11). Therefore, our earliest goals are: - -0. Build and test the C source code as a dynamic library on the current Swift Linux targets (Ubuntu 14.04 and Ubuntu 15.10). -0. Add a `module.modulemap` and make the libdispatch API importable into Swift. -0. After the previous two steps are done, consider possible improvements to the interface of the libdispatch API in Swift. - -## Building a C Library +libdispatch on Darwin is a combination of logic in the `xnu` kernel alongside the user-space Library. The kernel has the most information available to balance workload across the entire system. As a first step, however, we believe it is useful to bring up the basic functionality of the library using user-space pthread primitives on Linux. Eventually, a Linux kernel module could be developed to support more informed thread scheduling. -libdispatch on Darwin is a combination of logic in the `xnu` kernel alongside the user-space Library. The kernel has the most information available to balance workload across the entire system. As a first step, however, we believe it is useful to bring up the basic functionality of the library using user-space pthread primitives on Linux. - -Our first tasks for this project are: - -1. Adapt the current autotools build system to work on Linux, or develop a new makefile or other build script for the project on Linux. The current version of the build system has only been tested on Darwin, though previous versions have been made to work on FreeBSD and Linux (see [INSTALL](INSTALL.md)). -2. Omit as much of the extra functionality of the library as possible, to get a core version of the project building. Much of the OS X-specific functionality can be elided completely on Linux. -3. Adopt libdispatch in other Core Libraries projects, especially Foundation. This will validate our work and get immediate coverage on basic functionality. -4. Incrementally add functionality back in. +## Project Goals -Some C headers and sources (e.g. `Availability.h`, `Block.h`, and the libclosure `runtime.c`) are similar to ones embedded into the CoreFoundation part of [swift-corelibs-foundation](http://github.com/apple/swift-corelibs-foundation). We should figure out a mechanism to share these instead of duplicating them across projects. +We are currently early in the development of this project. We began with a mirror of the open source drop that corresponds with OS X El Capitan (10.11) and have ported it to x86_64 Ubuntu 14.04 and 15.10. The next steps are: +1. Complete the work to adopt libdispatch in other Core Libraries projects, especially Foundation. This will validate our work and get immediate test coverage on basic functionality of the Swift API. +2. Include libdispatch and libdispatch-enabled Core Libraries in the Swift CI environment and the pre-built Swift toolchains at Swift.org. +4. Develop a test suite for the Swift APIs of libdispatch. +4. Enhance libdispatch as needed to support Swift language evolution and the needs of the other Core Libraries projects. -## See also +## Build and Install -[INSTALL](INSTALL.md) +For detailed instructions on building and installing libdispatch, see [INSTALL.md](INSTALL.md)