3

I extensively use Cygwin on a Windows 8 environment (I do not want to go ahead and boot/load Linux directly on the machine). I use the OCamlIDE plug-in for Eclipse and have experienced relatively no problems using this workflow setup.

However, I would like to use Batteries so that I may make use of use of its dynamic arrays among a few other interesting features that will speed up my development process.

I have tried this method: http://ocaml.org/install.html, but I get the following error:

$ sh ./opam_installer.sh /usr/local/bin
No file yet for i686:CYGWIN_NT-6.2-WOW64

What am I missing and how would I configure Cygwin so that it can accept the Opam installer? When I tried yet a different way of building Opam, I got:

'i686-w64-mingw32-gcc' is not recognized as an internal or external command,

as a Makefile error and reason for building failure. It seems something is wrong related to mingw32-gcc, what do I need to install and/or configure for my Cygwin to get it to compile/build things properly. I have wget and curl installed as well.

My overall question: What is the best way to get Batteries installed on my system with the minimum of time spent tracing all of its dependencies by hand? Is there a way I can just build the library module, such as BatDynArray and the includes:

include BatEnum.Enumerable
include BatInterfaces.Mappable

That way I can just call them directly in my code with open...;; and/or include...;;;

9codeMan9
  • 802
  • 6
  • 11
  • 25

2 Answers2

3

First of all, include does not do what you think it does. open Batteries should be exactly what you're looking for. OPAM is not yet solid on windows (maybe Thomas could give an update on where things stand).

Frankly, I would recommend to install a linux on a VM, you should be able to get started with OPAM instantly then. Otherwise, take a look at this package manager for OCaml which focuses on cross platform support: http://yypkg.forge.ocamlcore.org/. I've never tried it myself however. The last package manger you could try is GODI, I'm not sure about its windows support though.

Finally, if none of these options work then it should be possible to install batteries from the source. All you need is OCaml and make. And if there are problems with this approach then you should definitely follow up on them either here or on the bug tracker because batteries does intend to support windows AFAIK.

anol
  • 8,264
  • 3
  • 34
  • 78
rgrinberg
  • 9,638
  • 7
  • 27
  • 44
  • 1
    +1 "Install a Linux on a [VM](http://en.wikipedia.org/wiki/Virtual_machine)" i.e. [Virtual Box](https://www.virtualbox.org/), [VMWare](http://www.vmware.com/products/player/overview.html) Personally I dumped Cygwin for VM over a decade ago and never looked back or regretted it. – Guy Coder Apr 02 '13 at 00:30
  • Hmm, a VM is a smart idea actually... it would give me the full benefits of a complete Linux environment rather than an emulation of that environment, and I could switch off to my computer when i don't need the full Linux environ... – 9codeMan9 Apr 03 '13 at 22:36
3

OCaml works beautifully on Windows with WODI, which is a Cygwin-based distribution that includes Batteries and tons of other useful packages (which are a pain to install manually on Windows).

I urge you to take a shot at WODI, which I believe to be an indispensable tool for the rest of us, the forgotten souls, who have to deal with Windows.

Max Mouratov
  • 391
  • 2
  • 11
  • Aaahh, I'm liking what I read....did you have difficulty building it using Cygwin? I have GNU Make installed on my Cygwin, but it seems that even with some packages downloaded from Cygwin's setup menu, I get an annoying message like mentioned in my post about mingw. Since it is claimed to compile with "mingw-w64", did it work or did you have to set up and install your mingw? If so, can you give me directions for correcting the annoying kind of message you get when trying to build awesome packages like what you posted? – 9codeMan9 Apr 07 '13 at 22:51
  • how long did it take you, @Max Mouratov, for the wodiXX.exe to set up? right now it's sitting on my system and the task manager doesn't even show it using any cpu power – 9codeMan9 Apr 08 '13 at 15:31
  • 1
    It recently took me literally 20 minutes to set up WODI, download all the necessary packages (through the WODI package manager) and build several of my projects on Windows. – Max Mouratov Apr 08 '13 at 16:20
  • Which step of the installation process causes you problems? – Max Mouratov Apr 08 '13 at 16:20
  • Try not to reuse the existing Cygwin installation, but to install a new one from scratch with WODI. I use Wodi32 on several computers (running Windows7 and WindowsXP) with no problems at all. – Max Mouratov Apr 08 '13 at 16:24
  • Don't try to install OPAM -- it doesn't work yet on Windows. Use the WODI package manager. – Max Mouratov Apr 08 '13 at 16:27
  • Ah, it just turns out I needed to reboot my computer before running the software-installer...strange issue, but it's working at the moment. THIS IS AWESOME. I just repointed my OCamlIDE config for my eclipse set up to the appropriate new wodi32 ocaml directory and can now access all of the Batteries libraries such as BatDynArray. Thank you, this is incredible for a forgotten Windows-Cygwin soul such as myself. – 9codeMan9 Apr 08 '13 at 21:12
  • Max, you wouldn't happen to know how I can use Wodi's package manager would you? I need to install lablgtk (even tho wodi uses it itself haha) so i can use the library to program my GUI interface. – 9codeMan9 Apr 12 '13 at 16:52
  • 1
    Sure! Just use the GUI :-) "Start -> Applications -> Wodi32 -> Wodi32 Package Manager". Did you install Batteries by hand? :-O – Max Mouratov Apr 15 '13 at 15:30
  • 2
    It seems that Wodi was recently discontinued. It's working very well, so this is really a pity. – Catalin Hritcu May 23 '15 at 01:51
  • Indeed, it simply was the most usable distribution of OCaml for Windows -- the only one with a working package system. Perhaps we could help with keeping it alive (hosting the existing files, at the very least)? I've already tried contacting the author by email, with no success (he seems to have shut down his personal server). – Max Mouratov May 25 '15 at 09:13