caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: OCaml on Windows help
       [not found] <20071015080212.A2DD5BC73@yquem.inria.fr>
@ 2007-10-22 22:10 ` William Smith
  2007-10-23  7:38   ` [Caml-list] " David Allsopp
  0 siblings, 1 reply; 2+ messages in thread
From: William Smith @ 2007-10-22 22:10 UTC (permalink / raw)
  To: caml-list

I ran into the same problem this week.

ml.exe is the executable name of the Microsoft assembler.  The error is 
confusing due to the coincidence that the assember's name is the same as 
the OCaml file extension.    It has nothing to do with trying to execute 
the test.ml file.

ocamlc was working because it doesn't need any of the Microsoft tools to 
build executable programs.

The INSTALL.win32 file is  a big help.   Once I installed the components 
it indicated, I'm able to use ocamlopt.   It was challenging though to 
get the windows executable and lib paths set correctly so that ocamlopt 
would use the tools it was designed for.  (I had several versions of 
many programs that were for other unrelated purposes.)  As best as I can 
tell, I also had to rebuild OCaml because I was using MSVC 6 and getting 
link errors.   I think this was due to ocamlopt trying to combine the 
released version of 3.10.0 with the run time libraries that I have which 
mixed versions of the MSVC libraries.

Bill

I installed OCaml on Windows XP (the MSVC version, since I assume that's 
faster than
> the Cygwin version?). I'm having trouble compiling OCaml programs from 
> the command line and I wonder if it's a bug or just my lack of Windows 
> knowledge.
>
> I created a sample program test.ml and here's what happens
>
> > ocamlopt -o test.exe test.ml
> -----------
> 'ml' is not recognized as an internal or external command,
> operable program or batch file
>
> Assembler error, input left in file....
-------------
> Please have a look to the INSTALL.win32 :
>   http://camlcvs.inria.fr/cgi-bin/cvsweb/ocaml/README.win32?rev=1.40
>
> You need to install additional software from MS


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

* RE: [Caml-list] Re: OCaml on Windows help
  2007-10-22 22:10 ` OCaml on Windows help William Smith
@ 2007-10-23  7:38   ` David Allsopp
  0 siblings, 0 replies; 2+ messages in thread
From: David Allsopp @ 2007-10-23  7:38 UTC (permalink / raw)
  To: caml-list

> It was challenging though to get the windows executable and lib paths set
> correctly so that ocamlopt would use the tools it was designed for.  (I
> had several versions of many programs that were for other unrelated
> purposes.)  As best as I can tell, I also had to rebuild OCaml because I
> was using MSVC 6 and getting link errors.   I think this was due to 
> ocamlopt trying to combine the released version of 3.10.0 with the run 
> time libraries that I have which mixed versions of the MSVC libraries.

Unless you've got a compelling reason to use the Microsoft toolchain, I've
always found that building OCaml from source using Cygwin/MinGW is
painless... below is my complete build procedure which gives OCaml 3.09.3
with ocamlopt support (with due credit to
http://ibgs.christoph-bauer.net/~fridolin/omm/protokol.txt). My installation
prevents Cygwin from being integrated with the Windows shell because I use
the Win32 ports of the UNIX tools rather than Cygwin's.


David


-----
Run D:\Maintenance\Software\Tcl 8.3.2.exe
	Install to C:\Dev\Tcl
	Install "Tcl Run-Time Files" and "Header and Library Files" only
	Set LIB=C:\Dev\Tcl\lib
	The restart option just logs off so restart manually
Run D:\Repositories\Cygwin\setup.exe
	In Devel, add
		gcc-core
		make
	Remove C:\cygwin\bin from PATH
Start Bash
	$ mkdir /cygdrive/c/Dev/Src
	$ cd /cygdrive/c/Dev/Src
	$ cp /cygdrive/d/Maintenance/Software/OCaml/ocaml-3.09.3.tar.gz .
	$ tar -xzf ocaml-3.09.3.tar.gz
	$ cd ocaml-3.09.3
	$ cp config/m-nt.h config/m.h
	$ cp config/s-nt.h config/s.h
	$ cp config/Makefile.mingw config/Makefile
	$ sed -i -e '20s/=.*$/=C:\/Dev\/OCaml/' -e
'113s/=.*$/=C:\/Dev\/Tcl/' config/Makefile
	$ make -f Makefile.nt world bootstrap opt opt.opt install
	$ sed -i -e 's/\//\\/g' /cygdrive/c/Dev/OCaml/lib/ld.conf
	$ exit
Ensure that C:\Dev\Tcl\bin is in the PATH, add C:\Dev\OCaml\bin
Set OCAMLLIB to C:\Dev\OCaml\lib
Copy C:\cygwin\bin\{cygwin1.dll,cygintl-3.dll,cygiconv-2.dll} to
C:\WINDOWS\system32 and
C:\cygwin\bin\{ar.exe,as.exe,dlltool.exe,gcc.exe,ranlib.exe} to
C:\Dev\OCaml\bin


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

end of thread, other threads:[~2007-10-23  7:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20071015080212.A2DD5BC73@yquem.inria.fr>
2007-10-22 22:10 ` OCaml on Windows help William Smith
2007-10-23  7:38   ` [Caml-list] " David Allsopp

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).