Next: , Previous: , Up: Top   [Contents][Index]


4 Running Mercury programs

ZZZ TODO

When targeting C on systems that do not require an executable file extension, ‘mmc’ will put the executable into a file called filename; on systems (such as Windows) that use .exe as the file extension for executables, ‘mmc’ will put the executable into a file called filename.exe.

When targeting C#, ‘mmc’ will generate a process assembly called filename.exe. On Windows, this process assembly can be run directly. On non-Windows systems, ‘mmc’ will also generate a shell script called filename that invokes the CLI execution environment on the process assembly. (See the file README.CSharp.md included in the Mercury distribution for further details.)

When targeting Java, ‘mmc’ will package up all of the class files for the executable into a Java archive (JAR) named filename.jar. It will also generate a launcher that invokes the program using the Java interpreter. If you are using the Windows command line interpreter ‘cmd.exe’, this launcher will be a batch file called filename.bat. Otherwise, the launcher will be a shell script called filename. Java runtime flags can be set using ‘mmc’’s ‘--java-runtime-flags’ or ‘--java-runtime-flag’ options. Such Java runtime flags will be included in the generated launcher shell script or batch file. You may override any runtime flags set at (Mercury) compile time by setting the variable MERCURY_JAVA_OPTIONS in the environment. Classpath settings made using ‘mmc’’s ‘--java-classpath’ option will also be included in the generated launcher shell script or batch file.