caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] Ocaml 3.03 alpha MinGW port
@ 2001-11-26  8:28 Jean-Marc Eber
  2001-11-26 11:03 ` Xavier Leroy
  2001-11-26 15:37 ` [Caml-list] " Jean Martos
  0 siblings, 2 replies; 8+ messages in thread
From: Jean-Marc Eber @ 2001-11-26  8:28 UTC (permalink / raw)
  To: caml-list, Dmitry Bely

There have been some interesting postings on this list
about a MinGW port of the OCaml Compiler. The
attached patch was textually large but conceptually
simple.

I'm really not a specialist about this topic, but have now
(or in a near future) to choose between possible
Windows "technologies" (Visual C, Cygwin, MinGW) for
an OCaml program (only a console mode stuff in my case).

Could anybody explain to me why a MinGW isn't *always*
preferable to a Cygwin one (use of the same compiler, GCC,
MinGW being more "direct" Windows without an indirection
layer, not speaking about licensing problems, etc....).

I understand well that the Caml Team wants probably to
maintain a MS C version of the OCaml implementation,
but wanted to ask the Team if they have some ideas about
the future of Cygwin/MinGW ports. Isn't a MinGW port, in
the medium term, preferable to a Cygwin one ? Or do I
miss a point ?

Jean-Marc Eber
LexiFi



-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocaml 3.03 alpha MinGW port
  2001-11-26  8:28 [Caml-list] Ocaml 3.03 alpha MinGW port Jean-Marc Eber
@ 2001-11-26 11:03 ` Xavier Leroy
  2001-11-26 13:34   ` Dmitry Bely
  2001-11-26 15:37 ` [Caml-list] " Jean Martos
  1 sibling, 1 reply; 8+ messages in thread
From: Xavier Leroy @ 2001-11-26 11:03 UTC (permalink / raw)
  To: Jean-Marc Eber; +Cc: caml-list, Dmitry Bely

> I'm really not a specialist about this topic, but have now
> (or in a near future) to choose between possible
> Windows "technologies" (Visual C, Cygwin, MinGW) for
> an OCaml program (only a console mode stuff in my case).
> 
> Could anybody explain to me why a MinGW isn't *always*
> preferable to a Cygwin one (use of the same compiler, GCC,
> MinGW being more "direct" Windows without an indirection
> layer, not speaking about licensing problems, etc....).

The full Cygwin provides a rather complete Unix emulation, hence the
OCaml Cygwin port supports the debugger, all of the Unix module, and
(I believe) the LablGTK GUI -- all things that are missing in the
OCaml MinGW port, if I remember correctly.

> I understand well that the Caml Team wants probably to
> maintain a MS C version of the OCaml implementation,
> but wanted to ask the Team if they have some ideas about
> the future of Cygwin/MinGW ports. Isn't a MinGW port, in
> the medium term, preferable to a Cygwin one ? Or do I
> miss a point ?

The situation is quite simple, really:

- We can't support three different Windows port of OCaml; the current
  two are already too much.

- Every time I mention this fact on this list, we get replies of the form
    "I can't live without the Visual C based port of OCaml --
     I'm doing real industrial work, and everything gcc-related is
     just amateur work"
  OR
    "I got a Windows machine because that's the company policy,
     but I really do all my work within the Cygwin environment and
     don't want to hear about anything else".

Draw your own conclusions...

- Xavier Leroy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocaml 3.03 alpha MinGW port
  2001-11-26 11:03 ` Xavier Leroy
@ 2001-11-26 13:34   ` Dmitry Bely
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Bely @ 2001-11-26 13:34 UTC (permalink / raw)
  To: caml-list

Xavier Leroy <xavier.leroy@inria.fr> writes:

> > I'm really not a specialist about this topic, but have now
> > (or in a near future) to choose between possible
> > Windows "technologies" (Visual C, Cygwin, MinGW) for
> > an OCaml program (only a console mode stuff in my case).
> > 
> > Could anybody explain to me why a MinGW isn't *always*
> > preferable to a Cygwin one (use of the same compiler, GCC,
> > MinGW being more "direct" Windows without an indirection
> > layer, not speaking about licensing problems, etc....).
> 
> The full Cygwin provides a rather complete Unix emulation, hence the
> OCaml Cygwin port supports the debugger, all of the Unix module,

Yes, MinGW port lacks that (as well as MSVC one -- that's Win32 without
fork() and other stuff). MSVC and MinGW ports support absolutely the same
set of OCaml libraries.

> and
> (I believe) the LablGTK GUI -- all things that are missing in the
> OCaml MinGW port, if I remember correctly.

Hmm, IIRC standard 3.03 alpha contains only LablTk, not LablGTK. Yes, with
MinGW patch LablTk can be compiled out of the box. As for LablGTK, it
also should not be a problem -- gtk/Win32 does not rely on Cygwin...

> > I understand well that the Caml Team wants probably to
> > maintain a MS C version of the OCaml implementation,
> > but wanted to ask the Team if they have some ideas about
> > the future of Cygwin/MinGW ports. Isn't a MinGW port, in
> > the medium term, preferable to a Cygwin one ? Or do I
> > miss a point ?
> 
> The situation is quite simple, really:
> 
> - We can't support three different Windows port of OCaml; the current
>   two are already too much.

MinGW port in fact do not need any extra support; it uses the same
sources as MSVC one (and even links with MS-supplied C runtime library
msvcrt.dll), and shares Make/Configure environment with all other Unixes. I
see no real problem here...

> - Every time I mention this fact on this list, we get replies of the form
>     "I can't live without the Visual C based port of OCaml --
>      I'm doing real industrial work, and everything gcc-related is
>      just amateur work"
>   OR
>     "I got a Windows machine because that's the company policy,
>      but I really do all my work within the Cygwin environment and
>      don't want to hear about anything else".
> 
> Draw your own conclusions...

OK, I do not insist. It really may not worth your efforts. I just thought
that for people, who cannot/does not want to buy expensive and
multimegabyte MSVC but need C compiler under Win32 (for custom runtimes,
CamlIDL etc), native Win32 port of OCaml, compiled with gcc compiler, would
be very convenient...

Hope to hear from you soon,
Dmitry


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Caml-list] Re: MinGW port
  2001-11-26  8:28 [Caml-list] Ocaml 3.03 alpha MinGW port Jean-Marc Eber
  2001-11-26 11:03 ` Xavier Leroy
@ 2001-11-26 15:37 ` Jean Martos
  1 sibling, 0 replies; 8+ messages in thread
From: Jean Martos @ 2001-11-26 15:37 UTC (permalink / raw)
  To: Jean-Marc Eber, caml-list



Jean-Marc Eber a écrit :

> There have been some interesting postings on this list
> about a MinGW port of the OCaml Compiler. The
> attached patch was textually large but conceptually
> simple.
>
> I'm really not a specialist about this topic, but have now
> (or in a near future) to choose between possible
> Windows "technologies" (Visual C, Cygwin, MinGW) for
> an OCaml program (only a console mode stuff in my case).
>
> Could anybody explain to me why a MinGW isn't *always*
> preferable to a Cygwin one (use of the same compiler, GCC,
> MinGW being more "direct" Windows without an indirection
> layer, not speaking about licensing problems, etc....).
>
> I understand well that the Caml Team wants probably to
> maintain a MS C version of the OCaml implementation,
> but wanted to ask the Team if they have some ideas about
> the future of Cygwin/MinGW ports. Isn't a MinGW port, in
> the medium term, preferable to a Cygwin one ? Or do I
> miss a point ?
>
> Jean-Marc Eber
> LexiFi

Cygwin offers an emulation layer of the UNIX system calls. But if you compile using
Cygwin, you have to provide the cygnus.dll which contains the emulation layers.
And then, it is no so easy to mix both unix like system calls and native system
calls.

Msv compiler, by default (so for Ocaml), generated objects using I/O routines
provided by crtdll. (For example C++ woks this way). But a lot of programs use the
msvcrt.dll, which provides I/O routines which conflits with crtdll. So if you want
to mix  codes from ocaml and c for example, you must be coherent with the runtime
library (crt or msvcrt), or encapsulate your code in a DLL.

Mingw32 use the native system calls and the msvcrt.dll.

The problem arises when you want to mix code from a tool which generates code using
msvcrt.dll and Ocaml. For example, we have a program writing in GNAT and we use
Ocaml as an extension language. GNAT use gcc (mingw32) as backend to generate code.
To mix ADA code and Ocaml, we must isolate the ADA code or Ocaml code in a DLL. And
in our application it is not possible for a lot of reasons. So we have port Ocaml
for gcc-mingw32 and it works fine.

The work to port the core Ocaml for gcc-mingw32 is not very hard. It consists on a
very few changes in configure script, in asmrun and bytecomp.
The main problem is to adapt specific libraries like the native threads. But, I
have already take a look and it seems to be a little work to do it. The problem is
Time!!

Another problem is portability. And I just want to say that gcc on Window is not a
toy, but associated with all the gnu tools is a good mean, i think the best today,
to acheive portability betwen Unix and Windows. If you write code using Visual C++,
your application runs and only runs on Windows, the port to another platform can be
hard.

I unterstand the Ocaml team, when they say that they don't want to maintain 3 ports
on Windows. But I think that a lot of people, like us, want to use Ocaml with gcc
mingw32, and it will be fine to have an official mingw32 port.


Jean Martos.



>
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocaml 3.03 alpha MinGW port
  2001-10-22 14:56     ` Dmitry Bely
@ 2001-10-22 16:18       ` Masakazu Fukuzawa
  0 siblings, 0 replies; 8+ messages in thread
From: Masakazu Fukuzawa @ 2001-10-22 16:18 UTC (permalink / raw)
  To: caml-list

>
>You are welcome :-) Everything else works?
>

Maybe OK, and I hope so. (You can download
http://caml.inria.fr/Examples/oc/basics/sieve.ml, 
ocamlopt it, and sucessfully run 'sieve 50000',
which previously failed.)

I wish your MinGW port to be incorporated into 
Ocaml 3.03 or above \^_^/


Fukuzawa
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocaml 3.03 alpha MinGW port
  2001-10-22  1:46   ` Masakazu Fukuzawa
@ 2001-10-22 14:56     ` Dmitry Bely
  2001-10-22 16:18       ` Masakazu Fukuzawa
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Bely @ 2001-10-22 14:56 UTC (permalink / raw)
  To: caml-list

Masakazu Fukuzawa <fukuzawa@cool.email.ne.jp> writes:

> After applying the patch, in ocaml-3.03-alpha\asmcomp\i386\emit.mlp,
> add '| "mingw32"' to

[...]

> Now you can successfully make opt.opt and use ocamlopt.opt.

Oh, sorry. Didn't checked that.

> Thanks, Dmitry!!
> 
> Fukuzawa

You are welcome :-) Everything else works?

Hope to hear from you soon,
Dmitry


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocaml 3.03 alpha MinGW port
  2001-10-17 19:07 ` [Caml-list] Ocaml 3.03 alpha MinGW port Dmitry Bely
@ 2001-10-22  1:46   ` Masakazu Fukuzawa
  2001-10-22 14:56     ` Dmitry Bely
  0 siblings, 1 reply; 8+ messages in thread
From: Masakazu Fukuzawa @ 2001-10-22  1:46 UTC (permalink / raw)
  To: caml-list


After applying the patch, in ocaml-3.03-alpha\asmcomp\i386\emit.mlp,
add '| "mingw32"' to

  let emit_align =
    match Config.system with
      "linux_elf" | "bsd_elf" | "solaris" | "beos" | "cygwin" ->

to read 

  let emit_align =
    match Config.system with
      "linux_elf" | "bsd_elf" | "solaris" | "beos" | "cygwin" | "mingw32" 
->

and in ocaml-3.03-alpha\asmrun\i386.S, add '|| defined(SYS_mingw32)' to

   || defined(SYS_solaris) || defined(SYS_beos) || defined(SYS_cygwin)

to read 

   || defined(SYS_solaris) || defined(SYS_beos) || defined(SYS_cygwin) |
| defined(SYS_mingw32)

Now you can successfully make opt.opt and use ocamlopt.opt.

Thanks, Dmitry!!

Fukuzawa
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Caml-list] Ocaml 3.03 alpha MinGW port
  2001-09-24 23:40 [Caml-list] Initial port of ocaml for mingw (long) art
@ 2001-10-17 19:07 ` Dmitry Bely
  2001-10-22  1:46   ` Masakazu Fukuzawa
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Bely @ 2001-10-17 19:07 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]

OK, seems that I've almost completed the native Win32 MinGW port that uses
the same ./configure script and Unix Makefiles (of course updated to
support mingw32 target), so keepeng it in sync should not became the
nigntmare as with MSVC/Mac/... non-unix systems. If it works, maybe to add
it to the stock distribution after some testing? :-)

A special care was taken to not break any existing configuration (no
Gnu make conditional operators etc.), so after applying the patch OCaml
*should* configure and compile on all hosts that were supported before (if
I ocasionally did not break something).

The port supports the same set of libraries as the MSVC one. Both bytecode
and native modes seem to work properly.

Problems
--------

1. Profiling mode (gprof) does not work under MinGW (neither it does under
Cygwin port) - I can enable it in ./configure script, but asmrun/i386.S
does not compile when.

2. I have no idea how to integrate the DLL support. I used Cygwin port as a
template, but it also seems to lack it, although Cygwin/Mingw gcc can build
Win32 DLLs without a problem.

How to use it
-------------

1. Make sure you have the latest Cygwin tools from
http://sources.redhat.com/cygwin. "MinGW runtime" and "w32api" packages are
required.

2. Apply the patch attached to this message.


[-- Attachment #2: diff.bz2 --]
[-- Type: application/octet-stream, Size: 9093 bytes --]

[-- Attachment #3: Type: text/plain, Size: 622 bytes --]


3. Configure OCaml with
  bash -c "./configure -cc 'gcc -mno-cygwin' -host 'i586-pc-mingw32' \
           -tkdefs '-Ic:/Tcl/include' -tklibs '-Lc:/Tcl/lib'" 

Of course paths to tcl/tk may vary. You will also need to create import
libraries from tcl/tk DLLs using impdef/dlltool from the Cygwin
distribution.

If you do not need working labltk, simply omit -tkdefs/-tklibs above.

4. Build and install ocaml as usual:
  make world
  make opt
  make install

It *should* work. At least I was able to rebuld ocaml itself (make bootstrap)
and get working labltk tools (ocamlbrowser etc.)

Hope to hear from you soon,
Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-11-26 15:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-26  8:28 [Caml-list] Ocaml 3.03 alpha MinGW port Jean-Marc Eber
2001-11-26 11:03 ` Xavier Leroy
2001-11-26 13:34   ` Dmitry Bely
2001-11-26 15:37 ` [Caml-list] " Jean Martos
  -- strict thread matches above, loose matches on Subject: below --
2001-09-24 23:40 [Caml-list] Initial port of ocaml for mingw (long) art
2001-10-17 19:07 ` [Caml-list] Ocaml 3.03 alpha MinGW port Dmitry Bely
2001-10-22  1:46   ` Masakazu Fukuzawa
2001-10-22 14:56     ` Dmitry Bely
2001-10-22 16:18       ` Masakazu Fukuzawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).