Skip to content

Commit f75b3ef

Browse files
PeterTurcanalandefreitas
authored andcommitted
macOS getting started added
1 parent cd45330 commit f75b3ef

6 files changed

Lines changed: 174 additions & 2 deletions

user-guide/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
* xref:intro.adoc[Introduction to Boost]
22
* xref:getting-started-with-windows.adoc[Getting Started with Windows]
33
* xref:getting-started-with-linux.adoc[Getting Started with Linux]
4+
* xref:getting-started-with-macos.adoc[Getting Started with macOS]
45
* xref:use-boost-with-windows-package-manager.adoc[Use Boost with Windows and a Package Manager]
56
* xref:use-boost-with-linux-package-manager.adoc[Use Boost with Linux and a Package Manager]
67
* Legacy Content

user-guide/modules/ROOT/pages/getting-started-with-linux.adoc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
= Getting Started with Linux
22

3+
To install the Boost libraries on a Linux system, you can either use the package manager provided by your distribution or compile and install Boost from the source code. Here's a step-by-step guide for both methods:
4+
5+
== Method 1: Using the Package Manager
6+
7+
. Open a terminal window. Update your package manager's repository cache. For example, if you're using Ubuntu or Debian-based distributions, use the following command: `sudo apt update`.
8+
9+
. Install the Boost development libraries using your package manager. For Ubuntu or Debian-based distributions, you can use the following command: `sudo apt install libboost-all-dev`. This command installs all the Boost development libraries available in the package repository.
10+
11+
== Method 2: Installing from source
12+
13+
. Open a terminal window. Install the necessary build tools and libraries. For Ubuntu or Debian-based distributions, use the following command: `sudo apt install build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev libtool`
14+
15+
. Download the latest Boost source code from the official website (https://www.boost.org/users/download/), or use `wget` to download it directly: `wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_82_0.tar.bz2`. Replace the URL and version number (1.82.0) with the latest version available.
16+
17+
. Extract the downloaded archive: `tar xvfj boost_1_82_0.tar.bz2`.
18+
19+
. Change to the extracted directory: `cd boost_1_82_0`.
20+
21+
. Run the bootstrap script to prepare for building Boost: `./bootstrap.sh --prefix=/usr/local`. The --prefix option specifies the installation directory. You can change this to your preferred location.
22+
23+
. Build and install Boost: `sudo ./b2 install`. This command builds and installs the Boost libraries to the specified prefix directory.
24+
25+
. (Optional) To use the installed Boost libraries, you may need to update your environment variables:
26+
+
27+
For LD_LIBRARY_PATH: `export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH`.
28+
For CPLUS_INCLUDE_PATH: `export CPLUS_INCLUDE_PATH=/usr/local/include:$CPLUS_INCLUDE_PATH`.
29+
Replace /usr/local with the prefix directory you specified during the installation, if different.
30+
31+
You can add these `export` commands to your `~/.bashrc` or `~/.profile` file to make the changes permanent.
32+
33+
After completing either method, you should have the Boost libraries installed on your Linux system.
34+
35+
36+
37+
38+
339

440

541
== Next Steps
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
= Getting Started with macOS
2+
3+
To install Boost libraries on macOS, you can use Homebrew, a popular package manager for macOS that simplifies the installation of software packages. Here's a step-by-step guide to installing the Boost libraries using Homebrew.
4+
5+
== Prerequisites
6+
7+
Homebrew has a few prerequisites, one of which is the Xcode Command Line Tools. The Xcode Command Line Tools include essential developer tools, like compilers and build utilities, that Homebrew needs to function properly.
8+
9+
When you install Homebrew using the installation script, it will automatically check for the presence of the Xcode Command Line Tools. If they are not already installed, the script will prompt you to install them.
10+
11+
However, if you want to manually install the Xcode Command Line Tools before installing Homebrew, you can follow these steps:
12+
13+
. Open Terminal.
14+
15+
. Run the following command: `xcode-select --install`. A pop-up window will appear, prompting you to install the Xcode Command Line Tools. Click *Install* to start the installation process.
16+
17+
Once the Xcode Command Line Tools are installed, you can proceed with installing Homebrew.
18+
19+
It's important to note that the full Xcode application is not required to use Homebrew, but it can be beneficial for developers who need additional development tools or want to create macOS and iOS applications. You can download and install the full Xcode application from the Mac App Store if you need it.
20+
21+
== Install Homebrew
22+
23+
You can skip step 1 if you have already installed Homebrew.
24+
25+
. Open Terminal and run the following command:
26+
27+
+
28+
[source]
29+
----
30+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
31+
----
32+
+
33+
This command will download and execute the Homebrew installation script. Follow the prompts to complete the installation.
34+
35+
. Update Homebrew. Before installing the Boost libraries, it's a good idea to update Homebrew to ensure you have the latest package information. Run the following command: `brew update`.
36+
37+
== Install Boost
38+
39+
. Now you can install the Boost libraries using Homebrew. Run the following command: `brew install boost`. Homebrew will download and install the Boost libraries and their dependencies.
40+
41+
. To verify that the Boost libraries are installed correctly, you can run the following command: `brew list boost`. This command will show the installed files for the Boost libraries.
42+
43+
Now the Boost libraries are installed on your macOS system, and you can use them in your projects.
44+
45+
To use Boost in your projects, you may need to configure your build system (e.g., CMake, Makefile, Xcode) to include the appropriate header files and link against the Boost libraries. The specific configuration depends on the build system and the Boost libraries you're using.

user-guide/modules/ROOT/pages/intro.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ If you are new to Boost, the recommended next step is to download the entire lib
8484
[square]
8585
* xref:getting-started-with-windows.adoc[Getting Started with Windows]
8686
* xref:getting-started-with-linux.adoc[Getting Started with Linux]
87-
87+
* xref:getting-started-with-macos.adoc[Getting Started with macOS]
Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1-
= Use Boost with Linux and a Package Manager
1+
= Use Boost with Linux and a Package Manager
2+
3+
Yes, you can use vcpkg on Linux. To install vcpkg on a Linux system, follow these steps:
4+
5+
Open a terminal.
6+
7+
Install the necessary packages for building vcpkg by running the following command (for Ubuntu or Debian-based systems):
8+
9+
sql
10+
Copy code
11+
sudo apt-get update
12+
sudo apt-get install build-essential tar curl zip unzip git
13+
For other Linux distributions, install the equivalent packages using the appropriate package manager, such as yum, dnf, or pacman.
14+
15+
Clone the vcpkg repository from GitHub by running the following command:
16+
bash
17+
Copy code
18+
git clone https://github.com/microsoft/vcpkg.git
19+
This command will create a new directory named "vcpkg" in your current directory and clone the repository into it.
20+
21+
Change to the "vcpkg" directory using the "cd" command:
22+
bash
23+
Copy code
24+
cd vcpkg
25+
Run the bootstrap script to build the vcpkg executable:
26+
bash
27+
Copy code
28+
./bootstrap-vcpkg.sh
29+
This script will download and build the necessary components for vcpkg. It might take a few minutes to complete.
30+
31+
(Optional) Add the vcpkg executable to your system's PATH environment variable. This step makes it easier to run vcpkg from any directory. Run the following command:
32+
bash
33+
Copy code
34+
export PATH=$PATH:$(pwd)
35+
To make this change permanent, add the above export command to your shell's configuration file, such as ~/.bashrc or ~/.bash_profile for the Bash shell.
36+
37+
Now, vcpkg is installed on your Linux system, and you can start using it to manage your C++ project dependencies. To install a package, you can run a command like:
38+
39+
bash
40+
Copy code
41+
./vcpkg install <package-name>
42+
Replace <package-name> with the name of the package you want to install.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,50 @@
11
= Use Boost with Windows and a Package Manager
2+
3+
This section describes how to manage Boost libraries using the *vcpkg* package manager. It is an open source and free app.
4+
5+
== Advantages of using vcpkg
6+
7+
A package manager like vcpkg adds value by simplifying and streamlining the process of managing dependencies in a software project. It can be particularly helpful in C++ projects, which often have complex dependency chains. Some of the key benefits of using vcpkg include:
8+
9+
* Simplified dependency management: vcpkg automates the process of downloading, building, and installing libraries, saving developers time and effort.
10+
11+
* Consistent environment: vcpkg ensures that all developers on a team use the same library versions, helping to avoid inconsistencies and bugs that can arise from using different library versions in different environments.
12+
13+
* Cross-platform support: vcpkg supports multiple platforms, including Windows, macOS, and Linux, making it easier to develop cross-platform projects.
14+
15+
* Binary caching: vcpkg caches compiled binaries, speeding up subsequent builds and installations of the same libraries across different projects.
16+
17+
* Version control: vcpkg allows developers to specify the exact version of a library they want to use, ensuring that updates to libraries do not introduce breaking changes to their projects.
18+
19+
* Library discovery: vcpkg has a large catalog of available libraries, making it easy for developers to discover and use new libraries in their projects.
20+
21+
* Integration with build systems: vcpkg integrates with popular build systems like CMake, simplifying the process of adding dependencies to a project.
22+
23+
* Regular updates and maintenance: vcpkg is actively maintained and updated by Microsoft, ensuring that the package manager and its libraries stay current and compatible with the latest development tools and practices.
24+
25+
By providing these benefits, a package manager like vcpkg helps developers to focus on writing code and building features, rather than spending time on managing dependencies manually.
26+
27+
== Install the Package Manager
28+
29+
To install vcpkg on a Windows PC, follow these steps:
30+
31+
. Open a Command Prompt or PowerShell with administrative privileges. You can do this by searching for *cmd* or *PowerShell* in the Start menu, right-clicking on the relevant result, and choosing *Run as administrator*.
32+
33+
. Clone the vcpkg repository from GitHub by running the following command: `it clone https://github.com/microsoft/vcpkg.git`. This command will create a new directory named *vcpkg* in your current directory and clone the repository into it. If you don't have Git installed, you can download it from https://git-scm.com/downloads and install it.
34+
35+
. Change to the *vcpkg* directory using the `cd` command: `cd vcpkg`.
36+
37+
. Run the bootstrap script to build the vcpkg executable: `.\bootstrap-vcpkg.bat`. This script will download and build the necessary components for vcpkg. It might take a few minutes to complete.
38+
39+
. (Optional) Add the vcpkg executable to your system's PATH environment variable. This step makes it easier to run vcpkg from any directory. Run the following command: `.\vcpkg integrate install`. After running this command, you'll see a message with instructions on how to add vcpkg to your user-wide environment. Follow the instructions to ensure you can use vcpkg from any directory.
40+
41+
== Using the Package Manager
42+
43+
Now, vcpkg is installed on your Windows PC, and you can start using it to manage your C++ project dependencies.
44+
45+
. To install a package, you can run a command like: `.\vcpkg install <package-name>`, replacing <package-name> with the name of the package you want to install.
46+
47+
. To verify access to Boost libraries, enter `vcpkg search boost`. You should see a full list of the Boost libraries you have installed.
48+
49+
50+

0 commit comments

Comments
 (0)