Difference between revisions of "Bering-uClibc 5.x - Developer Guide - Preparing the Build Environment"

From bering-uClibc
Jump to: navigation, search
(Added note about "git clone --depth 1")
(Operating System)
 
(14 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
| width="20%" align="left"  | [[Bering-uClibc 5.x - Developer Guide - Introduction|Prev]]
 
| width="20%" align="left"  | [[Bering-uClibc 5.x - Developer Guide - Introduction|Prev]]
 
! width="60%" align="center" | [[Bering-uClibc 5.x - Developer Guide]]
 
! width="60%" align="center" | [[Bering-uClibc 5.x - Developer Guide]]
| width="20%" align="right" | [[Bering-uClibc 5.x - Developer Guide - Adding a Hardware Architecture Variant|Next]]
+
| width="20%" align="right"   | [[Bering-uClibc 5.x - Developer Guide - Compiling Source Code|Next]]
 
|}
 
|}
 
----
 
----
Line 14: Line 14:
 
Compiling source code is a CPU- and RAM-intensive operation, so a reasonably powerful machine is advisable. Multiple CPU cores are a benefit - almost all packages are compiled using all cores.
 
Compiling source code is a CPU- and RAM-intensive operation, so a reasonably powerful machine is advisable. Multiple CPU cores are a benefit - almost all packages are compiled using all cores.
  
Examples of build performance for "<tt>buildtool.pl build</tt>" (unpack and build all packages) are:
+
Examples of build performance for "<tt>buildtool.pl build</tt>" (unpack and build all packages) for i486 architecture are:
;120 minutes : AMD Athlon(tm) II X4 645 Processor (Quad Core) with 2GB DDR2 RAM, Gentoo (64-bit)
+
 
 +
- approx. 3,5 hours with an AMD Athlon(tm) II X4 645 Processor (Quad Core) with 8GB DDR2 RAM, Kubuntu (64-bit)
 +
 
 +
Add about the same amount of time for other architectures.
  
 
====Disk Space====
 
====Disk Space====
A fully built development environment with all of the [[Bering-uClibc 5.x]] Packages and all of the kernel variants occupies more than 10 Gigabytes of disk space.
+
A fully built development environment with all of the [[Bering-uClibc 5.x]] Packages and all of the kernel variants occupies more than 30 Gigabytes of disk space.
  
 
The following statistics were reported on 2012-04-01 but note that the space requirements will gradually grow as more Packages are added:
 
The following statistics were reported on 2012-04-01 but note that the space requirements will gradually grow as more Packages are added:
Line 27: Line 30:
 
In total that is approximately 11.5GB.
 
In total that is approximately 11.5GB.
  
For planning purpsoes assume that 15 Gigabytes are required.
+
For planning purposes assume that 15 Gigabytes are required.
 
If building multiple Toolchains then allow an extra 10 Gigabytes for each additional Toolchain.
 
If building multiple Toolchains then allow an extra 10 Gigabytes for each additional Toolchain.
  
Line 35: Line 38:
 
* Fedora 15 (64-bit)
 
* Fedora 15 (64-bit)
 
* Fedora 17 (64-bit)
 
* Fedora 17 (64-bit)
 +
* (K)ubuntu 14.04 (64-bit)
  
 
====Required Software on the Build Host====
 
====Required Software on the Build Host====
 
;perl : All of the "build" utilities (buildtool, buildpackage, buildimage) are written in Perl and require Perl version 5.6 or higher.
 
;perl : All of the "build" utilities (buildtool, buildpackage, buildimage) are written in Perl and require Perl version 5.6 or higher.
:In addition there is a requirement for the [http://search.cpan.org/dist/Config-General/ <tt>Config::General</tt>] Perl module which is not part of most standard Perl installations. On distributions which use the "yum" package manager (Red Hat, Fedora etc.) the required RPM can usually be installed with:<pre>yum install perl-Config-General</pre>
+
:In addition there is a requirement for Perl modules which is not part of most standard Perl installations:
:Furthermore, the <code class="filename">buildimage.pl</code> utility relies on the [http://search.cpan.org/~gbarr/TimeDate-1.20/lib/Date/Format.pm <tt>Date::Format</tt>] Perl module which is part of the <tt>TimeDate</tt> Perl package and can be installed with a command like:<pre>yum install perl-TimeDate</pre>
+
:* [http://search.cpan.org/dist/Config-General/ <tt>Config::General</tt>]
:On distributions which use the "dpkg" package manager (Debian, Ubuntu etc.) the required packages can usually be installed with:<pre>aptitude install libconfig-general-perl libdatetime-perl</pre>
+
:* [http://search.cpan.org/perldoc?Date%3A%3AFormat <tt>Date::Format</tt>] Perl module which is part of the <tt>TimeDate</tt> Perl package
;cvs : [[LEAF]] currently uses git for source code version control, so the <tt>git</tt> utility is required.
+
:* [http://search.cpan.org/perldoc?parent <tt>parent</tt>]
 +
:* [http://search.cpan.org/perldoc?List%3A%3AMoreUtils <tt>List::MoreUtils</tt>]
 +
:* [http://search.cpan.org/perldoc?Hash%3A%3AMerge <tt>Hash::Merge</tt>]
 +
 
 +
:On distributions which use the "yum" package manager (Red Hat, Fedora etc.) the required RPM can usually be installed with:
 +
: <pre>sudo yum install 'perl(Config::General)' 'perl(Date::Format)' 'perl(parent)' 'perl(List::MoreUtils)' 'perl(Hash::Merge)'</pre>
 +
 
 +
:On distributions which use the "dpkg" package manager (Debian, Ubuntu etc.) the required packages can usually be installed with:
 +
: <pre>aptitude install libconfig-general-perl libdatetime-perl liblist-moreutils-perl libhash-merge-perl</pre>
 +
 
 +
;git : [[LEAF]] currently uses git for source code version control, so the <tt>git</tt> utility is required.
 
;patch : The <tt>patch</tt> utility is required to apply patches to upstream source distributions.
 
;patch : The <tt>patch</tt> utility is required to apply patches to upstream source distributions.
 
;texinfo : Required for the <tt>makeinfo</tt> utility used for some compilation steps, though the resulting <tt>.info</tt> files are not used.
 
;texinfo : Required for the <tt>makeinfo</tt> utility used for some compilation steps, though the resulting <tt>.info</tt> files are not used.
Line 50: Line 64:
 
;fakeroot : Required when building Packages and disk Images, avoiding the need to actually run as the <tt>root</tt> user on the build host.
 
;fakeroot : Required when building Packages and disk Images, avoiding the need to actually run as the <tt>root</tt> user on the build host.
 
;cmake : Required to build accel-ppp
 
;cmake : Required to build accel-ppp
 +
;intltool: Required to build avahi
 
;gmp : Required to build toolchain - including "development" features. On Red Hat systems this normally means installing the RPM for <code>gmp-devel</code>
 
;gmp : Required to build toolchain - including "development" features. On Red Hat systems this normally means installing the RPM for <code>gmp-devel</code>
 
;mpfr : Required to build toolchain - including "development" features. On Red Hat systems this normally means installing the RPM for <code>mpfr-devel</code>
 
;mpfr : Required to build toolchain - including "development" features. On Red Hat systems this normally means installing the RPM for <code>mpfr-devel</code>
 
;libmpc : Required to build toolchain - including "development" features. On Red Hat systems this normally means installing the RPM for <code>libmpc-devel</code>
 
;libmpc : Required to build toolchain - including "development" features. On Red Hat systems this normally means installing the RPM for <code>libmpc-devel</code>
 
  
 
In addition, the following RPM or similar packages are also required on the build host but are normally a standard part of the base Linux distribution:
 
In addition, the following RPM or similar packages are also required on the build host but are normally a standard part of the base Linux distribution:
 
* autoconf
 
* autoconf
 
* automake
 
* automake
 +
* bc
 
* binutils (for command <tt>strip</tt>)
 
* binutils (for command <tt>strip</tt>)
 
* bzip2 (for command <tt>bzcat</tt>)
 
* bzip2 (for command <tt>bzcat</tt>)
 
* cpio (for generating <tt>initrd.lrp</tt>)
 
* cpio (for generating <tt>initrd.lrp</tt>)
 +
* file
 
* flex
 
* flex
 
** For cross-compiling <tt>linux-atm</tt> a static version of the build host's flex <tt>libfl.a</tt> is required. On Red Hat systems this normally means installing the RPM for <code>flex-static</code>.
 
** For cross-compiling <tt>linux-atm</tt> a static version of the build host's flex <tt>libfl.a</tt> is required. On Red Hat systems this normally means installing the RPM for <code>flex-static</code>.
 
* gawk
 
* gawk
* gcc
+
* gcc (4.8.x, gcc 5.x does not work yet)
 +
* gcc-c++
 
* gzip (for a gzip-compatible <tt>zcat</tt>)
 
* gzip (for a gzip-compatible <tt>zcat</tt>)
 
* libtool
 
* libtool
Line 74: Line 91:
 
* tar
 
* tar
 
* wget
 
* wget
 +
* xz
 +
* lzop
  
 
===SourceForge User Account===
 
===SourceForge User Account===
 
TODO
 
TODO
 
  
 
==Cloning the Git Repository==
 
==Cloning the Git Repository==
Line 83: Line 101:
 
Further information on using Git can be found in Appendix [[Bering-uClibc 4.x - Developer Guide - Hints and Tips for using Git SCM|Hints and Tips for using Git SCM]] but the basic steps are as follows:
 
Further information on using Git can be found in Appendix [[Bering-uClibc 4.x - Developer Guide - Hints and Tips for using Git SCM|Hints and Tips for using Git SCM]] but the basic steps are as follows:
 
# Change to the directory where you wish to do your [[Bering-uClibc 5.x]] development.
 
# Change to the directory where you wish to do your [[Bering-uClibc 5.x]] development.
# Run the following command, replacing ''USERNAME'' with your SourceForge username: <pre>git clone ssh://USERNAME@leaf.git.sourceforge.net/gitroot/leaf/bering-uclibc --branch next  bering-uclibc-next</pre>Note that this will take some time to run, since it has to download the build toolchain source as well as the source for the [[Bering-uClibc 5.x]] Packages.
+
# Run the following command, replacing ''USERNAME'' with your SourceForge username: <pre>git clone ssh://USERNAME@git.code.sf.net/p/leaf/bering-uclibc bering-uclibc-master</pre>Note that this will take some time to run, since it has to download the build toolchain source as well as the source for the [[Bering-uClibc 5.x]] Packages.
 
#* If for some reason you do not want or need the full history of changes since this repository was created it is possible to omit the history by including "<code>--depth 1</code>" in the command arguments.
 
#* If for some reason you do not want or need the full history of changes since this repository was created it is possible to omit the history by including "<code>--depth 1</code>" in the command arguments.
 
The arguments to the <code>git glone</code> command are as follows:
 
The arguments to the <code>git glone</code> command are as follows:
* The string "<code>ssh://USERNAME@leaf.git.sourceforge.net/gitroot/leaf/bering-uclibc</code>" specifies the name of the Git repository to be cloned (including the access mechanism, ssh)
+
* The string "<code>ssh://USERNAME@git.code.sf.net/p/leaf/bering-uclibc</code>" specifies the name of the Git repository to be cloned (including the access mechanism, ssh)
* The string "<code>--branch next</code>" specifies the name of the branch ('<code>next</code>') to be cloned (in place of the default branch, '<code>master</code>'). Note that this automatically sets up a local branch (called '<code>next</code>') which is configured to automatically "track" the remote branch of the same name.
+
* The string "<code>bering-uclibc-master</code>" specifies the name of the local directory to be created, under the current working directory, to hold the clone repository. By default the local directory name would match the name of the repository being cloned (i.e. "<code class="filename">bering-uclibc</code>").
* The string "<code>bering-uclibc-next</code>" specifies the name of the local directory to be created, under the current working directory, to hold the clone repository. By default the local directory name would match the name of the repository being cloned (i.e. "<code class="filename">bering-uclibc</code>").
+
 
+
 
+
  
 
==Building the Build environment==
 
==Building the Build environment==
Line 108: Line 123:
 
| width="40%" align="left"  | [[Bering-uClibc 5.x - Developer Guide - Introduction|Prev]]
 
| width="40%" align="left"  | [[Bering-uClibc 5.x - Developer Guide - Introduction|Prev]]
 
| width="20%" align="center" | [[Bering-uClibc 5.x - Developer Guide|Up]]
 
| width="20%" align="center" | [[Bering-uClibc 5.x - Developer Guide|Up]]
| width="40%" align="right" | [[Bering-uClibc 5.x - Developer Guide - Adding a Hardware Architecture Variant|Next]]
+
| width="40%" align="right"   | [[Bering-uClibc 5.x - Developer Guide - Compiling Source Code|Next]]
 
|}
 
|}
  
 
[[Category:Bering-uClibc 5.x]]
 
[[Category:Bering-uClibc 5.x]]
 
[[Category:Developer Guide]]
 
[[Category:Developer Guide]]

Latest revision as of 13:52, 14 April 2016

Preparing the Build Environment
Prev Bering-uClibc 5.x - Developer Guide Next


Pre-Requisites

Hardware

CPU & RAM

Compiling source code is a CPU- and RAM-intensive operation, so a reasonably powerful machine is advisable. Multiple CPU cores are a benefit - almost all packages are compiled using all cores.

Examples of build performance for "buildtool.pl build" (unpack and build all packages) for i486 architecture are:

- approx. 3,5 hours with an AMD Athlon(tm) II X4 645 Processor (Quad Core) with 8GB DDR2 RAM, Kubuntu (64-bit)

Add about the same amount of time for other architectures.

Disk Space

A fully built development environment with all of the Bering-uClibc 5.x Packages and all of the kernel variants occupies more than 30 Gigabytes of disk space.

The following statistics were reported on 2012-04-01 but note that the space requirements will gradually grow as more Packages are added:

  • For cloning the Git repository: 1.9GB
  • For building the default Toolchain a further: 3.6GB
  • For building all the Packages for the default Toolchain a further: 5.5GB
  • For building all the Images for the default Toolchain a further: 0.5GB

In total that is approximately 11.5GB.

For planning purposes assume that 15 Gigabytes are required. If building multiple Toolchains then allow an extra 10 Gigabytes for each additional Toolchain.

Operating System

The Bering-uClibc 5.x kernel and Packages can be built on any modern Linux distribution which has the necessary software development utilities installed. Examples of distributions which are known to work include:

  • Gentoo (64-bit)
  • Fedora 15 (64-bit)
  • Fedora 17 (64-bit)
  • (K)ubuntu 14.04 (64-bit)

Required Software on the Build Host

perl 
All of the "build" utilities (buildtool, buildpackage, buildimage) are written in Perl and require Perl version 5.6 or higher.
In addition there is a requirement for Perl modules which is not part of most standard Perl installations:
On distributions which use the "yum" package manager (Red Hat, Fedora etc.) the required RPM can usually be installed with:
sudo yum install 'perl(Config::General)' 'perl(Date::Format)' 'perl(parent)' 'perl(List::MoreUtils)' 'perl(Hash::Merge)'
On distributions which use the "dpkg" package manager (Debian, Ubuntu etc.) the required packages can usually be installed with:
aptitude install libconfig-general-perl libdatetime-perl liblist-moreutils-perl libhash-merge-perl
git 
LEAF currently uses git for source code version control, so the git utility is required.
patch 
The patch utility is required to apply patches to upstream source distributions.
texinfo 
Required for the makeinfo utility used for some compilation steps, though the resulting .info files are not used.
nasm 
Required to build e3.
zlib-devel (headers for zlib) 
Required to build toolchain (depmod with gzipped modules support).
bison 
Required to build the (TBC) Package.
asciidoc 
Required to build the (TBC) Package.
fakeroot 
Required when building Packages and disk Images, avoiding the need to actually run as the root user on the build host.
cmake 
Required to build accel-ppp
intltool
Required to build avahi
gmp 
Required to build toolchain - including "development" features. On Red Hat systems this normally means installing the RPM for gmp-devel
mpfr 
Required to build toolchain - including "development" features. On Red Hat systems this normally means installing the RPM for mpfr-devel
libmpc 
Required to build toolchain - including "development" features. On Red Hat systems this normally means installing the RPM for libmpc-devel

In addition, the following RPM or similar packages are also required on the build host but are normally a standard part of the base Linux distribution:

  • autoconf
  • automake
  • bc
  • binutils (for command strip)
  • bzip2 (for command bzcat)
  • cpio (for generating initrd.lrp)
  • file
  • flex
    • For cross-compiling linux-atm a static version of the build host's flex libfl.a is required. On Red Hat systems this normally means installing the RPM for flex-static.
  • gawk
  • gcc (4.8.x, gcc 5.x does not work yet)
  • gcc-c++
  • gzip (for a gzip-compatible zcat)
  • libtool
    • Including "development" features. On Red Hat systems this normally means installing the RPM for libtool-ltdl-devel.
  • lzma
  • m4
  • make
  • sed
  • tar
  • wget
  • xz
  • lzop

SourceForge User Account

TODO

Cloning the Git Repository

The first step in building Bering-uClibc 5.x from source is to copy or "clone" the Git repository hosted by SourceForge. Further information on using Git can be found in Appendix Hints and Tips for using Git SCM but the basic steps are as follows:

  1. Change to the directory where you wish to do your Bering-uClibc 5.x development.
  2. Run the following command, replacing USERNAME with your SourceForge username:
    git clone ssh://USERNAME@git.code.sf.net/p/leaf/bering-uclibc bering-uclibc-master
    Note that this will take some time to run, since it has to download the build toolchain source as well as the source for the Bering-uClibc 5.x Packages.
    • If for some reason you do not want or need the full history of changes since this repository was created it is possible to omit the history by including "--depth 1" in the command arguments.

The arguments to the git glone command are as follows:

  • The string "ssh://USERNAME@git.code.sf.net/p/leaf/bering-uclibc" specifies the name of the Git repository to be cloned (including the access mechanism, ssh)
  • The string "bering-uclibc-master" specifies the name of the local directory to be created, under the current working directory, to hold the clone repository. By default the local directory name would match the name of the repository being cloned (i.e. "bering-uclibc").

Building the Build environment

With the source code for the build toolchain downloaded this now has to be compiled for your build host.

Change directory to the bering-uclibc-next directory created during the clone operation.

Run the following command:

./buildtool.pl build toolchain

This will take some considerable time. Build messages, including any errors, are written to file log/buildtoollog so you may wish to run the following command in another shell window to keep track of progress:

tail -f log/buildtoollog



Prev Up Next