RI builds are currently only supported under Cygwin on Windows 7 and Windows XP.
Cygwin
The RI build environment requires many standard Unix tools such as make, gcc, and pkgconfig. We have selected Cygwin to provide our Unix environment and tools. However, we do not want to develop binaries that are dependent on the Cygwin DLL, so all of our targets are compiled to MinGW using Win32 libraries provided by the Cygwin installation program. The Cygwin version of GCC supports compilation of MinGW binaries through the use of the -mno-cygwin compiler option.
Required Cygwin Packages
The following table describes the minimum set of packages that must be installed in your Cygwin environment in order to compile the RI Stack and RI Platform projects. You can download the Cygwin installer from http://ri.opencable.com/support/cygwin-minimal-20120803.zip.
Package Name | Category | Description | Known Working Version | Required for |
---|---|---|---|---|
unzip | Archive | Info-ZIP decompression utility | 6.0-10 | compilation |
zip | Archive | Info-ZIP compression utility | 3.0-11 | compilation |
binutils | Devel | The GNU assembler, linker and binary utilities | 2.20.51-2 | compilation |
bison | Devel | A parser generator that is compatible with YACC | 2.4.2-1 | 3rd party library compilation |
doxygen | Devel | A documentation system for C++, C, Java, Objective-C, IDL (Corba and Microsoft flavors) and to some extent PHP, C#, and D. | 1.6.1-2 | 3rd party library compilation |
flex | Devel | A fast lexical analyzer generator | 2.5.35-1 | 3rd party library compilation |
gcc-core | Devel | C Compiler | 3.4.4-999 | compilation |
gcc4-core | Devel | Core C compiler subpackage | 4.3.4-3 | ATE Emulator |
gcc-g++ | Devel | C++ Compiler | 3.4.4-999 | compilation |
gcc-mingw-core | Devel | Mingw32 support headers and libraries for GCC | 20050522-1 | compilation |
gcc-mingw-g++ | Devel | Mingw32 support headers and libraries for GCC C++ | 20050522-1 | compilation |
gdb | Devel | The GNU Debugger | 6.8-2 | debugging |
make | Devel | The GNU version of the 'make' utility | 3.81-2 | compilation |
mingw-runtime | Devel | MinGW Runtime | 3.18-1 | compilation |
pkg-config | Devel | A utility used to retrieve information about installed libraries | 0.23b-1 | 3rd party library compilation |
subversion | Devel | A version control system | 1.6.12-1 |
|
nano | Editors | A pico clone text editor with extensions | 2.0.9-1 |
|
vim | Editors | Vi IMproved - enhanced vi editor | 7.2.264-2 |
|
gawk | Interpreters | GNU awk, a pattern scanning and processing language | 3.1.8-1 | 3rd party library compilation |
libxml2 | Interpreters | XML C parser and toolkit (runtime and applications) | 2.7.7-1 | ATE Emulator |
libxslt | Interpreters | The GNOME XSLT C library (runtime) | 1.1.26-2 | ATE Emulator |
perl | Interpreters | Larry Wall's Practical Extracting and Report Language | 5.10.1-3 | ATE Emulator |
python | Interpreters | Python language interpreter | 2.6.5-2 | ATE Emulator |
inetutils | Net | Common networking clients and servers | 1.7-1 | ATE Emulator |
openssh | Net | The OpenSSH server and client programs | 5.5p1-2 |
|
openssl | Net | The OpenSSL runtime environment | 0.9.8o-2 | ATE Emulator |
rxvt | Shells | VT102 terminal emulator for both X and Windows | 20050409-21 |
|
psmisc | System | Utilities for managing processes on your system | 21.5-3 |
|
diffutils | Utils | A GNU collection of diff utilities | 2.9-1 |
|
file | Utils | Determines file type using 'magic' numbers | 5.04-1 |
|
util-linux | Utils | Random collection of Linux utilities | 2.17.2-1 |
|
patch | Utils | Apply a diff file to an original | 2.5.8-9 | compilation |
curl | Web | Multi-protocol file transfer command-line tool | 7.20.1-1 |
|
wget | Web | Utility to retrieve files from the WWW via HTTP and FTP | 1.12-1 |
|
Installing a pre-downloaded version of Cygwin
If you are having problems compiling the RI Stack or RI Platform with your own Cygwin installation, you may wish to start from a known working version. The following steps will take you through the process of installing Cygwin from a pre-downloaded fileset. It is recommended that you completely remove any pre-existing Cygwin installation before continuing.
1) Download the Cygwin Minimal Install zip from http://ri.opencable.com/support/cygwin-minimal-20120803.zip and unzip
2) Run the Cygwin installation program (setup.exe).
3) Select 'Install from Local Directory'.
4) Select the location where Cygwin will be installed.
5) Provide the location of the installation files. Should be the root directory from the extracted zip file.
6) The installation program will parse the included configuration files. Depending on the speed of your machine, it make take some time.
7) Finally, you must tell the Cygwin installer to install all packages provided in the file set. Click the indicated text until all packages show the word Install.
8) Click Next to complete the installation. Installation progress indicator will appear.
9) Once completed, click Finish to finalize the installation.
Home Directory
It is highly recommended that you do not store any project-specific or personal files in the Cygwin directory hierarchy (i.e. C:/Cygwin). This makes it much easier to modify, or even wipeout and re-install, your Cygwin installation. One important step in achieving this indepedence is to make sure that your HOME directory is not in the default Cygwin location (<cygwin_root>/home/<username>). Many Cygwin tools/program/utilities use your home directory as a location for initialization files. You can set the HOME Windows environment variable to point to a directory outside of Cygwin that will be your home. Cygwin will inherit this variable from Windows as use it as your home directory location.
Other Cygwin Issues
Process Crashes in Cygwin
If you are noticing that the RI platform seems to automatically restart whenever there is a software crash, set the following environment variable:
export CYGWIN=proc_retry:1
See this page for a description of all CYGWIN environment variable options. This only applies to situations in which you are starting the RI Platform from a Cygwin terminal command line.
Cygwin Terminal
Cygwin provides another terminal program as an option to its default terminal. This new terminal is called RXVT and it is already included in the minimal installation package.
RXVT is highly configurable and much more full-featured than the standard Cygwin terminal. For those familiar with XTerms on a standard Unix machine, it has excellent support for cut-paste of text in the terminal and much more.
To run, RXVT you must create a Windows shortcut to rxvt.exe installed in <cygwinroot>/bin. In the shortcut properties, modify the Target field to supply command line arguments to RXVT -- including the final argument which is the shell you wish to start. Here is an example command line:
C:\cygwin\bin\rxvt.exe -sl 500 -bg black -fg white -sr -title "My Bash" -e c:\cygwin\bin\bash.exe --login -i
You can see a list of available command line arguments with:
rxvt -help
You also configure RXVT using an X resources file in your home directory called .Xdefaults. To see a list of available resources:
rxvt --help
You can find the RXVT readme in /usr/share/doc/Cygwin/rxvt-20050409.README. Additionally, here are some helpful links:
Updating your Cygwin Installation
There is a handy utility, similar to Fedora's yum and Debian's apt-get programs that can be used to update any part of an existing Cygwin installation. It is called apt-cyg and can be installed by issuing the following commands:
# svn --force export [http://apt-cyg.googlecode.com/svn/trunk/] /bin/ # chmod +x /bin/apt-cyg
Once installed, the following command are available:
apt-cyg: Installs and removes Cygwin packages. "apt-cyg install <package names>" to install packages "apt-cyg remove <package names>" to remove packages "apt-cyg update" to update setup.ini "apt-cyg show" to show installed packages "apt-cyg find <patterns>" to find packages matching patterns "apt-cyg describe <patterns>" to describe packages matching patterns "apt-cyg packageof <commands or files>" to locate parent packages Options: --mirror, -m <url> : set mirror --cache, -c <dir> : set cache --file, -f <file> : read package names from file --noupdate, -u : don't update setup.ini from mirror --help --version
Windows Build Tools
The following build tools must also be installed on your development machine. Each tool is attached to this Wiki page for your convenience. It is recommended that all of these tools be installed to directory locations on your local machine that DO NOT contain spaces
For each of these tools ensure that tool's 'bin' directory is added to your local PATH environment variable so that Cygwin and our build scripts will be able to find them. Under Cygwin, you can use the /cygdrive drive designation path root for all PATH entries.
- J2SE JDK 6 Update 20
- Ant Build System – Ant 1.8.1
Example Shell Login Script
Shown here is an example of a bash login script that establishes all environment variable required for both the RI Stack and RI Platform projects:
Note the use of forward slashes in all path-related environment variables. Also note the use of c:/ as the drive designator for all variables except for PATH
############################################################## # Common definitions ############################################################## export RICOMMONROOT=c:/CableLabsRI/Subversion/common ############################################################## # Env variables required for building the RI Platform # # Notice the use of "forward slashes" in all paths. This is # required for the Cygwin build system. ############################################################## # The directory root of the RI platform source tree export PLATFORMROOT=c:/CableLabsRI/Subversion/ri/RI_Platform # Identifies the host development platform. See $PLATFORMROOT/hostconfig export PLATFORMHOST=Win32-Cygwin # Platform build target export PLATFORMTC=Win32/debug ############################################################## # Env variables required for building the OCAP Stack and JVM # # Notice the use of "forward slashes" in all paths. This is # required for the Cygwin build system. ############################################################## # The root of the stack source tree export OCAPROOT=c:/CableLabsRI/Subversion/ri/RI_Stack # Identifies the host development platform. See $OCAPROOT/hostconfig export OCAPHOST=$PLATFORMHOST # Stack build target export OCAPTC=CableLabs/simulator/$PLATFORMTC # Ant and Java Home directories export JAVA_HOME=c:/Java/jdk1.6.0_20 export ANT_HOME=c:/apache-ant-1.8.1 # Add Java, Ant, and Doxygen bin directories to the path. Notice the use of # Cygwin drive designations instead of Windows export PATH=$PATH:/cygdrive/c/apache-ant-1.8.1/bin:/cygdrive/c/Java/jdk1.6.0_20/bin # Optional: set-up for the Manufacturers Environment export MFGROOT=c:/CableLabsRI/Subversion/MfgEnv export MFGTC=Win32/debug
If you get any "-bash: $'\r': command not found" or ": path not found" errors, then your script above most likely has dos style line endings. Run the following command to convert it into unix line endings
dos2unix SCRIPTNAME
$PLATFORMROOT and other environments variables should be in the C:/... format. If they are in some other format which does point to the right directories but without using the C:/ format, RI_Platform and RI_Stack does get built correctly but libplatform.dll has a problem while loading.
Example Build Log
Here is an example of a successful "make clean purge build" of the RI Platform. You can use this to compare against a failed build to help debug build/environment problems.
Selecting a User Interface Target
On the Windows platform, there are currently two user interface targets:
- Native Win32 Windows
- wxWidgets Windows (default)
To build the native Win32 Windows UI target, uncomment the line
UI_TARGET = Win32
in the target/Win32/debug/defs.mk file. To build for the cross-platform wxWidgets UI target, uncomment the line
UI_TARGET = wxWidgets
in the target/Win32/debug/defs.mk file. Make sure that the target you are NOT interested in is also commented out.