From 6da999672b8dc33e3d5a58c46bfb7ef2e4329f2e Mon Sep 17 00:00:00 2001 From: Amr Aboelela Date: Fri, 5 Aug 2016 10:23:50 -0700 Subject: [PATCH 1/5] README - Added Toolchain section --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index d65a13cbd..6bfa69b14 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,25 @@ Our first tasks for this project are: 0. Incrementally add functionality back in. 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. + +## Toolchain +To add libdispatch to the toolchain in Linux, you need to add libdispatch and install-libdispatch lines to ./swift/utils/build-presets.ini under `[preset: buildbot_linux]` section. Also to make the build run faster, you can comment the test lines. After those updates the section would be as following: + +``` +[preset: buildbot_linux] +mixin-preset=mixin_linux_installation +build-subdir=buildbot_linux +lldb +release +#test +#validation-test +#long-test +libdispatch +foundation +lit-args=-v +dash-dash + +install-libdispatch +install-foundation +reconfigure +``` From 131e93d019ba3153941398d86f9a5f2b5a27c9c2 Mon Sep 17 00:00:00 2001 From: Amr Aboelela Date: Fri, 5 Aug 2016 11:08:36 -0700 Subject: [PATCH 2/5] After that run: build-toolchain --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6bfa69b14..b4c608ed3 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,7 @@ install-libdispatch install-foundation reconfigure ``` + +After that run: + + utils/build-toolchain local.swift \ No newline at end of file From 5cc8c9108c97f9f872840743a92fb6ef5bc0bdbc Mon Sep 17 00:00:00 2001 From: Amr Aboelela Date: Tue, 9 Aug 2016 11:15:06 -0700 Subject: [PATCH 3/5] Moved changes to INSTALL.md --- INSTALL => INSTALL.md | 60 ++++++++++++++++++++++++++++++++++--------- README.md | 36 +++++--------------------- 2 files changed, 55 insertions(+), 41 deletions(-) rename INSTALL => INSTALL.md (83%) diff --git a/INSTALL b/INSTALL.md similarity index 83% rename from INSTALL rename to INSTALL.md index 8a09c3a44..1f1c60d2a 100644 --- a/INSTALL +++ b/INSTALL.md @@ -1,4 +1,4 @@ -Grand Central Dispatch (GCD) +## 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 @@ -8,7 +8,7 @@ Leopard and FreeBSD 9-CURRENT, are required to use libdispatch. Linux is supported, but requires specific packages to be installed (see Linux section at the end of the file). Other systems are currently unsupported. -I. Configuring and installing libdispatch (general comments) +### I. Configuring and installing libdispatch (general comments) GCD is built using autoconf, automake, and libtool, and has a number of compile-time configuration options that should be reviewed before starting. @@ -93,7 +93,7 @@ OS X as a replacement for /usr/lib/system/libdispatch.dylib: 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 +#### Typical configuration commands The following command lines create the configuration required to build libdispatch for /usr/lib/system on OS X El Capitan: @@ -112,7 +112,7 @@ libdispatch for /usr/lib/system on OS X El Capitan: --with-apple-objc4-source=/path/to/10.11.0/objc4-680 make check -III. Building and installing for FreeBSD +### III. Building and installing for FreeBSD Typical configuration line for FreeBSD 8.x and 9.x to build libdispatch with clang and blocks support: @@ -121,33 +121,69 @@ clang and blocks support: ./configure CC=clang --with-blocks-runtime=/usr/local/lib make check -IV. Building and installing for Linux +### IV. Building and installing for Linux Note that libdispatch development and testing is done only on Ubuntu; currently supported versions are 14.04, 15.10 and 16.04. -(1) The first thing to do is install required packages: +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 + 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 + 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. On older Ubuntu releases, you may need to install binutils-gold to get the gold linker. -(2) Initialize git submodules. +2. Initialize git submodules. We are using git submodules to incorporate specific revisions of the upstream pthread_workqueue and libkqueue projects into the build. + + ``` git submodule init git submodule update + ``` + +3. Build (as in the general instructions above) -(3) Build (as in the general instructions above) - sh autogen.sh - ./configure - make + ``` + sh autogen.sh + ./configure + make make install + ``` + +## Toolchain +To add libdispatch to the toolchain in Linux, you need to add libdispatch and install-libdispatch lines to ./swift/utils/build-presets.ini under `[preset: buildbot_linux]` section. After those updates the section would be as following: + +``` +[preset: buildbot_linux] +mixin-preset=mixin_linux_installation +build-subdir=buildbot_linux +lldb +release +test +validation-test +long-test +libdispatch +foundation +lit-args=-v +dash-dash + +install-libdispatch +install-foundation +reconfigure +``` + +After that run: + + utils/build-toolchain local.swift + \ No newline at end of file diff --git a/README.md b/README.md index b4c608ed3..0a5e3d93a 100644 --- a/README.md +++ b/README.md @@ -18,35 +18,13 @@ libdispatch on Darwin is a combination of logic in the `xnu` kernel alongside th Our first tasks for this project are: -0. 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). -0. 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. -0. Adopt libdispatch in other Core Libraries projects, especially Foundation. This will validate our work and get immediate coverage on basic functionality. -0. Incrementally add functionality back in. +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. 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. -## Toolchain -To add libdispatch to the toolchain in Linux, you need to add libdispatch and install-libdispatch lines to ./swift/utils/build-presets.ini under `[preset: buildbot_linux]` section. Also to make the build run faster, you can comment the test lines. After those updates the section would be as following: - -``` -[preset: buildbot_linux] -mixin-preset=mixin_linux_installation -build-subdir=buildbot_linux -lldb -release -#test -#validation-test -#long-test -libdispatch -foundation -lit-args=-v -dash-dash - -install-libdispatch -install-foundation -reconfigure -``` - -After that run: - - utils/build-toolchain local.swift \ No newline at end of file +## See also + +[INSTALL](INSTALL.md) From 39112fd4ac934d7a6f7eb96c9961ae864bdb5e0d Mon Sep 17 00:00:00 2001 From: Amr Aboelela Date: Tue, 9 Aug 2016 11:32:38 -0700 Subject: [PATCH 4/5] ### II. --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 1f1c60d2a..8cc538ae0 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -41,7 +41,7 @@ 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). -II. Building and installing on OS X +### II. Building and installing on OS X The following configure options may be of general interest: From 4cb5a7ea8fb1077d47a49bbf0b6db46de84739a0 Mon Sep 17 00:00:00 2001 From: Amr Aboelela Date: Fri, 5 Aug 2016 10:23:50 -0700 Subject: [PATCH 5/5] INSTALL.md - Added Toolchain section --- INSTALL => INSTALL.md | 62 ++++++++++++++++++++++++++++++++++--------- README.md | 12 ++++++--- 2 files changed, 57 insertions(+), 17 deletions(-) rename INSTALL => INSTALL.md (82%) diff --git a/INSTALL b/INSTALL.md similarity index 82% rename from INSTALL rename to INSTALL.md index 8a09c3a44..8cc538ae0 100644 --- a/INSTALL +++ b/INSTALL.md @@ -1,4 +1,4 @@ -Grand Central Dispatch (GCD) +## 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 @@ -8,7 +8,7 @@ Leopard and FreeBSD 9-CURRENT, are required to use libdispatch. Linux is supported, but requires specific packages to be installed (see Linux section at the end of the file). Other systems are currently unsupported. -I. Configuring and installing libdispatch (general comments) +### I. Configuring and installing libdispatch (general comments) GCD is built using autoconf, automake, and libtool, and has a number of compile-time configuration options that should be reviewed before starting. @@ -41,7 +41,7 @@ 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). -II. Building and installing on OS X +### II. Building and installing on OS X The following configure options may be of general interest: @@ -93,7 +93,7 @@ OS X as a replacement for /usr/lib/system/libdispatch.dylib: 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 +#### Typical configuration commands The following command lines create the configuration required to build libdispatch for /usr/lib/system on OS X El Capitan: @@ -112,7 +112,7 @@ libdispatch for /usr/lib/system on OS X El Capitan: --with-apple-objc4-source=/path/to/10.11.0/objc4-680 make check -III. Building and installing for FreeBSD +### III. Building and installing for FreeBSD Typical configuration line for FreeBSD 8.x and 9.x to build libdispatch with clang and blocks support: @@ -121,33 +121,69 @@ clang and blocks support: ./configure CC=clang --with-blocks-runtime=/usr/local/lib make check -IV. Building and installing for Linux +### IV. Building and installing for Linux Note that libdispatch development and testing is done only on Ubuntu; currently supported versions are 14.04, 15.10 and 16.04. -(1) The first thing to do is install required packages: +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 + 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 + 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. On older Ubuntu releases, you may need to install binutils-gold to get the gold linker. -(2) Initialize git submodules. +2. Initialize git submodules. We are using git submodules to incorporate specific revisions of the upstream pthread_workqueue and libkqueue projects into the build. + + ``` git submodule init git submodule update + ``` + +3. Build (as in the general instructions above) -(3) Build (as in the general instructions above) - sh autogen.sh - ./configure - make + ``` + sh autogen.sh + ./configure + make make install + ``` + +## Toolchain +To add libdispatch to the toolchain in Linux, you need to add libdispatch and install-libdispatch lines to ./swift/utils/build-presets.ini under `[preset: buildbot_linux]` section. After those updates the section would be as following: + +``` +[preset: buildbot_linux] +mixin-preset=mixin_linux_installation +build-subdir=buildbot_linux +lldb +release +test +validation-test +long-test +libdispatch +foundation +lit-args=-v +dash-dash + +install-libdispatch +install-foundation +reconfigure +``` + +After that run: + + utils/build-toolchain local.swift + \ No newline at end of file diff --git a/README.md b/README.md index d65a13cbd..0a5e3d93a 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,13 @@ libdispatch on Darwin is a combination of logic in the `xnu` kernel alongside th Our first tasks for this project are: -0. 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). -0. 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. -0. Adopt libdispatch in other Core Libraries projects, especially Foundation. This will validate our work and get immediate coverage on basic functionality. -0. Incrementally add functionality back in. +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. 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. + +## See also + +[INSTALL](INSTALL.md)