Appendix: Alternate installation of lpfg

This appendix contains information you need if you want to use lpfg with a C++ compiler other than Microsoft Visual C++.

Using L-studio with MinGW

MinGW is a port of the GNU compilers and build tools to Windows. It can be downloaded for no cost from the website MinGW can be used to compile L+C programs if you do not have access to or do not wish to use Visual C++. To use MinGW with lpfg:

  1. Install MinGW. You'll need at least the C++ compiler g++ and the GNU make program.
  2. Unzip the files from into the lpfg/bin subdirectory in your L-studio directory.
  3. Change the definition of MINGW in the files Makefile and mingw.bat to the location of your MinGW installation. The default is C:\MinGW, so if that's where you installed it, nothing has to be changed.

Now run an lpfg model. L-studio should use MinGW to compile the L+C program. If there are troubles, check if there is a Makefile in the lab table directory. If present, this file will override the new MinGW Makefile. You may have to alter the Makefile on the lab table to call the MinGW tools, or, if it does not link in any external libraries, it may suffice to simply delete it.

Using L-studio with another compiler

lpfg requires two batch files: preproc.bat and cmpl.bat. The contents of these files depends on the C++ compiler you are using. preproc.bat is the command lpfg will execute in order to apply the C++ preprocessor to a file (in particular, the L+C source file). The syntax for this command is:

preproc.bat source target

where source is the file to be preprocessed and target is the name of the output file. You will need to edit the preproc.bat file so that it applies your C++ preprocessor to the source file to produce target.

The cmpl.bat file is called by lpfg to compile the translated L+C source file into a DLL. There are no parameters. The preprocessed C++ file that is to be compiled is called lsys.i. Additional -D flags (for instance, to #define a function's name to its ID value) may be found in the file clopt; using VC++, they are added to the argument list with the @clopt argument. A successful compilation should produce a DLL named lsys.dll.

The cmpl.bat file provided with L-studio calls the command make, and attempts to use the Makefile on the lab table; if this Makefile does not exist, it uses the "default" Makefile, in the same directory as cmpl.bat. You may need to edit both cmpl.bat and this "default" Makefile, as well as your objects' own Makefiles, to properly use your C++ compiler with lpfg.