6. Provide the Compiler Configurations
Compilation Basics: Lycia's building process involves two compilation stages (4GL to IR, then IR to object code) and a linking stage. Intermediate Representation (IR) is stored in .4o files, which are then linked into an assembled IR code module and translated into native code during the Ahead-of-Time (AOT) compilation. For the building process, Lycia uses its command line tools:
- qbuild builds Lycia projects;
- qfgl compiles .4gl source files into IR modules .4o;
- qlink links IR .4o modules together;
- qform compiles legacy form files (.per);
- qrun --aot can be used to build native code (object cache).
File Encoding: Use the -e flag with qfgl, qmsg, qform for specific source file encoding.
Command Example: qfgl -e UTF-8 your_program.4gl
6A. Command Line (cmd) Compilation (Linux)
Step 1. Perform the Environment Setup (Optional): Create the environ file to set environment variables for command line tools. This file should be sourced before the Lycia tools are executed in cmd. Note that these variables will be set for the current session only.
Reference: For more on the environ configuration file, refer to the environ page.
Step 2. Set the Variables for Lycia Location and Licensing:
- PATH: Path to Lycia binaries (for example, PATH=$PATH:$LYCIA_DIR/bin)
- LYCIA_MSGPATH (Optional): Path to 4GL message files (for example, /opt/my_projects/my_msg)
- QX_KMS_HOST: Specifies the KMS host for license management in virtual environments (for example, QX_KMS_HOST=192.168.32.45:1993)
- QX_KMS_KEY: Restricts access of Lycia client to the KMS server (for example, QX_KMS_KEY=SecureKeyString)
Step 3. Set the Database Environment Variables:
INFORMIXDIR
INFORMIXSERVER
INFORMIXSQLHOSTS
DB_LOCALE
CLIENT_LOCALE
LOGNAME
INFORMIXPASS
- Example: export INFORMIXDIR=/opt/ibm/informix
Step 4. Debug Flags for Compilation:
These are set in the environ file.
- QX_UNL=1: Enables building the debug object_cache during deployment;
- QX_VERBOSE_CACHE=1: For verbose output during object_cache building.
Step 5. DB-Schema (Database Schema) Compilation:
- Set FGLDBPATH to the folder containing DB-Schema files
Example: export FGLDBPATH=/path/to/db_schema_files
- QX_USE_DB_SCHEMA_FILE: Controls whether to use DB-Schema (default true, set false to force DB connection).
- QX_LOAD_ENTIRE_SCHEMA: Controls whether to use 'lazy loading' or load the entire schema.
- Default: false (lazy loading). Set to true to load the entire schema.
- Generate schema using qexpt: /opt/Querix/Lycia/bin/qexpt --format xml -d informix --database <db_name> --tables-only
- Reference: For details about the compilation using DB-Schema file, refer to the ”Compilation Using DB-Schema” documentation page.
- Reference: For more on environment variables used in Lycia, see the Environment Variables docs chapter.
6B. Compilation in Lycia VS Code Extension (LVSCE)
settings.json file: This VS Code configuration file contains Lycia configurations and environment variables used at program compilation in the Lycia VS Code Extension.
- Variables that can be set in settings.json for compilation:
Reference: For more on environment variables used in Lycia, refer to the Environment Variables documentation chapter.
See next: 7. Runtime Configurations