[m-rev.] for review: further MinGW README changes

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Feb 16 15:28:21 AEDT 2011

For review by anyone.

Branches: main, 11.01

Further work on the MinGW README file.

 	Reword the introduction.

 	Mention that if the pthreads-win32 library is installed the the
 	high-level C parallel grades can be installed.

 	Mention that the low-level C parallel grades do not currently
 	work on Windows.

 	Add a section on reconfiguring the Mercury compiler so that it
 	can work directly from the Windows command prompt.


RCS file: /home/mercury/mercury1/repository/mercury/README.MinGW,v
retrieving revision 1.15
diff -u -r1.15 README.MinGW
--- README.MinGW	16 Feb 2011 01:17:24 -0000	1.15
+++ README.MinGW	16 Feb 2011 04:24:33 -0000
@@ -2,9 +2,11 @@


-It is possible to build the Mercury compiler using the MinGW version of GCC.
-The advantage of using MinGW is that the generated executables will run
-natively on Windows without the need for any support environments like Cygwin.
+This file documents the port of Mercury to MinGW, i.e. the i686-pc-mingw32
+configuration.  We describe how to build the Mercury compiler using the MinGW
+version of GCC.  The advantage of using MinGW is that the generated executables
+will run natively on Windows without the need for any support environments like
+Cygwin or MSYS.

  A Unix like environment is however still required to build the Mercury
  compiler.  MSYS or Cygwin can be used for this purpose.
@@ -78,6 +80,11 @@
      message "The selected file cannot be found." simply dismiss it.
      This is because configure looks for a program called "mmc".

+    If you have the pthreads-win32 library installed then you may install
+    the high-level C parallel grades, e.g. hlc.par.gc.  Note that the
+    low-level C parallel grades, e.g. asm_fast.par.gc, do not currently
+    work with MinGW.
  4.  run: `make' and then `make install'.

  Add /c/mercury/bin (or whatever path you installed Mercury to) to the MSYS
@@ -94,6 +101,69 @@


+This section describes how to use the MinGW version of the Mercury compiler
+from the Windows command prompt (cmd.exe).  We begin by assuming that the
+Mercury system that has been built and installed using the MSYS environment, as
+described in the previous section.
+In order to make the compiler usable from the Windows command prompt we need to
+modify a number of Mercury's configuration settings.  These settings are stored
+in the Mercury's configuration file which is at
+    <prefix>/lib/mercury/conf/Mercury.config
+where <prefix> is the directory in which Mercury was installed.
+Open this file in an editor and make the following changes.
+(1) Check that no Unix style paths are used in the values of the following
+    variables:
+(2) Add the following flag to the value of DEFAULT_MCFLAGS
+	--env-type=windows
+    This option controls how the Mercury compiler interacts with the
+    shell - setting the value to "windows" tells the compiler we are using
+    the Windows command prompt.
+The Mercury compiler will use the "cp" command to copy files by default.
+Since this is not available on Windows you will either need to configure
+Mercury to use copy.exe or install a Windows port of cp.  (We recommend
+the latter, since it does not' appear possible to suppress the message
+about the number of files that have been copied with copy.exe.)
+You can tell the Mercury compiler to use copy.exe using the following
+       --install-command=copy
+(Include the above option in the value of DEFAULT_MCFLAGS in Mercury.config
+if you want to make it the default.)
+Windows ports of cp are available as part of the following:
+    UnxUtils <http://unxutils.sourceforge.net/>
+    GnuWin   <http://gnuwin32.sourceforge.net/>
+From the Windows command prompt the Mercury compiler is invoked using
+the mercury.bat batch file, for example
+    C:\>mercury hello
+(We don't call the batch file mmc.bat since that name conflicts with the
+executable for the ``Microsoft Management Console''.)

  NOTE: recent versions of Cygwin no longer support the -mno-cygwin option.

mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au

More information about the reviews mailing list