Discussion:
[m-dev.] Building Mercury in Windows 10
hao ramirez
2016-03-30 22:25:42 UTC
Permalink
So, if I wanted to fix the Mercury 14.01 (Visual Studio 2013 32bit)
release, how would I start?

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 Window
<https://github.com/Mercury-Language/mercury/blob/master/README.MS-VisualC>s
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.

Also, what exactly is the build sequence for Mercury in general? I know
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?

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

p.s.
I'm of the opinion that my stupid questions are going to be useful for
someone else someday, but maybe that's the wrong assumption to be making? I
don't mind putting more effort into reading the documentation and posting
my own monologue about how I think it works, but I think that would border
on nonsense babble at this point. For my thick head, frankness is
appreciated.
Julien Fischer
2016-03-31 13:58:39 UTC
Permalink
Hi,
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
config.guess
config.sub
configure.ac
install-sh
Makefile
Makefile.DLLs
Mmake.common.in
Mmake.workspace
Mmakefile
prepare.sh
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.

Loading...