Contents:
Installing the RTEMS tools manually
Select and set up the environment
- See Quick_Start on the RTEMS site
- Instructions for getting the prebuilt tools are at APT/Yum_Repository
- Read Getting Started with RTEMS or its pdf.
- Other online documents are here
Select a configuration:
RTEMS Branch - 4.6, 4.7, 4.8, 4.9, 4.10 or 4.11 (repository head)
4.11
GNU/Linux Distribution - fedora, suse, redhat, etc.
redhat
GNU/Linux Distribution Version
el5
Host CPU Architecture - i386 or x86_64
i386
- Log in on an
rddev
machine (N.B.rdsrv
machine doesn't have off-site access) root
access (sudo -s
) is needed to updateapt
,yum
databases- On 11/21/2012,
apt
seems not to exist onrddev110
, nor is there anapt-conf
file on the RTEMS site. Skip toyum
.
Download and install the prebuilt RTEMS GNU tools using apt
Note: this only works from a system that can see outside of SLAC.
Create the
apt
RPM repository (update the date in the path as appropriate):rpm -ivh http://www.rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/i386/rtems-4.11-release-0.20101016.0-1.el5.noarch.rpm rpm -ivh http://www.rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/i386/rtems-4.11-apt-conf-0.20101016.0-1.el5.noarch.rpm
Creates
/etc/apt/sources.list.d/rtems-4.11.list
.
This recipe is based on instructions found here.
This will install in
/opt/rtems-4.11/
(requiresroot
access), which is generally not useful to us because we want the tools to be in a lab-common area:apt-get -d update apt-get install rtems-4.11-autoconf
- If installation fails with "
E: Unknown signature ... (SHA1) DSA sha1 md5 (GPG) NOT OK (MISSING KEYS: GPG#<nnnnnnnn>)
":- Navigate to
http://www.rtems.org/ftp/pub/rtems/linux/
- Download
gpg-pubkey-<nnnnnnnn>-<mmmmmmmm>
to a local location rpm import /home/claus/rce/gpg-pubkey-<nnnnnnnn>-<mmmmmmmm>
- Check that the key is in the list returned by
rpm -qa | grep -E key
- Navigate to
Install the remainder of the tools:
apt-get install rtems-4.11-automake apt-get install rtems-4.11-powerpc-rtems4.11-binutils apt-get install rtems-4.11-powerpc-rtems4.11-gdb apt-get install rtems-4.11-powerpc-rtems4.11-gcc apt-get install rtems-4.11-powerpc-rtems4.11-gcc-c++
Download and install the prebuilt RTEMS GNU tools using yum
Note: this only works from a system that can see outside of SLAC.
It looks like apt
can't redirect the installation to a root directory different from what is built into the RPM files, but yum
can. Some packages aren't relocatable, e.g., automake
, in which case see 'Building from sources' below. The following recipe is based on instructions found here.
Set installation directory and create it if it doesn't already exist:
export INSTDIR=/u1/reg/package/gnu mkdir -p $INSTDIR
Download and install the yum-conf RPM and then, as
root
, execute:rpm -ivh http://www.rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/i386/rtems-4.11-yum-conf-0.20101202.1-1.el5.noarch.rpm
If rpm complains about dependencies in the above step, run rpm with the
--nodeps
option:rpm -ivh --nodeps rtems-4.11-yum-conf-0.20101202.1-1.el5.noarch.rpm
Install the public keyinto the RPM database:
rpm --import http://www.rtems.org/ftp/pub/rtems/linux/gpg-pubkey-69ce4a83-44cc2b30
Install the tools:
yum --installroot=$INSTDIR install rtems-4.11-auto* yum --installroot=$INSTDIR install rtems-4.11-powerpc*
An example from 11/21/2012:
Following the YUM instructions, added
-nodeps
. Note that this installs in/opt/rtems-4.11
:sudo -s rpm -ivh --nodeps http://www.rtems.org/ftp/pub/rtems/linux/4.11/redhat/el6/x86_64/rtems-4.11-yum-conf-0.20120907.1-1.el6.noarch.rpm rpm --import http://www.rtems.org/ftp/pub/rtems/linux/gpg-pubkey-69ce4a83-44cc2b30 yum search rtems yum install rtems-4.11-auto* yum install rtems-4.11-powerpc-*
- If
yum
says there's "Nothing to do
", do 'yum list rtems-4.11-yum-conf.noarch
'. If that returns more than one item, do 'yum erase rtems-4.11-yum-conf.noarch
' and redo the above. Perhaps this could be avoided by adding--force
to therpm
install of theyum-conf
file above. Found that installing the
powerpc
stuff failed because of missing dependency onlibmpc.so.2()(64bit)
. Found it hereusing google:yum install ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64/libmpc-0.8-3.el6.x86_64.rpm
'
yum install rtems-4.11-powerpc-*
' then succeeded.
When your systems don't have external network access: example from 2013-05-07
These instructions are for installing on the group disks which are hosted on rdsrv101. The packages cannot be installed here through an NFS mount from another machine since the disks are specifically mounted without full root access. Thus, the two step process: download on one machine and install on another.
On a machine with external access download the following rpms using wget and place them on an accessable disk
http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-arm-rtemseabi4.11-binutils-2.23.2-2.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-arm-rtemseabi4.11-gcc-4.7.2-3.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-arm-rtemseabi4.11-gcc-c++-4.7.2-3.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-arm-rtemseabi4.11-gcc-libgcc-4.7.2-3.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-arm-rtemseabi4.11-gcc-libstdc++-4.7.2-3.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-arm-rtemseabi4.11-gdb-7.6-1.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-arm-rtemseabi4.11-newlib-1.20.0-19.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-autoconf-2.69-6.el5.noarch http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-automake-1.12.6-1.el5.noarch http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-binutils-common-2.23.2-2.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-gcc-common-4.8.0-3.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-gdb-common-7.6-1.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-newlib-common-1.20.0-24.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-powerpc-rtems4.11-binutils-2.23.2-2.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-powerpc-rtems4.11-gcc-4.8.0-2.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-powerpc-rtems4.11-gcc-c++-4.8.0-2.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-powerpc-rtems4.11-gcc-libgcc-4.8.0-2.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-powerpc-rtems4.11-gcc-libstdc++-4.8.0-2.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-powerpc-rtems4.11-gdb-7.6-1.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-powerpc-rtems4.11-newlib-1.20.0-23.el5.x86_64 http://rtems.org/ftp/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-release-0.20130311.0-1.el5.noarch
or use wildcards, as in:
wget ftp://rtems.org/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-arm-rtems4.11* wget ftp://rtems.org/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-powerpc-rtems4.11* wget ftp://rtems.org/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-auto* wget ftp://rtems.org/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-binutils* wget ftp://rtems.org/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-gcc* wget ftp://rtems.org/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-gdb* wget ftp://rtems.org/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-newlib* wget ftp://rtems.org/pub/rtems/linux/4.11/redhat/el5/x86_64/rtems-4.11-release*
- Log in to the NFS host (rdsrv101) and create a new installation directory under
/u1/reg/package/gnu
. Don't try to write over one that is already there as this will affect other users. - Temporarily create the
rtems-4.11
softlink in/opt
pointing to this new directory. Rename the previous one if a link is already there. This will affect users on the NFS host you're working, but will not affect users on other nodes in the cluster. As root, install the RPMs with
rpm --nodeps -ivh rtems-4.11-*.rpm
- The
--nodeps
option is required due to a perl dependency from automake that doesn't seem to be easily worked around. - After installation and testing, delete the temporary soft-link you created in
/opt
above an rename the previous link back to the original. In other words,/opt/rtems-4.11
should point to/u1/reg/package/gnu/rtems-4.11
. - Change the soft-link
/u1/reg/package/gnu/rtems-4.11
to point to the new installation directory created in the second step above.
Building the RTEMS GNU tools from sources
This is based on a recipe for Ubuntu found here.
When installing into a privileged directory, be sure to do sudo make install
below instead of make install
. For our purposes, this is not necessary.
Create or select a root directory and
cd
to it:mkdir tools cd tools
Create a text file (e.g.,
gnuTools.lis
) and enter all the tool file names into it. An example is:gnuTools.lisautoconf-2.68.tar.bz2 automake-1.11.1.tar.bz2 binutils-2.20.1.tar.bz2 gcc-core-4.4.5-rtems4.10-20101003.diff gcc-core-4.4.5.tar.bz2 gcc-g++-4.4.5.tar.bz2 gdb-7.1-rtems4.10-20100812.diff gdb-7.1.tar.bz2 gmp-4.3.2.tar.bz2 mpc-0.8.1.tar.gz mpfr-2.4.2.tar.bz2 help2man-1.36.4.tar.gz newlib-1.18.0-rtems4.10-20110114.diff newlib-1.18.0.tar.gz rtems-4.10-repo-conf-0.22.tar.bz2 rtems-4.10-repo-conf-0.20101202.1.tar.bz2 rtems-4.10-repo-conf-0.20101202.1.tar.xz
- The sources are at http://www.rtems.org/ftp/pub/rtems/SOURCES/4.10/.
- It may be easier to copy and paste the whole page into e.g.,
emacs
and then delete what you don't want (e.g. search for <tab> and delete everything after it). - Note the dates and pick up any patches (
.diff
files) that might be relevant. It appears that the patches are cumulative, so only the most recent.diff
files are needed. - Consider avoiding release candidates (
RC
in the name).
Create a working directory and
cd
to it:cd .. mkdir archive cd archive
Download the archives and/or patch files:
wget --base http://www.rtems.org/ftp/pub/rtems/SOURCES/4.10/ -i ../tools/gnuTools.lis
- Ensure that your path variables are clean. In particular, make sure that
.
is not in yourPATH
. Define an environment variable pointing to where the packages will be installed:
export GNU_DIR=/u1/reg/package/gnu cd ../tools
Build
autoconf
:tar xjf archive/autoconf-2.68.tar.bz2 mkdir b-autoconf cd b-autoconf/ ../autoconf-2.68/configure --prefix=$GNU_DIR/autoconf-2.68 make all make info make install cd .. rm -rf b-autoconf/
Add
autoconf
to the path in front of any otherautoconf
:export PATH=$GNU_DIR/autoconf-2.68/bin:$PATH
Build
automake
:tar xjf archive/automake-1.11.1.tar.bz2 mkdir b-automake cd b-automake/ ../automake-1.11.1/configure --prefix=$GNU_DIR/automake-1.11 make all make info make install cd .. rm -rf b-automake/
Add
automake
to the path in front of any otherautomake
:export PATH=$GNU_DIR/automake-1.11/bin:$PATH
Unpack the tools:
tar xjf archive/binutils-2.20.1.tar.bz2 tar xjf archive/gcc-core-4.4.5.tar.bz2 tar xjf archive/gcc-g++-4.4.5.tar.bz2 tar xzf archive/newlib-1.18.0.tar.gz tar xjf archive/gdb-7.1.tar.bz2 tar xjf archive/gmp-4.3.2.tar.bz2 tar xzf archive/mpc-0.8.1.tar.gz tar xjf archive/mpfr-2.4.2.tar.bz2
Apply patches:
cd gdb-7.2/ cat ../archive/gdb-7.1-rtems4.10-20100812.diff | patch -p1 --dry-run cat ../archive/gdb-7.1-rtems4.10-20100812.diff | patch -p1 cd ../gcc-4.5.1/ cat ../archive/gcc-core-4.4.5-rtems4.10-20101003.diff | patch -p1 --dry-run cat ../archive/gcc-core-4.4.5-rtems4.10-20101003.diff | patch -p1 cd ../newlib-1.18.0/ cat ../archive/newlib-1.18.0-rtems4.10-20110114.diff | patch -p1 --dry-run cat ../archive/newlib-1.18.0-rtems4.10-20110114.diff | patch -p1 cd ..
Get the
gdbstub
and apply its patch togdb
(note the different gdb version here! There wasn't agdb-7.2
gdbstub
patch at the time of this writing.):cp -r /afs/slac/package/rtems/4.9.4/src/ssrlApps_p3/rtems-gdb-stub/ gdbstub-1.5 cd ../gdb-7.1 cat ../gdbstub-1.5/gdb-7.1-20100325.diff | patch -p1 --dry-run cat ../gdbstub-1.5/gdb-7.1-20100325.diff | patch -p1 cd ..
- See gdb-stub about building and installing it.
Build binutils:
mkdir b-binutils cd b-binutils ../binutils-2.21/configure --target=powerpc-rtems4.10 --prefix=$GNU_DIR/rtems-4.10 make all make info make install cd .. rm -rf b-binutils
Add the just-built executables to the paths:
export PATH=${GNU_DIR}/rtems-4.10/bin:$PATH export LD_LIBRARY_PATH=${GNU_DIR}/rtems-4.10/lib:$LD_LIBRARY_PATH
Build gcc. The
make all
takes some time:cd gcc-4.4.5/ ln -s ../newlib-1.18.0/newlib . ln -s ../gmp-4.3.2 ./gmp ln -s ../mpc-0.8.1 ./mpc ln -s ../mpfr-2.4.2 ./mpfr cd .. mkdir b-gcc cd b-gcc/ ../gcc-4.4.5/configure --target=powerpc-rtems4.10 --with-gnu-as --with-gnu-ld --with-newlib --verbose --enable-threads --enable-languages="c,c++" --prefix=$GNU_DIR/rtems-4.10 make all make info make install cd .. rm -rf b-gcc
Build gdb. The
make all
takes some time:cd gdb-7.1/ ln -s ../newlib-1.18.0/newlib . ln -s ../gmp-4.3.2 ./gmp ln -s ../mpc-0.8.1 ./mpc ln -s ../mpfr-2.4.2 ./mpfr cd .. mkdir b-gdb cd b-gdb ../gdb-7.1/configure --target=powerpc-rtems4.10 --enable-sim --enable-sim-powerpc --enable-sim-timebase --enable-sim-hardware --prefix=$GNU_DIR/rtems-4.10 make all make info make install cd .. rm -rf b-gdb
Steps to install the RTEMS OS
Download RTEMS from the www.rtems.com
code repository
- See the RTEMS CVS Repository page (obsolete)
- See the RTEMS GIT Repository page
Download RTEMS from the web
- This can be done when the version of interest is prebuilt:
From a DEV machine:
cd <archive_dir> wget http://www.rtems.org/ftp/pub/rtems/4.10.2/rtems-4.10.2.tar.bz2
- If the version of interest is not available prebuilt, go here to get it from the RTEMS
git
repository. - Obsolete instructions: navigate to here -> Main Page -> RTEMS Release Series -> Build Results Summary Table -> POWERPC-> <date> in POWERPC-VIRTEX table
This downloads a file like rtems-cvs-20101008.tar.bz2. Place it in an
archive
directory off of your working directory:mv <download dir>/*.bz2 <archive_dir>/
<download dir> is typically in your home path, e.g.
~/dat/package
Unpack the file into the installation directory (
$RTEMS_ROOT
), e.g./afs/slac/g/cci/package/rtems/4.10.2
:export RTEMS_ROOT=/afs/slac/g/cci/package/rtems/4.10.2 mkdir $RTEMS_ROOT cd $RTEMS_ROOT tar xjf <archive_dir>/rtems-4.10.2.tar.bz2
- This will result in a directory like
${RTEMS_ROOT}/rtems-4.10.2
Build and install RTEMS
Place the source directory in an appropriate spot and create some links to it
ln -s rtems-4.10.2 src ln -s rtems-4.10.2 RTEMS
- There are additional instructions at Quick Start but distribution probably contains more up-to-date instructions
- See the release notes
- See
${RTEMS_ROOT}/src/README
- See
${RTEMS_ROOT}/src/INSTALL
- See
${RTEMS_ROOT}/src/README.configure
- Apply patches. Some may fail because the target files have changed.
- In order to support Gen 1 RCEs, a DHCP patch by Matt Weaver must be applied. It is in
$\SVNROOT}/rtems/patches/dhcp.diff
. The affected files are${RTEMS_ROOT}/src/cpukit/libnetworking/rtems/dhcp.h
andrtems_dhcp.c
. - In order to support Virtex 5 chips, apply the patches in
${SVNROOT}/rtems/patches/ppc440.diff
- Apply the patch in
${RTEMS_ROOT}/src/cpukit/libnetworking/rtems/bsp.diff
to update theacinclude.m4
in thepowerpc
BSP directory so that the additional BSPs are included - If any of the patches failed, they should be updated and committed to the repository
- In order to support Gen 1 RCEs, a DHCP patch by Matt Weaver must be applied. It is in
cd ${RTEMS_ROOT}/src cat ~/dat/rtems/patches/dhcp.diff | patch -p1 --dry-run cat ~/dat/rtems/patches/dhcp.diff | patch -p1 cat ~/dat/rtems/patches/ppc440.diff | patch -p1 --dry-run cat ~/dat/rtems/patches/ppc440.diff | patch -p1 cat ~/dat/rtems/patches/bsp.diff | patch -p1 --dry-run cat ~/dat/rtems/patches/bsp.diff | patch -p1
- Checkout (or update) the Virtex BSPs from the
DAT
repository (${SVNROOT}/rtems/bsp
) to${RTEMS_ROOT}/src/c/src/lib/libbsp/powerpc
Be sure that the prerequisite tools (built above) are in the appropriate paths, e.g.
export GNU_DIR=/u1/reg/package/gnu export PATH=${GNU_DIR}/autoconf-2.68/bin:$PATH export PATH=${GNU_DIR}/automake-1.11/bin:$PATH export PATH=${GNU_DIR}/rtems-4.10/bin:$PATH export LD_LIBRARY_PATH=${GNU_DIR}/rtems-4.10/lib:$LD_LIBRARY_PATH
Create the build and target installation directories.
It mightbe useful to have these on local disks for faster access, as shown here. If so, be sure to cross soft-link everything:mkdir /u1/reg/package/rtems/4.10.2/bld export TARGET_DIR=/u1/reg/package/rtems/4.10.2/tgt mkdir -p $TARGET_DIR ln -s ${RTEMS_ROOT}/RTEMS ln -s ${RTEMS_ROOT}/src cd $RTEMS_ROOT ln -s /u1/reg/package/rtems/4.10.2/bld ln -s /u1/reg/package/rtems/4.10.2/tgt cd -
You may need to override some portions of the environment. Do
configure --help
. Note that these environment variables are not additive so you need to find the original value in order to add another switch. For example, in the RTEMS 4.9 days we needed to do:export CC_FOR_HOST=gcc44 export CFLAGS_FOR_HOST="-g -O2 -std=gnu99"
Build and install RTEMS:
cd ${RTEMS_ROOT}/src ./bootstrap cd ../bld ../src/configure --target=powerpc-rtems4.10 --enable-posix --enable-networking --enable-rdbg --enable-cxx --enable-maintainer-mode --enable-rtemsbsp="virtex4 virtex5" --prefix=$TARGET_DIR make -j all make -j install cd ..
To build the documentation (or provide
--enable-docs
in theconfigure
above):cd build ../src/configure --enable-maintainer-mode --prefix=$TARGET_DIR cd tools make cd .. make info make all make install cd ..
The results can be found in
${TARGET_DIR}/share
. Also see http://www.rtems.com/onlinedocs.html.- Install the rtems-gdb-stub in the new target.
Building RTEMS BSPs
- Place the BSP in the RTEMS tree at
${RTEMS_ROOT}/src/c/src/lib/libbsp/<CPU>/<BSP>
- Not sure whether one can build a BSP outside of the RTEMS tree. It may not even make sense. If that desire exists, a private RTEMS tree may be needed.
- Ensure the PATH and LD_LIBRARY_PATH environment variables aren't polluted
Set up the appropriate environment variables
export RTEMS_ROOT=/afs/slac/g/cci/package/rtems/4.10.2 export TARGET_DIR=/u1/reg/package/rtems/4.10.2/tgt export GNU_DIR=/u1/reg/package/gnu export PATH=${GNU_DIR}/autoconf-2.68/bin:$PATH export PATH=${GNU_DIR}/automake-1.11/bin:$PATH export PATH=${GNU_DIR}/rtems-4.10/bin:$PATH export LD_LIBRARY_PATH=${GNU_DIR}/rtems-4.10/lib:$LD_LIBRARY_PATH
- Build RTEMS as above
Description file of compiler switches to be used for this BSP (still needed? May have been a 4.9 requirement.)
cd ${RTEMS_ROOT}/src/make/custom ln -s ../../c/src/lib/libbsp/powerpc/virtex4/virtex4.cfg ln -s ../../c/src/lib/libbsp/powerpc/virtex5/virtex5.cfg
Be sure that the following lines are in the list of BSPs by editing
${RTEMS_ROOT}/src/c/src/lib/libbsp/powerpc/acinclude.m4
(nominally done by the bsp.diff patch above)virtex4 ) AC_CONFIG_SUBDIRS([virtex4]);; virtex5 ) AC_CONFIG_SUBDIRS([virtex5]);;
- If some
configure
orMakefile.in
must be regenerated, i.e.,configure.ac
and/orMakefile.am
has been modified,bootstrap
must be run again. It is sufficient to run it from the level at which the change was made. There is no need to run it on the whole tree again (which is arduously slow).First clean out the previously generated files using
bootstrap -c
. This will also blow away the result of theconfigure
step, which must thus be redone. See ~claus:Build and install RTEMS.cd ${RTEMS_ROOT}/src/... ./bootstrap -c ./bootstrap cd ${RTEMS_ROOT}/bld ../src/configure --target=powerpc-rtems4.10 --enable-posix --enable-networking --enable-rdbg --enable-cxx --enable-maintainer-mode --enable-rtemsbsp="virtex4 virtex5" --prefix=$TARGET_DIR
Take care to use the correct set of build tools by specifying
--target
correctly, i.e.powerpc-rtems4.10
vspowerpc-rtems4.11
- Nominally one can give multiple instances of
--enable-rtemsbsp=
BSP to theconfigure
line, but one can apparently also give theconfigure
line multiple times with different--enable-rtemsbsp=
BSP each time. One can also do:
cd ${RTEMS_DIR}/bld make RTEMS_BSP="bsp1 bsp2 ..." all
Building add-on packages
There are several add-on packages located at the RTEMS git website, such as network-demos
. These can be built as follows:
git clone git://git.rtems.org/network-demo.git network-demo cd network-demo git checkout -b ric-head HEAD export RTEMS_MAKEFILE_PATH=/u1/reg/users/claus/dat/package/rtems/4.11.0/tgt/arm-rtemseabi4.11/zc702/ make -j
Installing the RTEMS tools using the Source Builder
A good general set of instructions written by the Source Builder author Chris Johns can be found here. What follows is an account of what happened when I tried to follow these instructions as they were in July of 2013. I used a RHEL5 system. See also here for the experiences of a blogger calling himself "AlanC".
Setup
mkdir -p /u1/tether/source-builder/rtems/src
cd /u1/tether/source-builder/rtems/src
git clone git://git.rtems.org/rtems-source-builder.git
cd rtems-source-builder
Checking the environment
source-builder/sb-check
The RHEL5 environment passed checks with one warning: the git tool is in /usr/bin and apparently Source Builder expected to find it somewhere else (/bin ?).
Making build sets
First I asked for a list of the build sets that were available:
../source-builder/sb-set-builder --list-bsets
RTEMS Source Builder - Set Builder, v0.2.0
warning: exe: absolute exe found in path: (__git) /usr/bin/git
Examining: config
Examining: ../source-builder/config
Examining: ../bare/config
...
4.11/rtems-all.bset
4.11/rtems-arm.bset
4.11/rtems-autotools.bset
4.11/rtems-avr.bset
4.11/rtems-bfin.bset
4.11/rtems-h8300.bset
4.11/rtems-i386.bset
4.11/rtems-lm32.bset
4.11/rtems-m32c.bset
4.11/rtems-m32r.bset
4.11/rtems-m68k.bset
4.11/rtems-microblaze.bset
4.11/rtems-mips.bset
4.11/rtems-moxie.bset
4.11/rtems-nios2.bset
4.11/rtems-powerpc.bset
4.11/rtems-sh.bset
4.11/rtems-sparc.bset
4.11/rtems-sparc64.bset
...
rtems-4.11-base.bset
...
rtems-base.bset
...
I've omitted output not related to RTEMS 4.11. I decided to build 4.11/rtems-arm.bset.
../source-builder/sb-set-builder --log=l-arm.txt --prefix=/u1/tether/source-builder/rtems/4.11 4.11/rtems-arm.bset
RTEMS Source Builder - Set Builder, v0.2.0
warning: exe: absolute exe found in path: (__git) /usr/bin/git
Build Set: 4.11/rtems-arm.bset
config: devel/expat-2.1.0-1.cfg
package: expat-2.1.0-x86_64-linux-gnu-1
Creating source directory: sources
download: http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz -> sources/expat-2.1.0.tar.gz
building: expat-2.1.0-x86_64-linux-gnu-1
config: tools/rtems-binutils-2.23.2-1.cfg
package: arm-rtems4.11-binutils-2.23.2-1
download: ftp://ftp.gnu.org/gnu/binutils/binutils-2.23.2.tar.bz2 -> sources/binutils-2.23.2.tar.bz2
building: arm-rtems4.11-binutils-2.23.2-1
config: tools/rtems-gcc-4.8.1-newlib-cvs-1.cfg
package: arm-rtems4.11-gcc-4.8.1-newlib-31-May-2013-1
download: ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.1/gcc-4.8.1.tar.bz2 -> sources/gcc-4.8.1.tar.bz2
Creating source directory: sources/cvs
Creating source directory: sources/cvs/anoncvs_sourceware_org_cvs_src_newlib_31_May_2013
cvs: checkout: cvs://pserver:anoncvs@sourceware.org/cvs/src -> sources/cvs/anoncvs_sourceware_org_cvs_src_newlib_31_May_2013
cvs: reset: cvs://pserver:anoncvs@sourceware.org/cvs/src
Creating source directory: patches
download: http://git.rtems.org/rtems-tools/plain/tools/4.11/newlib/newlib-sys-signal-20130532.diff -> patches/newlib-sys-signal-20130532.diff
download: http://www.mpfr.org/mpfr-3.0.1/mpfr-3.0.1.tar.bz2 -> sources/mpfr-3.0.1.tar.bz2
download: http://www.multiprecision.org/mpc/download/mpc-0.8.2.tar.gz -> sources/mpc-0.8.2.tar.gz
download: ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.5.tar.bz2 -> sources/gmp-5.0.5.tar.bz2
building: arm-rtems4.11-gcc-4.8.1-newlib-31-May-2013-1
config: tools/rtems-gdb-7.6-1.cfg
package: arm-rtems4.11-gdb-7.6-1
download: http://ftp.gnu.org/gnu/gdb/gdb-7.6.tar.bz2 -> sources/gdb-7.6.tar.bz2
building: arm-rtems4.11-gdb-7.6-1
config: tools/rtems-kernel-4.11.cfg
Build Set: Time 2:17:55.375422
error: config error: rtems-kernel-4.11.cfg:15: Autoconf version 2.69 or higher is needed.
Build FAILED
3015.002u 12276.952s 2:17:57.70 184.7% 0+0k 0+0io 912pf+0w
The build of rtems-autotools failed for two reasons:
- I needed the autoconf built by rtems-autotools.bset in order to build the automake built by the same bset.
- Source Builder doesn't make the final installation of a bset's packages, under the directory named by --prefix on the sb-set-builder command line, until all the packages of the bset have been built.
Therefore with autoconf and automake both being built by rtems-autotools.bset, the build of automake failed because the newly made autoconf is not on the current PATH and the system autoconf is too old. Putting autoconf and automake in separate bsets solved this problem. After doing that I was able to build the ARM tool chain, which took about 2 hours and 18 minutes on my dual-core 2.8 GHz Xeon.
Chris John's has since fixed the problems with autotools but I haven't had a chance to make a test.