[m-dev.] Building Mercury in Windows 10

Julien Fischer jfischer at opturion.com
Fri Apr 1 00:58:39 AEDT 2016


Hi,

On Wed, 30 Mar 2016, hao ramirez wrote:

> So, if I wanted to fix the Mercury 14.01 (Visual Studio 2013 32bit) release, how would I start?

I assume you mean fixing it on Windows 10 -- it works on Windows 7.  I would
start by trying to build a current ROTD rather than 14.01 since there have been
changes specific to MSVC that have not been backported to the 14.01 branch.

> I'm interested in committing to really trying to help this project, so
> looking at it I'm not that sure how to go about it.
> 
> So far I am at the point where I am in the build tutorial for Windows and I can't seem to even run
>       $ ./configure --with-msvcrt
>       bash: ./configure: No such file or directory
> 
> in the Cygwin shell.
> 
> Pretty sure this is a stupid thing I should know, but I have no clue how to work around it.

For a source tree checked out from git and assuming you have an existing
Mercury compiler to bootstrap from, it should be:

     $ ./prepare.sh
     $ ./configure
     $ make
     $ make install

You probably don't need to use configure's --with-msvcrt option.  In Cygwin (or
MSYS etc) you will need to pass '--with-cc=cl' to the configure script to tell
it to use MSVC rather than GCC.

If you are building the source distribution (i.e. the tarballs with the
pre-generated .c files), then it should simply be:

     $ ./configure
     $ make
     $ make install

> Also, what exactly is the build sequence for Mercury in general? I know it's Autotools, but I'm wondering what the breakdown of:
>       config.guess
>       config.sub
>       configure.ac
>       install-sh
>       Makefile
>       Makefile.DLLs
>       Mmake.common.in
>       Mmake.workspace
>       Mmakefile
>       prepare.sh
> 
> and how they are used? Big question, but I'm just wondering if someone could maybe use some ASCII to show:
> configure.ac [depending on config.sub, config.guess] -> processed by ./configure -> generates file $x -> Makefile [depending on $x] ->
> scripts/Mmake -> ...
> or something?

    * prepare.sh generates 'configure' from 'configure.ac'
    * 'configure' (using config.guess and config.sub) generates bunch of files, among
       which is 'Mmake.common' for which 'Mmake.common.in' is the template.
    * 'Makefile' is just a wrapper that invokes the relevant mmake targets from make.
    * 'Mmakefile' is the main top-level Mmakfile for the Mercury system, it includes
      'Mmake.workspace' and 'Mmake.common'.a

'Makefile.DLLS' contains some additional rules for building DLLs on Windows.  It
isn't currently used.

> Also, it looks like the Makefile calls Mmake, but I thought Mmake was
> completely deprecated? Is it still used in the initial build system?

For users of Mercury, mmake is effectively deprecated, and we recommend using
'mmc --make' to build multi-module programs.

For the Mercury compiler itself mmake is, and will remain, the build system.

Julien.


More information about the developers mailing list