Programming tools / Compiling source files |
The compiler version used to build the 42m modules must be compatible to the runtime system used to execute the programs. The fglcomp compiler writes version information in the generated 42m files. This can be useful on site, if you need to check the version of the compiler that was used to build the 42m nodules.
To extract build information, run fglrun with the -b option:
$ fglrun -b mymodule.42m 2.11.01-1161.12 /home/devel/stores/mymodule.4gl 15
The output shows the following fields:
fglrun -b can read the header of p-code modules compiled with older versions of fglcomp and display version information for such old modules. If fglrun cannot recognize a p-code module, it returns with an execution status that is different from zero.
When reading build information of a 42x or 42r file, fglrun scans all modules used to build the library or program. You will see different versions in the first column if the modules were compiled with different versions of fglcomp. However, it's not recommended that you mix versions on a production site:
$ fglrun -b myprogram.42r 2.11.01-1161.12 /home/devel/stores/mymodule1.4gl 15 2.10.02-1148.36 /home/devel/stores/mymodule2.4gl 15 2.11.01-1161.12 /home/devel/stores/mymodule3.4gl 15
If you need to write timestamp information in the p-code modules, you can use the --timestamp option of fglcomp:
$ fglcomp --timestamp mymodule.4gl $ fglrun -b mymodule.42m 2008-12-24 11:22:33 2.11.05-1169.84 /home/devel/stores/mymodule.4gl 15
However, with timestamp information in p-code modules, you will not be able to easily compare 42m files (based on a checksum, for example). Without the timestamp, fglcomp generates exactly the same p-code module if the source file was not modified.
To check if the version of the runtime system corresponds to the p-code version, run fglrun with the -V option.