blob: 62967f5572a463636c3ecb558b40d7dbd17ec96e [file] [log] [blame]
Andrew Geisslerf0343792020-11-18 10:42:21 -06001.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002
3**********************
4Using the Standard SDK
5**********************
6
7This chapter describes the standard SDK and how to install it.
8Information includes unique installation and setup aspects for the
9standard SDK.
10
11.. note::
12
13 For a side-by-side comparison of main features supported for a
14 standard SDK as compared to an extensible SDK, see the "
15 Introduction
16 " section.
17
18You can use a standard SDK to work on Makefile and Autotools-based
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050019projects. See the
20":ref:`sdk-manual/working-projects:using the sdk toolchain directly`" chapter
21for more information.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050022
Andrew Geisslerc9f78652020-09-18 14:11:35 -050023Why use the Standard SDK and What is in It?
24===========================================
25
26The Standard SDK provides a cross-development toolchain and libraries
27tailored to the contents of a specific image. You would use the Standard
28SDK if you want a more traditional toolchain experience as compared to
29the extensible SDK, which provides an internal build system and the
30``devtool`` functionality.
31
32The installed Standard SDK consists of several files and directories.
33Basically, it contains an SDK environment setup script, some
34configuration files, and host and target root filesystems to support
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050035usage. You can see the directory structure in the
36":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`"
37section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050038
Andrew Geisslerc9f78652020-09-18 14:11:35 -050039Installing the SDK
40==================
41
42The first thing you need to do is install the SDK on your :term:`Build
43Host` by running the ``*.sh`` installation script.
44
45You can download a tarball installer, which includes the pre-built
46toolchain, the ``runqemu`` script, and support files from the
Andrew Geissler09209ee2020-12-13 08:44:15 -060047appropriate :yocto_dl:`toolchain </releases/yocto/yocto-&DISTRO;/toolchain/>` directory within
Andrew Geisslerc9f78652020-09-18 14:11:35 -050048the Index of Releases. Toolchains are available for several 32-bit and
4964-bit architectures with the ``x86_64`` directories, respectively. The
50toolchains the Yocto Project provides are based off the
51``core-image-sato`` and ``core-image-minimal`` images and contain
52libraries appropriate for developing against that image.
53
54The names of the tarball installer scripts are such that a string
55representing the host system appears first in the filename and then is
56immediately followed by a string representing the target architecture.
57::
58
59 poky-glibc-host_system-image_type-arch-toolchain-release_version.sh
60
61 Where:
62 host_system is a string representing your development system:
63
64 i686 or x86_64.
65
66 image_type is the image for which the SDK was built:
67
68 core-image-minimal or core-image-sato.
69
70 arch is a string representing the tuned target architecture:
71
72 aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon.
73
74 release_version is a string representing the release number of the Yocto Project:
75
Andrew Geissler09209ee2020-12-13 08:44:15 -060076 &DISTRO;, &DISTRO;+snapshot
Andrew Geisslerc9f78652020-09-18 14:11:35 -050077
78For example, the following SDK installer is for a 64-bit
79development host system and a i586-tuned target architecture based off
80the SDK for ``core-image-sato`` and using the current DISTRO snapshot:
81::
82
83 poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
84
85.. note::
86
87 As an alternative to downloading an SDK, you can build the SDK
88 installer. For information on building the installer, see the "
89 Building an SDK Installer
90 " section.
91
92The SDK and toolchains are self-contained and by default are installed
93into the ``poky_sdk`` folder in your home directory. You can choose to
94install the extensible SDK in any location when you run the installer.
95However, because files need to be written under that directory during
96the normal course of operation, the location you choose for installation
97must be writable for whichever users need to use the SDK.
98
99The following command shows how to run the installer given a toolchain
100tarball for a 64-bit x86 development host system and a 64-bit x86 target
101architecture. The example assumes the SDK installer is located in
102``~/Downloads/`` and has execution rights.
103
104.. note::
105
106 If you do not have write permissions for the directory into which you
107 are installing the SDK, the installer notifies you and exits. For
108 that case, set up the proper permissions in the directory and run the
109 installer again.
110
111::
112
Andrew Geissler09209ee2020-12-13 08:44:15 -0600113 $ ./Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
114 Poky (Yocto Project Reference Distro) SDK installer version &DISTRO;
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500115 ===============================================================
Andrew Geissler09209ee2020-12-13 08:44:15 -0600116 Enter target directory for SDK (default: /opt/poky/&DISTRO;):
117 You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed [Y/n]? Y
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500118 Extracting SDK........................................ ..............................done
119 Setting it up...done
120 SDK has been successfully set up and is ready to be used.
121 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
Andrew Geissler09209ee2020-12-13 08:44:15 -0600122 $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500123
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500124Again, reference the
125":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`"
126section for more details on the resulting directory structure of the installed
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500127SDK.
128
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500129Running the SDK Environment Setup Script
130========================================
131
132Once you have the SDK installed, you must run the SDK environment setup
133script before you can actually use the SDK. This setup script resides in
134the directory you chose when you installed the SDK, which is either the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600135default ``/opt/poky/&DISTRO;`` directory or the directory you chose during
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500136installation.
137
138Before running the script, be sure it is the one that matches the
139architecture for which you are developing. Environment setup scripts
140begin with the string "``environment-setup``" and include as part of
141their name the tuned target architecture. As an example, the following
142commands set the working directory to where the SDK was installed and
143then source the environment setup script. In this example, the setup
144script is for an IA-based target machine using i586 tuning:
145::
146
Andrew Geissler09209ee2020-12-13 08:44:15 -0600147 $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500148
149When you run the
150setup script, the same environment variables are defined as are when you
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500151run the setup script for an extensible SDK. See the
152":ref:`sdk-manual/appendix-obtain:installed extensible sdk directory structure`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500153section for more information.