GSG: Rebuilding the Software

From Texas Instruments Wiki
Jump to: navigation, search

^ Up to main OMAP35x Graphics SDK Getting Started Guide Table of Contents

This chapter describes to how rebuild various components within the OMAP35x Graphics SDK package

Setting up the NFS target file system

Perform the following steps to build and export the NFS target file system.

  1. Log in with a user account on the host Linux workstation. (In the following steps, we refer to the home user directory as "~".)
  2. Perform the following commands to prepare a location for the OMAP35x EVM target file system.
    host $ cd ~
    host $ mkdir -p workdir/filesys
    host $ cd workdir/filesys
  3. Switch user to "root" on the host Linux workstation.
    host $ su 
    password:

    There will be a prompt for entering the password as shown above. Type the root password, for getting the root permissions

  4. Copy the OMAP35x PSP SDK NFS target file system from /home/<useracct>/OMAP35x-PSP-SDK-##.##.##.##/images/fs/nfs.tar.gz to a new directory created in step 2. Perform the following commands. NOTE:Un-tar the file with root permissions. (Step 3)
    $ cp /home/<user_account>/OMAP35x-PSP-SDK-##.##.##.##/images/fs/nfs.tar.gz .
    $ tar –xvzf nfs.tar.gz .
  5. Perform the following command to make sure you can write into the target file system that you want to export as NFS, from your user account.
    host $ chown -R <user_account> /home/<user_account>/workdir/filesys/.
    host $ chmod -R 755 /home/<user_account>/workdir/filesys/.
  6. Make sure the NFS server is configured and functioning properly. Add the following line to the /etc/exports file of the server. Ensure you have root permission before editing this file.
    /home/<user_account>/workdir/filesys 	(rw,insecure,sync,no_wdelay,no_root_squash)
  7. Then issue the following command to notify the NFS server about the new exported directory.
    host $ /usr/sbin/exportfs –a
    host $ /sbin/service nfs restart
  8. Make sure you exit from having the root permissions after completing all the above steps
    host $ exit
  9. Perform steps 1 to 3 as mentioned in Building the OMAP35x Graphics Demo Software. Make sure to set the TARGETFS_INSTALL_DIR to point to the NFS target file system folder (/home/<user_account>/workdir/filesys) as created in this section, in the Rules.make file
  10. The ‘make install’ will install all the necessary libraries and executables required for running the Graphics SDK demos as well as application development using the graphics drivers.


Rebuilding u-boot and Linux Kernel

Ensure that the toolchain setup and install has been completed as mentioned in OMAP35x Graphics SDK GSG: Installing the Toolchain

Refer OMAP35x DVEVM Getting Started Guide: Rebuilding_U-boot for rebuilding u-boot

Refer OMAP35x DVEVM Getting Started Guide: Rebuilding the Linux Kernel for rebuilding the linux kernel

NOTE: Use arm-2007q3-51 version for building all the components

Building the OMAP35x Graphics Demo Software

This section describes how to rebuild OMAP35x Graphics SDK demos.

Pre-Requisites:

  1. Ensure that toolchain installation is complete
  2. Ensure that the NFS target is setup
  3. Ensure that the setup and build for u-boot is complete
  4. Ensure that the setup and build for Linux Kernel is complete

Refer here for more information to perform the above steps

To rebuild the OMAP35x Graphics SDK demos, perform the following steps.

  1. Change the directory to ~/OMAP35x_Graphics_SDK_#_##_##_##.
  2. Edit the ~/OMAP35x_Graphics_SDK_#_##_##_##/Rules.make file.
    • Set GRAPHICS_INSTALL_DIR to the top-level OMAP35x graphics installation directory as follows
    HOME=/home/<user_account>
    GRAPHICS_INSTALL_DIR=${HOME}/OMAP35x_Graphics_SDK_#_##_##_##
    • Set the toolchain installation directory path to where you have installed the CodeSourcery tool-chain
    CSTOOL_DIR = <your_toochain_installation_path> 
    
    For example, in our case
    CSTOOL_DIR = /home/<user_account>/toolchain/arm-2007q3
    • Set the kernel installation directory path
    KERNEL_INSTALL_DIR = <your_kernel_installation_directory_path>
    
    For example, in our case
    KERNEL_INSTALL_DIR = /home/<user_account>/workdir/opt/linux-##.##.##.##
    • Modify the TARGETFS_INSTALL_DIR to point to the correct location where the user’s target file system resides
    TARGETFS_INSTALL_DIR=/home/<user_account>/workdir/filesys
  3. While in the same directory that contains Rules.make, use the following commands to build the OMAP35x Graphics SDK demo applications

    The top level Graphics SDK Makefile supports the OMAP35x Graphics SDK demos to be built for both debug and release options for OMAP ES2.x and ES3.x silicon versions. Execute the following command for usage options
    host $ make help

    This will print the usage as follows:

    Usage: make BUILD=<options> OMAPES=<options>
    Default build is for silicon version ES3.x and release build
    Usage for ES2.x debug Build: make OMAPES=2.x BUILD=debug
    Usage for ES2.x release Build: make OMAPES=2.x BUILD=release
    Usage for ES3.x debug Build: make OMAPES=3.x BUILD=debug
    Alternative usage for ES3.x release Build: make OMAPES=3.x BUILD=release

    Check for the OMAP3 silicon version on your EVM board and based on whether it is v2.x or v3.x, execute the appropriate command as given below. By default "make all" will build the Graphics SDK Demos for OMAP ES v3.x and in Release Mode

    If your EVM supports OMAP3 ES 3.x, execute one of the following commands to build the Graphics SDK Demos in release Mode

    Either
    host $ make all
    or
    host $ make all OMAPES=3.x BUILD=release

    If your EVM supports OMAP3 ES 3.x, execute the following command to build the Graphics SDK Demos in Debug Mode

    host $ make all OMAPES=3.x BUILD=debug

    If your EVM supports OMAP3 ES 2.x, execute the following command to build the Graphics SDK Demos in Release Mode

    host $ make all OMAPES=2.x BUILD=release

    If your EVM supports OMAP3 ES 2.x, execute the following command to build the Graphics SDK Demos in Debug Mode

    host $ make all OMAPES=2.x BUILD=debug

    NOTE 1: The above command will build the following Graphics SDK components

    • Graphics SGX Kernel Modules.
      • This requires the kernel to be installed as per the steps mentioned here as well setting the variables correctly in Rules.make file as mentioned in step 2
    • Graphics SDK Demos - OGLES1.x and OGLES2.x


    NOTE 2:This MAKEFILE does not have rules to rebuild the OMAP35x Graphics Sample Applications and the Training Material examples.

Installing the NFS Target File System with Graphics SDK Demos

The necessary executables and libraries required for running graphics SDK demos as well as for developing applications on top of graphics SDK can be installed to the NFS target file system using the following steps.

Pre-Requisites

  • Ensure NFS target is setup as described here
  • Ensure OMAP35x Graphics SDK demos are built as described here

To install the Graphics SDK demos, SGX user libraries, kernel modules and generated support files on the target file system specified by EXEC_DIR, execute the following command

host $ make install

Rebuilding the Graphics SGX Kernel Modules

Perform the following steps to build the graphics SGX kernel modules with the TI PSP SDK Kernel Release.

Perform steps 1 and 2 as mentioned in Building the OMAP35x Graphics Demo Software.


Navigate to the installed Graphics SDK folder

host $ cd /home/user_account/OMAP35x_Graphics_SDK_#_##_##_##


Check for the OMAP3 silicon version on your EVM board and based on whether it is v2.x or v3.x, execute the appropriate command as given below.

If your EVM supports OMAP3 ES 3.x, execute one of the following commands to build the Graphics SGX kernel modules in release mode

Either
host $ make buildkernel
or
host $ make buildkernel OMAPES=3.x BUILD=release

If your EVM supports OMAP3 ES 3.x, execute the following command to build the Graphics SGX kernel modules in debug mode

host $ make buildkernel OMAPES=3.x BUILD=debug

If your EVM supports OMAP3 ES 2.x, execute the following command to build the Graphics SGX kernel modules in release mode

host $ make buildkernel OMAPES=2.x BUILD=release

If your EVM supports OMAP3 ES 2.x, execute the following command to build the Graphics SGX kernel modules in debug mode

host $ make buildkernel OMAPES=2.x BUILD=debug

NOTE: Rebuilding the SGX kernel modules will replace the default pre-built kernel modules with the latest re-built kernel modules under the gfx_rel, gfx_dbg, gfx_rel_es2.x or gfx_dbg_es2.x folders depending on the type of command execution as mentioned above in this section.

Building and Executing Your Own Demos

This section describes the steps required to build user implemented demonstrations.

  1. Place your demos in the same directory format as default graphics SDK demos
  2. Copy the release or debug versions of the shared and static libraries from the appropriate gfx_rel, gfx_dbg, gfx_rel_es2.x or gfx_dbg_es2.x folders to the OpenGL demo locations as shown below In case of OpenGL ES1.x demos, perform the following steps
    host $ mkdir -p /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/lib 
    host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfx_rel/*.so  /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/lib
    host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfx_rel/*.a  /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/lib
    

    In case of OpenGL ES2.x demos, perform the following steps

    host $ mkdir -p /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES/LinuxOMAP3/lib 
    host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfx_rel/*.so  /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES/LinuxOMAP3/lib
    host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfx_rel/*.a  /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES/LinuxOMAP3/lib
    

    Perform similar steps as above for OpenVG demos as well.

  3. Set the following environment variables
    • Ensure that the ARM toolchain path is included in the PATH variable
    host $ export PATH=/home/<user_account>/toolchain/arm-2007q3/bin:$PATH 
    • Set the PLATFORM environment variable to LinuxOMAP3
    host $ export PLATFORM = LinuxOMAP3
    • Set the LIBDIR environment variable to the path where the graphics driver libraries are copied.

    For OpenGL ES1.x demos, set the following

    host $ export LIBDIR = /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/lib

    For OpenGL ES2.x demos, set the following

    host $ export LIBDIR = /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES2/LinuxOMAP3/lib
    • Set the DISCIMAGE to your target file system install directory. This is required when the graphics and the dependent libraries are installed
    host $ export DISCIMAGE = <your_target_file_system>
  4. Copy libstdc++.so, libstdc++.so.6 and libstdc++.so.6.0.9 from the toolchain path to your target file system's /usr/lib directory
    host $ cp /home/<user_account>/toolchain/arm-2007q3/arm-none-linux-gnueabi/lib/libstdc++.so* /home/<user_account>/workdir/filesys/usr/lib
  5. Perform the build of your demonstration
    host $ cd /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Demos/<your_OpenGL_ES1.x_demo>/OGLES/Build/LinuxGeneric
    host $ make
  6. Copy the built executables to the target file system
    host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Demos/<your_OpenGL_ES1.x_demo>/OGLES/Build/LinuxOMAP3/ReleaseRaw/<demo_executable> /home/<user_account>/workdir/filesys/opt/gfxdemos
  7. Create a file called gfxinstallinfo.txt and depending on the OMAP3 silicon version used in your EVM and based on the type of build (debug or release) you desire, edit this file to include the following text. Alternatively you could also use the following commands to create the file as well add the appropriate text.
    host $ echo "release3.x" > /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt
    or
    host $ echo "debug3.x" > /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt
    or
    host $ echo "release2.x" > /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt
    or
    host $ echo "debug3.x" > /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt

    Copy this file to the target file system

    host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt /home/<user_account>/workdir/filesys/opt/gfxdemos/.

    This is used by the omap-demo script to identify which pre-built version of SGX user modules and kernel modules need to be installed on your DVEVM device for your demo to execute properly.

  8. Before running your graphics SDK demo application from the command line, it is necessary to install the appropriate SGX user libraries as well as kernel modules, based on the OMAP35x silicon version used in EVM and the debug or release version of the build being used. This is done by default, on DVEVM power up, when using the NFS based target file system built using the steps mentioned here.
    In case the omap-demo script is not executed, execute the following command, after linux boot
    target $ cd /etc/init.d
    target $ ./omap-demo

    This will install all the necessary SGX user modules and kernel modules as well as performs the necessary initializations. Executing omap-demo in turn calls the appropriate install.sh on the target, based on the silicon version and the build type (debug or release version) used. This will also execute the rc.pvr script to load kernel modules and initialize the relevant SGX modules.

  9. Execute your graphics SDK demo
    target $ cd /opt/gfxdemos
    target $ ./<your_demo_exec>