[m-rev.] for review: Update README.MinGW regarding MSYS2 and x86_64.

Julien Fischer jfischer at opturion.com
Tue Aug 25 15:32:47 AEST 2015


Hi Peter,

On Tue, 25 Aug 2015, Peter Wang wrote:

> If anyone would care to try to reproduce the build on i686 or x86_64,
> that would be great.

I'll have a go at reproducing it later this week.

> ---
>
> README.MinGW:
> 	Use "MinGW-w64" spelling for the project.
>
> 	Link to MSYS2 installer and describe how to install gcc in it.
>
> 	Make the required configure option for x86_64 more prominent.
>
> 	Move optional Java/C#/Erlang steps.

I wonder whether we shouldn't split this into README.MSYS and
README.MSYS2 and just leave pointers to each from README.MinGW.

In any case, you should also update README.MS-Windows so that it
mentions MSYS2 as a possible build environment.

> README.MinGW | 68 ++++++++++++++++++++++++++++++------------------------------
> 1 file changed, 34 insertions(+), 34 deletions(-)
>
> diff --git a/README.MinGW b/README.MinGW
> index 2d194f9..e524076 100644
> --- a/README.MinGW
> +++ b/README.MinGW
> @@ -24,16 +24,14 @@ to use Mercury once it is installed.
>
> -----------------------------------------------------------------------------
>
> -BUILDING A MINGW OR MINGW64 COMPILER UNDER MSYS
> +BUILDING A MINGW OR MINGW-W64 COMPILER UNDER MSYS
>
> To build the source distribution under MSYS follow these steps:
>
> -1.  Download and install MinGW and MSYS
> -    (available from <http://www.mingw.org>).
> +1a. Download and install MinGW and MSYS from <http://www.mingw.org>
>
> -    The simplest installation method for MinGW and MSYS is to download and
> -    run the MinGW GUI installer.  In order to build and install Mercury you
> -    will require at least the following components:
> +    In order to build and install Mercury you will require at least the
> +    following components:
>
>     - MinGW Compiler Suite (C compiler)
>     - MSYS Basic System
> @@ -42,63 +40,65 @@ To build the source distribution under MSYS follow these steps:
>     Details of alternative MinGW and MSYS installation methods may be found
>     on the MinGW website.
>
> -    To build a version of Mercury that generates 64-bit executables you will
> -    require the MinGW64 version of GCC (available from
> -    <http://mingw-w64.sourceforge.net>).

You can still build a 64-bit version under the original MSYS shell, so
long as you have the MinGW-64 compiler.  I suggest you replace the last
paragraph you deleted there with:

     To build a verison of the Mercury compiler that generates 64-bit
     exeutables using the MSYS shell, you will need to install the
     MinGW-w64 version of GCC (available from <http://mingw-w64.org>) and
     ensure that it occurs in your PATH before the MinGW GCC.

> +1b. Alternatively, download and install MSYS2 from <https://msys2.github.io>
>
> -    To build the Erlang grade with MinGW and MSYS you will require the Windows
> -    version of the Erlang/OTP distribution to be installed on your system.
> -    The Erlang compiler (erlc) and runtime (erl) needs to be in the MSYS
> -    PATH, for example do the following in the MSYS shell (with the version
> -    number modified if necessary):
> +    You can use the MinGW-w64 version of GCC to build a copy of Mercury that
> +    generates 32-bit or 64-bit executables.  In the MSYS2 shell run either of:
>
> -        export PATH=/c/Program\ Files/erl5.8.2/bin/:$PATH
> +        pacman -S mingw-w64-i686-gcc
>
> -    See README.Erlang for further details.
> +        pacman -S mingw-w64-x86_64-gcc
>
> -    To build the java grade with MinGW and MSYS you will require the Windows
> -    version of the JDK to be installed on your system.
> +2.  Optional: To build the java grade with MinGW and MSYS you will require
> +    the Windows version of the JDK to be installed on your system.
>     The Java compiler (javac), Java archive tool (jar), and Java runtime (java)
> -    needs to be in the MSYS PATH, for example do the following in the MSYS
> -    shell (with the version number modified if necessary):
> +    needs to be in the MSYS PATH, for example do the following in the shell:
>
>         export PATH=/c/Program\ Files/Java/jdk1.6.0_23/bin/:$PATH
>
>     See README.Java for further details.
>
> -    To build the C# grade with MinGW, MSYS and .NET, you will need Visual C#
> -    compiler installed on your system.
> +    Optional: To build the C# grade with MinGW, MSYS and .NET, you will need
> +    Visual C# compiler installed on your system.
>     The C# compiler (csc.exe) needs to be in the MSYS PATH, for example do the
> -    following in the MSYS shell (with the version number modified if
> -    necessary):
> +    following in the shell:
>
>         export PATH=/c/WINDOWS/Microsoft.NET/Framework/v4.0.30319/:$PATH
>
>     See README.CSharp for further details.
>
> -2.  Unpack the source distribution with a command like:
> +    Optional: To build the Erlang grade with MinGW and MSYS you will require
> +    the Windows version of the Erlang/OTP distribution to be installed on
> +    your system.  The Erlang compiler (erlc) and runtime (erl) needs to be in
> +    the MSYS PATH, for example do the following in the shell:
> +
> +        export PATH=/c/Program\ Files/erl5.8.2/bin/:$PATH
> +
> +    See README.Erlang for further details.
> +
> +3.  Unpack the source distribution with a command like:
>
>         tar -xvzf mercury-compiler-<VERSION>.tar.gz
>
> -3.  cd into the new directory and run configure:
> +4.  cd into the new directory and run configure:
>
>         ./configure --prefix=c:/mercury
>
> +    or
> +
> +        ./configure --prefix=c:/mercury --host=x86_64-w64-mingw32
> +
>     It is important to specify the installation prefix as a full windows
>     path with a drive letter (except use `/' instead of `\').
>     Do not use a path like `/mercury', because that
>     will be interpreted differently by the MSYS shell than by the generated
>     executables, resulting in a broken installation.
>
> -    If you are building a Mercury compiler that targets MinGW64 then you
> -    must also invoke configure with the following option:
> -
> -       --host=x86_64-w64-mingw32
> -
> -    This will cause mmake to use the MinGW64 tool chain.  Ensure that the
> -    MinGW64 tools are in your PATH before running configure.
> +    If you are building a Mercury compiler that targets MinGW-w64 x86-64 then
> +    you must also invoke configure with the --host option above, otherwise it
> +    will fail to build boehm_gc or libatomic_ops.

IIRC, one of the problems is that if you don't do that when using MSYS2
configure decides that the host type is 'x86_64-pc-msys'.  I think it be
worth mentioning that.

Julien.



More information about the reviews mailing list