caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* OCaml 3.12.0+beta1 on Cygwin 1.7.5
@ 2010-07-06 21:36 Taylor Venable
  2010-07-06 22:06 ` [Caml-list] " Gerd Stolpmann
  2010-07-07 18:54 ` Romain Beauxis
  0 siblings, 2 replies; 3+ messages in thread
From: Taylor Venable @ 2010-07-06 21:36 UTC (permalink / raw)
  To: caml-list

Hi there, I'm thinking of writing some programs in OCaml to assist a
custom build infrastructure (currently 95% Tcl, 5% external Lua
programs) that we use at work.  Since we build on Windows, Mac, and
Linux I have to make sure that whatever I end up writing works in all
three.  I haven't written much OCaml in my life, and the little that I
did was probably five years ago, but any tools I write will have to be
usable for a while.  So I tried compiling OCaml 3.12.0+beta1 in Cygwin
1.7.5 -- the information I found about it seemed to imply that it
should work.  I put flexdll in the PATH and I was able to use the
configure script and "make world.opt" with only a single problem:
there were lots of linker errors when it came to building
tools/objinfo_helper.exe, symbols like _lbasename, _sch_istable, and
_objalloc_free could not be found.  [I'd paste the full error but I
forgot to email it to my private address today and the machine is in
corporate lockdown mode, so I can't access it right now, but I can
obtain it tomorrow at work if anybody would like to see the full
message.]  The way to fix it, for me anyway, was to modify the
definition of LIBBFD_LINK in config/Makefile (which started out as
"-lbfd -ldl") to append to it "-lintl -lz /usr/lib/libiberty.a"; and
after that everything worked.  I don't know if that constitutes a
problem with the configure script or just something about how my
Cygwin is installed, but I wanted to mention it somewhere in case it
was a bug.

In addition to that, I have a question: is bytecode compatible across
operating systems and/or CPU architectures?  In other words, if I
compile to bytecode on Linux/x86, can I run that using ocamlrun on
Windows/x86 or Linux/amd64?

Thanks,

-- 
Taylor C. Venable
http://metasyntax.net/


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

* Re: [Caml-list] OCaml 3.12.0+beta1 on Cygwin 1.7.5
  2010-07-06 21:36 OCaml 3.12.0+beta1 on Cygwin 1.7.5 Taylor Venable
@ 2010-07-06 22:06 ` Gerd Stolpmann
  2010-07-07 18:54 ` Romain Beauxis
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Stolpmann @ 2010-07-06 22:06 UTC (permalink / raw)
  To: Taylor Venable; +Cc: caml-list

Am Dienstag, den 06.07.2010, 17:36 -0400 schrieb Taylor Venable:
> Hi there, I'm thinking of writing some programs in OCaml to assist a
> custom build infrastructure (currently 95% Tcl, 5% external Lua
> programs) that we use at work.  Since we build on Windows, Mac, and
> Linux I have to make sure that whatever I end up writing works in all
> three.  I haven't written much OCaml in my life, and the little that I
> did was probably five years ago, but any tools I write will have to be
> usable for a while.  So I tried compiling OCaml 3.12.0+beta1 in Cygwin
> 1.7.5 -- the information I found about it seemed to imply that it
> should work.  I put flexdll in the PATH and I was able to use the
> configure script and "make world.opt" with only a single problem:
> there were lots of linker errors when it came to building
> tools/objinfo_helper.exe, symbols like _lbasename, _sch_istable, and
> _objalloc_free could not be found.  [I'd paste the full error but I
> forgot to email it to my private address today and the machine is in
> corporate lockdown mode, so I can't access it right now, but I can
> obtain it tomorrow at work if anybody would like to see the full
> message.]  The way to fix it, for me anyway, was to modify the
> definition of LIBBFD_LINK in config/Makefile (which started out as
> "-lbfd -ldl") to append to it "-lintl -lz /usr/lib/libiberty.a"; and
> after that everything worked.  I don't know if that constitutes a
> problem with the configure script or just something about how my
> Cygwin is installed, but I wanted to mention it somewhere in case it
> was a bug.
> 
> In addition to that, I have a question: is bytecode compatible across
> operating systems and/or CPU architectures?  In other words, if I
> compile to bytecode on Linux/x86, can I run that using ocamlrun on
> Windows/x86 or Linux/amd64?

Trivial programs: yes. (As "trivial" as the ocaml compiler which uses
the same bytecode to bootstrap on all platforms.) There is a problem
with some libraries, however, because they differ by platform, for
example the unix library (i.e. unix.cma is different on Linux and
Windows).

You can try to work around by linking ad-hoc, but you need the "ocaml"
executable then, e.g.

ocaml unix.cma your_library.cma your_script.ml

which then links with the unix.cma that is locally installed, and
immediately runs the program. At least the module checksums for unix.cma
should be identical on all platforms.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


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

* Re: [Caml-list] OCaml 3.12.0+beta1 on Cygwin 1.7.5
  2010-07-06 21:36 OCaml 3.12.0+beta1 on Cygwin 1.7.5 Taylor Venable
  2010-07-06 22:06 ` [Caml-list] " Gerd Stolpmann
@ 2010-07-07 18:54 ` Romain Beauxis
  1 sibling, 0 replies; 3+ messages in thread
From: Romain Beauxis @ 2010-07-07 18:54 UTC (permalink / raw)
  To: caml-list

	Hi !

Le mardi 6 juillet 2010 16:36:05, Taylor Venable a écrit :
> Hi there, I'm thinking of writing some programs in OCaml to assist a
> custom build infrastructure (currently 95% Tcl, 5% external Lua
> programs) that we use at work.  Since we build on Windows, Mac, and
> Linux I have to make sure that whatever I end up writing works in all
> three.  I haven't written much OCaml in my life, and the little that I
> did was probably five years ago, but any tools I write will have to be
> usable for a while.  So I tried compiling OCaml 3.12.0+beta1 in Cygwin
> 1.7.5 -- the information I found about it seemed to imply that it
> should work.  I put flexdll in the PATH and I was able to use the
> configure script and "make world.opt" with only a single problem:
> there were lots of linker errors when it came to building
> tools/objinfo_helper.exe, symbols like _lbasename, _sch_istable, and
> _objalloc_free could not be found.  [I'd paste the full error but I
> forgot to email it to my private address today and the machine is in
> corporate lockdown mode, so I can't access it right now, but I can
> obtain it tomorrow at work if anybody would like to see the full
> message.]  The way to fix it, for me anyway, was to modify the
> definition of LIBBFD_LINK in config/Makefile (which started out as
> "-lbfd -ldl") to append to it "-lintl -lz /usr/lib/libiberty.a"; and
> after that everything worked.  I don't know if that constitutes a
> problem with the configure script or just something about how my
> Cygwin is installed, but I wanted to mention it somewhere in case it
> was a bug.

I have no clue about cygwin, but there is a branch of the mingw32-ocaml 
crosscompiler package for Debian where ocaml 3.12.1 is ported and that 
is waiting for some testings:
  http://git.debian.org/?p=pkg-ocaml-maint/packages/mingw32-ocaml.git;a=shortlog;h=refs/heads/3.12.0%2Bbeta1

Maybe this can be useful to you ?

Romain


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

end of thread, other threads:[~2010-07-07 18:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-06 21:36 OCaml 3.12.0+beta1 on Cygwin 1.7.5 Taylor Venable
2010-07-06 22:06 ` [Caml-list] " Gerd Stolpmann
2010-07-07 18:54 ` Romain Beauxis

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