|
| 1 | +# PREREQUISITES |
| 2 | + |
| 3 | +## Python 3.6 of higher |
| 4 | + |
| 5 | +* On Windows: |
| 6 | + * Download the Python installer from the official Python website: [Python Website](https://www.python.org/downloads/windows/) |
| 7 | +* On MacOS: |
| 8 | + * Using `brew` (steps to [install `brew`](##cmake-31-on-mac)): `brew install python`. |
| 9 | + * Download the Python installer from the official Python website: [Python Website](https://www.python.org/downloads/macos/) |
| 10 | +* On Linux: |
| 11 | + * Ubuntu: `sudo apt-get install python3` |
| 12 | + * Arch Linux: `sudo pacman -S python3` |
| 13 | + * Linux Distros that support `yum`: `sudo yum install python3` |
| 14 | + |
| 15 | +# Installation Issues |
| 16 | + |
| 17 | +`awsiotsdk` depends on [awscrt](https://github.com/awslabs/aws-crt-python), which makes use of C extensions. Precompiled wheels are downloaded when installing on major platforms (Mac, Windows, Linux, Raspberry Pi OS). If wheels are unavailable for your platform, your machine must compile some C libraries. If you encounter issues, please install the following dependencies: |
| 18 | + |
| 19 | +* CMake 3.1+ |
| 20 | +* Python headers and development libraries |
| 21 | +* You may also need to install a C/C++ compiler to compile the C code |
| 22 | + |
| 23 | +Steps to install these dependencies per platform are listed below. |
| 24 | + |
| 25 | + |
| 26 | +## Cmake 3.1+ |
| 27 | +### Cmake 3.1+ on Windows |
| 28 | + |
| 29 | +1. Download CMake3.1+ for your platform: https://cmake.org/download/ |
| 30 | +2. Run the Cmake Installer. Make sure you add CMake into **PATH**. |
| 31 | +3. Restart the command prompt / terminal. |
| 32 | + |
| 33 | +### Cmake 3.1+ on Mac |
| 34 | + |
| 35 | +You can install CMake easily using `brew` and it is the recommended workflow for most usecases. [Brew](https://brew.sh/) is a command line package manager that makes it easy to install packages and software dependencies. |
| 36 | + |
| 37 | +1. Open a new terminal and input the following command: |
| 38 | +``` sh |
| 39 | +bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| 40 | +``` |
| 41 | +2. If XCode Command Line Tools are not installed, the `brew` install process will ask if you want to install. Type `y` to install. |
| 42 | +3. Wait for `brew` to install the XCode Command Line Tools. This make take some time. |
| 43 | +4. Once `brew` is finished, confirm the XCode Command Line Tools have installed by opening a new terminal and inputting `clang --version`. |
| 44 | + |
| 45 | +Once `brew` is installed, you can install CMake using these steps: |
| 46 | +1. Install CMake by running `brew install cmake`. |
| 47 | +2. Once the install is finished, close the terminal and reopen it. |
| 48 | +3. Confirm CMake is installed by running `cmake --version`. |
| 49 | + |
| 50 | +If stuck waiting for `brew` to install XCode Command Line Tools for over 15-20 minutes, you many need to cancel the installation (`CTRL-C` in the terminal) |
| 51 | +and install XCode Command Line Tools though the installer. You can find steps to install the XCode Command Line tools here: [Install XCode Command Line Tools](#macos-xcode-command-line-tools) |
| 52 | + |
| 53 | +#### CMake using official precompiled download |
| 54 | + |
| 55 | +You can also install CMake using a precompiled binary using the following steps: |
| 56 | + |
| 57 | +1. Go to [cmake.org/install](https://cmake.org/install/). |
| 58 | +2. Follow the install instructions for MacOS on the website page. |
| 59 | +3. Once CMake is installed and added to the path, confirm it's working by running `cmake --version`. |
| 60 | + |
| 61 | +### Cmake 3.1 on Linux |
| 62 | + |
| 63 | +#### Install CMake on Ubuntu |
| 64 | + |
| 65 | +1. Open the Ubuntu Software Center |
| 66 | +2. In the search bar enter `cmake` and select `CMake - cross-platform build system` from the list |
| 67 | +3. Press the `install` button |
| 68 | +4. After CMake has installed open a new terminal |
| 69 | +5. Type `cmake --version` to confirm CMake is installed |
| 70 | + |
| 71 | +Or using the command line: |
| 72 | + |
| 73 | +1. Open a new terminal |
| 74 | +2. Run `sudo snap install cmake` to install CMake from the snap store |
| 75 | +3. After CMake has installed, close the terminal and reopen it |
| 76 | +4. Type `cmake --version` to confirm CMake is installed |
| 77 | + |
| 78 | +#### Install CMake on Arch Linux |
| 79 | + |
| 80 | +1. Open a new terminal. |
| 81 | +2. Run `sudo pacman -S cmake` to install Cmake |
| 82 | +3. After CMake has installed, close the terminal and reopen it |
| 83 | +4. Type `cmake --version` to confirm CMake is installed. |
| 84 | + |
| 85 | + |
| 86 | +## Python headers and libraries |
| 87 | + |
| 88 | +For Windows and MacOS, the development headers and libraries should be installed automatically. |
| 89 | + |
| 90 | +On Linux, the development headers and libaries are installed seperately and can be installed using the following commands depending on your Linux distro: |
| 91 | +* Ubuntu: `sudo apt-get install python3-dev` |
| 92 | +* Arch Linux: `sudo pacman -S python3-dev` |
| 93 | +* Distros supporting `yum`: `sudo yum install python3-devel` |
| 94 | + |
| 95 | + |
| 96 | +## C/C++ Compiler |
| 97 | + |
| 98 | +First, check if you need to install a C/C++ compiler by running one of the following commands: |
| 99 | + |
| 100 | +``` sh |
| 101 | +g++ --version |
| 102 | +``` |
| 103 | + |
| 104 | +``` sh |
| 105 | +clang --version |
| 106 | +``` |
| 107 | + |
| 108 | +If you get a message with a version number, then you already have a C/C++ compiler and do not need to install anything else. |
| 109 | + |
| 110 | +### Windows |
| 111 | + |
| 112 | +You can compile C and C++ code through MSVC. To install Visual Studio with MSVC, follow these steps: |
| 113 | +1. Download **Visual Studio Installer** https://visualstudio.microsoft.com/downloads/ |
| 114 | +2. Run the installer, check the **Desktop development with C++** workload and select Install. |
| 115 | +3. Verify your MSVC installation |
| 116 | + * In Windows Start up Menu, try open "Developer Command Prompt for VS" |
| 117 | + |
| 118 | +### MacOS (XCode Command Line Tools) |
| 119 | + |
| 120 | +To compile C/C++ code on MacOS, you will need to install the Command Line Tools using the following steps: |
| 121 | + |
| 122 | +1. Go to [developer.apple.com/downloads](https://developer.apple.com/download/all/). |
| 123 | +2. Input your AppleID to access the developer downloads. |
| 124 | +3. From the presented list, scroll until you find `Command Line Tools for Xcode <version>`. |
| 125 | +4. Select `view more details` and then select `Additionals Tools for Xcode <version>.dmg`. |
| 126 | +5. Once downloaded, double click the `.dmg` and follow the installer instructions. |
| 127 | +6. Confirm XCode Command Line Tools have installed by opening a new terminal and inputting `clang --version`. |
| 128 | + |
| 129 | +### Linux |
| 130 | +#### Install GCC or Clang on Ubuntu |
| 131 | + |
| 132 | +To compile C/C++ code on Ubuntu Linux, you will need to follow these steps: |
| 133 | + |
| 134 | +1. Open a new terminal |
| 135 | +2. (optional) Run `sudo apt-get update` to get latest package updates. |
| 136 | +3. (optional) Run `sudo apt-get upgrade` to install latest package updates. |
| 137 | +4. Run `sudo apt-get install build-essential` to install GCC or `sudo apt-get install clang` to install Clang. |
| 138 | +5. Once the install is finished, close the terminal and reopen it. |
| 139 | +6. Confirm GCC is installed by running `gcc --version` or Clang is installed by running `clang --version`. |
| 140 | + |
| 141 | +#### Install GCC or Clang on Arch Linux |
| 142 | + |
| 143 | +To compile C/C++ code on Arch Linux, you will need to follow these steps: |
| 144 | + |
| 145 | +1. Open a new terminal. |
| 146 | +2. Run `sudo pacman -S gcc` to install GCC or `sudo pacman -S clang` to install Clang. |
| 147 | +3. Once the install is finished, close the terminal and reopen it. |
| 148 | +4. Confirm Clang is installed by running `gcc --version`. |
0 commit comments