Skip to content

Commit 54e670d

Browse files
committed
doc updated
1 parent 940059b commit 54e670d

File tree

4 files changed

+97
-46
lines changed

4 files changed

+97
-46
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88

99
/.gradle/
1010
/boost/down/1.87.0
11+
/boost/down/1_87_0/

README.md

+92-41
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ Build and/or simply download the Boost C++ Libraries for the Android platform, w
44
The [Boost C++ Libraries](http://www.boost.org/), are possibly *the* most popular and generally useful c++ libraries. It would be nice to be able to use them when developing (native c++ or hybrid java/c++ with Google's [Ndk](https://developer.android.com/ndk/)) apps and/or libraries for Android devices.
55
The Boost libraries are written to be cross platform, and are available in source code format. However, building the libraries for a given target platform like Android can be very difficult and time consuming. (In particular, building **arm64_v8a** shared libraries that an application can actually load). This project aims to lower the barrier by offering a simple customizable build script you can use to build Boost for Android (abstracting away all the details of the underlying custom boost build system, and target architecture differences), and even providing standard prebuilt binaries to get you started fast.
66

7-
Tested with **Boost 1.83.0** and **Google's Ndk 26b** (LTS).
7+
Tested with **Boost 1.87.0** and **Google's Ndk 27c** (LTS).
88

9-
You can build directly on a Linux or MacOS machine, or indirectly on any of Linux, Windows, MacOS via [docker](https://www.docker.com) (or of course virtual machines and wsl). _No matter what OS you use to build with, the resulting binaries can then be copied to any other, and used from then on as if you had built them there to start with (theyre cross compiled *for* android and have no memory of *where* they were built_).
9+
You can build directly on a Linux or MacOS machine, or indirectly on any of Linux, Windows, MacOS via [docker](https://www.docker.com) (or of course virtual machines and wsl). _No matter what OS you use to build with, the resulting binaries can then be copied to any other, and used from then on as if you had built them there to start with (they're cross compiled *for* android and have no memory of *where* they were built_).
1010

1111

1212
Creates binaries for multiple abis (**armeabi-v7a**, **arm64-v8a**, **x86**, **x86_64**).
1313

1414

15-
Tested on a development machine running **Ubuntu 20.04** and **MacOS 11.6.5**
16-
1715
## Prebuilt
1816
You can just download a current set of standard prebuilt binaries [here](https://github.com/dec1/Boost-for-Android/releases) if you don't need to customize the build, or don't have access to a unix-like development machine.
1917
<!--- [here](http://silverglint.com/boost-for-android/) --->
@@ -28,26 +26,24 @@ See [docker_readme](./docker/docker_readme.md) for instructions.
2826

2927
### Build directly on your Linux or MacOS machine
3028

31-
* For prerequisites see [Dockerflile](./docker/droid_base#L18) (even though the remaining instructions below don't use docker)
32-
* Download the [boost source](https://www.boost.org) and extract to a directory of the form *..../major.minor.patch*
33-
eg */home/declan/Documents/zone/mid/lib/boost/1.83.0*
34-
*__Note__:* After the extarction *..../boost/1.83.0* should then be the direct parent dir of "bootstrap.sh", "boost-build.jam" etc
29+
- Prerequisites
30+
- Linux: see [Dockerflile](./docker/droid_base#L18)
31+
- MacOS: XCode ( Command Line Tools))
32+
- NDK (eg in Android studio or downloaded separately)
33+
- Download the [boost source](https://www.boost.org) and [extract here](./boost/down/readme.md)
3534

3635

37-
```
38-
> ls /home/declan/Documents/zone/mid/lib/boost/1.83.0
39-
boost boost-build.jam boostcpp.jam boost.css boost.png ....
40-
```
4136

42-
* Clone this repo:
37+
- Clone this repo:
38+
- `git clone https://github.com/dec1/Boost-for-Android.git`
4339

44-
```
45-
> git clone https://github.com/dec1/Boost-for-Android.git ./boost_for_android
46-
```
40+
* Modify the paths (where the ndk is) and variables (which abis you want to build for) in _do.sh_ as you wish, and execute
41+
- `cd Boost-for-Android`
42+
- `./do.sh`
4743

44+
If the build succeeded, then the boost binaries should now be in **`./build/install`**
4845

49-
* Modify the paths (where the ndk is) and variables (which abis you want to build for) in *do.sh*, and execute it. If the build succeeds then the boost binaries should then be available in the dir *boost_for_android/build*
50-
Note: If you download the ndk directly do *not* extract it with [Ark](https://apps.kde.org/de/ark). It produces a corrupt extraction, that results in strange compiler errors. (use unzip instead)
46+
Warning: If you download the ndk directly do *not* extract it with [Ark](https://apps.kde.org/de/ark). It produces a corrupt extraction, that results in strange compiler errors. (use unzip instead)
5147
```
5248
> cd boost_for_android
5349
> ./do.sh
@@ -63,7 +59,7 @@ Note: If you download the ndk directly do *not* extract it with [Ark](https://ap
6359
Also included is a [test app](./example_app/) which can be opened by Android Studio. If you build and run this app it should show the date and time as calculated by boost *chrono* (indicating that you have built, linked to and called the boost library correctly), as well as the ndk version used to build the boost library.
6460
To use the test app make sure to adjust the values in the [local.properties](./example_app/local.properties) file.
6561

66-
*Note:* The test app uses [CMake for Android](https://developer.android.com/ndk/guides/cmake)
62+
*Note:* The test app uses [CMake for Android](https://developer.android.com/ndk/guides/cmake) and [Kotlin](https://developer.android.com/kotlin)
6763

6864

6965
## *Header-only* Boost Libraries
@@ -74,53 +70,108 @@ want to use these. To see which of the libraries do require building you can swi
7470
> ./bootstrap.sh --show-libraries
7571
```
7672

77-
which for example with boost 1.83.0 produces the output:
73+
which for example with boost 1.87.0 produces the output:
7874

7975
```
8076
The following Boost libraries have portions that require a separate build
8177
and installation step. Any library not listed here can be used by including
8278
the headers only.
8379
8480
The Boost libraries requiring separate building and installation are:
85-
- atomic
86-
- chrono
87-
- container
88-
- context
8981
- contract
90-
- coroutine
9182
- date_time
9283
- exception
93-
- fiber
94-
- filesystem
9584
- graph
9685
- graph_parallel
9786
- headers
98-
- iostreams
99-
- json
10087
- locale
10188
- log
102-
- math
103-
- mpi
10489
- nowide
10590
- program_options
106-
- python
107-
- random
10891
- regex
10992
- serialization
110-
- stacktrace
111-
- system
11293
- test
11394
- thread
114-
- timer
11595
- type_erasure
116-
- url
96+
- winapi
11797
- wave
98+
- variant2
99+
- variant
100+
- uuid
101+
- url
102+
- unordered
103+
- type_index
104+
- tuple
105+
- timer
106+
- throw_exception
107+
- system
108+
- stl_interfaces
109+
- stacktrace
110+
- smart_ptr
111+
- signals2
112+
- scope
113+
- redis
114+
- ratio
115+
- random
116+
- python
117+
- process
118+
- predef
119+
- poly_collection
120+
- pfr
121+
- parameter
122+
- outcome
123+
- optional
124+
- mysql
125+
- multi_index
126+
- msm
127+
- mpi
128+
- mp11
129+
- move
130+
- math
131+
- lockfree
132+
- lexical_cast
133+
- lambda2
134+
- json
135+
- iterator
136+
- iostreams
137+
- intrusive
138+
- interprocess
139+
- integer
140+
- heap
141+
- hana
142+
- geometry
143+
- function_types
144+
- function
145+
- flyweight
146+
- filesystem
147+
- fiber
148+
- endian
149+
- dll
150+
- detail
151+
- describe
152+
- crc
153+
- coroutine2
154+
- coroutine
155+
- core
156+
- conversion
157+
- context
158+
- container_hash
159+
- container
160+
- compat
161+
- cobalt
162+
- chrono
163+
- charconv
164+
- bind
165+
- bimap
166+
- beast
167+
- atomic
168+
- assert
169+
- asio
170+
- any
118171
119172
```
120-
## Crystax
121-
[Crystax](https://www.crystax.net/) is an alternative to Google's Ndk. It ships with prebuilt boost binaries, and dedicated build scripts.
122-
These binaries will however not work with Goolge's Ndk. If for some reason you can't or don't want to use Crystax then you can't use their boost binaries or build scripts, which is why this project exists.
173+
123174

124175
## Contributions
125-
- Many thanks to [crystax](https://github.com/crystax/android-platform-ndk/tree/master/build/tools) for their version of *build-boost.sh* which I adapted to make it work with the google ndk.
176+
- Many thanks to [crystax](https://github.com/crystax/android-platform-ndk/tree/master/build/tools) for their version of _build-boost.sh which I adapted to make it work with the google ndk.
126177

boost/down/readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
- [download](https://www.boost.org/users/download/) boost source code
2-
- Extract the archive here
2+
- Extract the archive into a subdir of this dir
33

44
- You should then have something like:
55

66
```shell
7-
readme.md # this file
8-
1.87.0/
7+
readme.md # ie this file
8+
boost_1_87_0/ # where the exact name of this dir reflects the version of boost you downloaded
99
boostcpp.jam
1010
bootstrap.bat
1111
bootstrap.sh

example_app/local.properties

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88
# For customization when using a Version Control System, please read the
99
# header note.
1010
sdk.dir=/Users/declan/Library/Android/sdk
11-
boost.dir=/Users/declan/Documents/zone/low/Boost-for-Android/build/install
12-
# ndk_27c_boost_1.87.0
11+
boost.dir=/Users/declan/Documents/zone/low/Boost-for-Android/build/install

0 commit comments

Comments
 (0)