Workbench User Guide : 14. Adding Other Components to Your Application : 3GL Sample Application : How the 3GL Sample Application Works on UNIX or Linux
 
Share this page                  
How the 3GL Sample Application Works on UNIX or Linux
The directory $II_SYSTEM/ingres/w4glsamp/3gl contains the following files:
test_3gl.exp
Is an export file of the OpenROAD application used to run the sample 3GL procedure
samp3glu.c
Is the sample 3GL source for UNIX or Linux
makefile
Is the makefile for compiling and linking a shared library
For more information about supported UNIX and Linux versions, see the latest readme.
To use the demo application, you must perform the following basic steps:
1. Import the sample application into your database.
2. Build the sample application.
3. Set up the run environment for the sample application.
4. Run the sample application.
See the following sections for details on each of these steps.
Import the Sample Application into Your Database
Import the test application into your database by entering the following command on the command line:
w4gldev backupapp in dbname test_3gl "%II_SYSTEM%\ingres\w4glsamp\3gl\test_3gl.exp"
dbname
Specifies the name of the database into which you are importing the test_3gl application
Build the Sample Application
You can build the 3GL application by importing it into your database, making an application image using the MakeImage utility, and using the makefile to build the sample application.
To build the sample application
1. Make an application image using the MakeImage utility, using "test_3gl.img" as the image name.
Note:  You may skip this step if you want to run the application directly from OpenROAD Workbench.
2. Create the shared library (samp3gl.shared-lib-suffix):
cd $II_SYSTEM/ingres/w4glsamp/3gl
make
The shared library samp3gl.shared-lib-suffix will be created and placed into $II_SYSTEM/ingres/lib.
More information:
Use the MakeImage Utility
How You Can Set Up the Run Environment
Ensure that OpenROAD can find samp3gl.shared-lib-suffix. There are two ways to do this:
Set the environment variable II_LIBU3GL to point to samp3gl.shared-lib-suffix.
You may do this either by setting the system environment variable, II_LIBU3GL, or by using the ingsetenv command:
ingsetenv II_LIBU3GL $II_SYSTEM/ingres/lib/samp3gl.shared-lib-suffix
Whether you set the system environment variable or use ingsetenv, you must specify the full path if the directory where you placed the shared library is not in the search path.
If you want to use a variable other than II_LIBU3GL, set that variable the same way you will set II_LIBU3GL but remember you must to run the application with the -m flag.
Ensure that samp3gl.shared-lib-suffix is in a directory that is in your search path.
All the 3GL procedures in the test_3gl application are defined as being in samp3gl.shared-lib-suffix. If the shared library is in the search path, OpenROAD will find it when you run the application.