[mercury-users] MSVC port for Mercury ?

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Feb 19 02:04:20 AEDT 1999


On 18-Feb-1999, Koen De Turck <eric.de.turck at skynet.be> wrote:
> Fergus Henderson wrote in a message about threads
> > Mission Critical have apparently ported Mercury to Windows 
> > using MSVC rather than gcc/Wygwin.  That port could be 
> > extended to use Windows threads.
> 
> where can i find more about that port ?

I believe the relevant people at Mission Critical are subscribed to
this list, so maybe they will have something to say about it for themselves.
But you could also check the archives for this list -- mvb at miscrit.be said
a little bit about it in his recent post to this mailing list.

> I installed mercury a few months ago on my windows computer,
> with Cygwinb20.1 but even the "hello world" example  generated
> an executable of nearly 2 Mb ! , is this normal or has it to do with
> Cygwin (or did I something wrong) ?

2 Mb does seem a bit large.

Firstly, did you try stripping the executable, e.g. using the command
`strip hello.exe'?  That should get it down to around 600k or so.
On other systems, the Mercury linker, ml, will automatically pass
the `-s' option to gcc (and hence to ld) to strip the executable.
But on Cygwin, or at least on older versions (b16 or so) of Cygwin,
that option was broken, so Mercury does not pass that option
on Cygwin.  I don't know if `ld -s' has been fixed in more recent
versions of Cygwin; if so, we could make stripping the default again.

That 600k is mostly the Mercury runtime and standard library.
To get rid of that, you need to use shared libraries or DLLs.
As is mentioned in the WORK_IN_PROGRESS file, the current Mercury
distribution does include support for building the Mercury runtime
and library as DLLs, but this is not yet enabled by default because
it has not yet been tested properly.
If you want to give it a try, just uncomment the lines

	# EXT_FOR_SHARED_LIB=dll
	# USE_DLLS=yes

in configure.in and then follow the usual installation procedure
documented in in README.MS-Windows.  Let us know how you go!

The Mercury `hello world' executable on the system I'm typing this on,
an Alpha running Digital Unix, is only 24k.  On Solaris, it is only 6k. 
On x86 Linux, for various reasons static linking is the default,
which makes it come out to 628k, but if you enable shared libraries
(as documented in the README.Linux file) then it comes in at less than 5k.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the users mailing list