Difference between revisions of "OCamlInstall"

From Baka-Tsuki
Jump to navigation Jump to search
(Omake URL update)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
This page describes how to build RLDev on a Windows machine. Last updated 2011-05-22. (Old instructions are in the [http://www.baka-tsuki.org/project/index.php?title=OCamlInstall&oldid=83036 archive])
= OCaml Install for working on RLdev =
 
== Basics ==
 
The development environment for RLdev on Windows is (as taken from the INSTALL file):
 
   
  +
These instructions have been tested on Windows XP Mode (VirtualPC), 32-bit. Based on the modified version of RLDev from the Clannad project. Anecdotal evidence suggests that RLDev won't work on a 64-bit OS.
* Cygwin
 
* Objective Caml 3.09
 
* Findlib
 
* Omake 0.9.6.8
 
* ExtLib 1.4 or later
 
* Ulex
 
* XML Light
 
* libpng 1.2
 
   
  +
<pre>
Luckly these can be installed very easily if you make sure to install the right version of GODI.
 
  +
== DOWNLOAD TOOLS ==
  +
1) Get 7-zip, to extract .tar.gz archives (search www.7-zip.org)
  +
2) Get TortoiseSVN, to download RLDev source code (http://tortoisesvn.net/downloads.html)
  +
3) Get Cygwin's setup file, to install Cygwin to use RLDev (http://cygwin.com/setup.exe)
   
  +
== DOWNLOAD FILES ==
* Zeik: "I personally have found that with recent versions Cygwin it's actually easier to NOT use godi at all. Install the required components one by one (individually) and then you will be able to compile SEEN.TXT files easily. I never got the disassembler to work properly though..."
 
  +
OCAML AND LIBRARIES (Note: Newer versions of OCaml and Ulex won't work)
  +
1) Get OCaml 3.09: http://caml.inria.fr/pub/distrib/ocaml-3.09/ocaml-3.09.3.tar.gz
  +
2) Get Findlib 1.2.1: http://download.camlcity.org/download/findlib-1.2.1.tar.gz
  +
3) Get OMake 0.9.6.8: http://web.archive.org/web/20070623190729/mojave.metaprl.org/download/omake/omake-0.9.6.8-1.tar.gz
  +
4) Get ExtLib 1.4: http://sourceforge.net/projects/ocaml-lib/files/extlib/extlib-1.4/extlib-1.4.tgz/download
  +
5) Get Ulex 0.8: http://www.cduce.org/download/old/ulex-0.8.tar.gz
  +
6) Get XML Light 2.2: http://tech.motion-twin.com/zip/xml-light-2.2.zip
   
  +
RLDEV
== Cygwin ==
 
  +
1) Install TortoiseSVN and restart your computer.
Installing Cygwin is a straight forward process. Go to http://www.cygwin.com/ and download setup.exe via the "Install or update
 
  +
2) Right-click on your desktop and select "TortoiseSVN" -> "Repo-browser"
now!" link. Make sure to save this somewhere you will have it in the future. This executable will allow you to install Cygwin packages that you forgot. I recommend making the C:\cygwin folder now, and saving setup.exe there, so you can always know where to find it.
 
  +
3) Enter the RLDev repository URL: http://subversion.assembla.com/svn/clannad/rldev/trunk
  +
4) Right-click on the trunk "trunk" on the left, and select "Export"
  +
5) Enter "C:\RLDevSetup\rldev\" as the Export directort, and click "OK"
   
  +
== PREPARE FILES ==
Start up the install, leave most things at default until you get to pick a mirror. Picking the right mirror is only important if you are not patient. Some are faster than others, and you may need to try several before you find one that is speedy. Click next to come to the package selection screen. Here you choose what unix utilities you want to install. We need to add some:
 
  +
1) Check C:\RLDevSetup\ -- It should alread contain an "rldev" folder
  +
2) Put Cygwin's setup.exe in C:\RLDevSetup
  +
3) Extract all the OCaml library files into C:\RLDevSetup\ocaml-3.09.3\, C:\RLDevSetup\findlib-1.2.1\, etc. (make sure you extract folders with many files inside, not individual .tar files!)
   
  +
== INSTALL CYGWIN + PACKAGES ==
- All of the Devel tree (just click on the circle arrow once, and wait while it catches up)
 
  +
1) Run setup.exe
- Utils -> bc (again just click the circle arrow once next to bc)
 
  +
2) Click "Next"
- Libs -> ncurses
 
  +
3) Choose "Install From Internet"
  +
4) Keep clicking "Next" until you're asked to choose a download site
  +
5) Pick any site; it doesn't really matter (some sites are faster, depending on where you are, but it's hard to tell)
  +
6) You might get an alert telling you that "This is the first time you're installing Cygwin 1.7.x.". Click "OK"
  +
7) Select the following additional packages (click on "skip" to make it display a version number):
  +
All/Devel/binutils
  +
All/Devel/gcc-core
  +
All/Devel/gcc-g++
  +
All/Devel/gcc-mingw-core
  +
All/Devel/libpng14-devel
  +
All/Devel/make
  +
All/Devel/mingw-runtime
  +
All/Interpreters/m4
  +
All/Libs/w32api
   
  +
8) Click "Next" to download and install the packages.
Now keep clicking next until the install is done. This will take a while depending on your connection speed. Now you are ready to install GODI.
 
  +
9) You might encounter an error message; they're likely harmless.
  +
10)Click "Finish"
   
  +
== INSTALL OCAML + LIBRARIES ==
== GODI ==
 
  +
1) Go to C:\cygwin and run Cygwin.bat
GODI is a package manager thingy for OCaml. You should download the latest GODI from http://godi.camlcity.org/godi/index.html . Save this somewhere in your unix tree. I saved it to my home directory for simplicity. Open up a Cygwin termal and extract the GODI download. Make sure to extract it to a path with no space in it. Example "/tmp" is fine, "/cygdrive/c/Temporary\ Files" is bad.
 
  +
2) Call "cd c:" (without quotation marks)
  +
3) Follow the instructions below in the given order, checking the last few lines of each "make" output (it should often say something like "make[1]: Leaving directory XYZ", with no "Error"s.
   
  +
OCAML
Because GODI requires PATH variables with no spaces, we must now modify our .bashrc to reflect this. I am assuming you will install GODI to its default directory, so just add the following lines to your .bashrc:
 
  +
1) Call "cd ocaml-3.09.3"
export PATH=/opt/godi/bin:/opt/godi/sbin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/usr/local/bin
 
  +
2) Call "./configure"
export MANPATH=/opt/godi/man:$MANPATH
 
  +
3) Wait for the configuration to finish. Check that the last line says "** Objective Caml configuration completed successfully **"
export OCAMLLIB=/opt/godi/lib/ocaml/std-lib/
 
  +
4) Call "make world.opt" (go make a cup of coffee; this takes a long time)
Now move into the GODI folder. Run the following commands:
 
  +
5) Call "make install"
bash
 
  +
6) Call "make clean"
./bootstrap --section=3.09
 
If the command completes successfully, run:
 
./bootstrap_stage2
 
With any luck both commands will complete successfully. If they do not, have fun. Sometimes GODI will explain what went wrong, most of the time it will not. It is important that the present working directory have no spaces, I think.
 
   
  +
FINDLIB
Now that GODI is installed we can install the remaining dependencies.
 
  +
1) Call "cd ../findlib-1.2.1/" (to change directory)
  +
2) Call "./configure"
  +
3) Check that the 2nd-last line says "Configuration has been written to Makefile.config"
  +
4) Call "make all"
  +
5) Call "make opt"
  +
6) Call "make install"
  +
7) Call "make clean"
   
  +
OMAKE
Run the following commands:
 
  +
1) Call "cd ../omake-0.9.6.8/"
godi_build godi-extlib
 
  +
2) Call "make install"
godi_build godi-ulex
 
godi_build godi-xml-light
 
If these all installed you are have one more dependency to build.
 
   
  +
EXTLIB
==OMake==
 
  +
1) Call "cd ../extlib-1.4/"
Download the .tar.gz version 0.9.6.8 from http://omake.metaprl.org/download.html . Extract the file. Enter the extracted directed and run:
 
  +
2) Call "ocaml install.ml" (to start installation)
make install
 
  +
3) Enter "2" (Choose native installation)
It should build and install omake.
 
  +
4) Enter "N" (Choose no documentation)
   
  +
ULEX
== RLdev ==
 
  +
1) Call "cd ../ulex-0.8/"
Grab RLdev however you wish. Move into the src directory, and run:
 
  +
2) Call "make all.opt"
omake
 
omake install
+
3) Call "make install"
  +
4) Call "make clean"
It should build successfully if all the previous steps went okay. The executables are now available to the Cygwin environment.
 
  +
  +
XML-LIGHT
  +
1) Call "cd ../xml-light/"
  +
2) Call "make install". You might see an error, "No rule to make target `xml_parser.cmi', needed by `xml parser.cmo'.", but...
  +
3) Just keep calling "make install" until it only displays a line that starts with "cp xml-light.cmxa [...]"
  +
4) Call "make clean"
  +
  +
== INSTALL RLDEV ==
  +
1) Call "cd ../rldev/src/"
  +
2) Call "omake"
  +
3) Call "omake install"
  +
  +
== USING RLDEV ==
  +
1) Launch Cygwin.bat
  +
2) Call "cd c:" to access your C:\ drive
  +
3) Navigate (using "cd") to your game files, and call "kprl", "rlc", "vaconv", etc.
  +
</pre>

Latest revision as of 00:10, 4 April 2016

This page describes how to build RLDev on a Windows machine. Last updated 2011-05-22. (Old instructions are in the archive)

These instructions have been tested on Windows XP Mode (VirtualPC), 32-bit. Based on the modified version of RLDev from the Clannad project. Anecdotal evidence suggests that RLDev won't work on a 64-bit OS.

== DOWNLOAD TOOLS ==
  1) Get 7-zip, to extract .tar.gz archives (search www.7-zip.org)
  2) Get TortoiseSVN, to download RLDev source code (http://tortoisesvn.net/downloads.html)
  3) Get Cygwin's setup file, to install Cygwin to use RLDev (http://cygwin.com/setup.exe)

== DOWNLOAD FILES ==
  OCAML AND LIBRARIES (Note: Newer versions of OCaml and Ulex won't work)
  1) Get OCaml 3.09:    http://caml.inria.fr/pub/distrib/ocaml-3.09/ocaml-3.09.3.tar.gz
  2) Get Findlib 1.2.1: http://download.camlcity.org/download/findlib-1.2.1.tar.gz
  3) Get OMake 0.9.6.8: http://web.archive.org/web/20070623190729/mojave.metaprl.org/download/omake/omake-0.9.6.8-1.tar.gz
  4) Get ExtLib 1.4:    http://sourceforge.net/projects/ocaml-lib/files/extlib/extlib-1.4/extlib-1.4.tgz/download
  5) Get Ulex 0.8:      http://www.cduce.org/download/old/ulex-0.8.tar.gz
  6) Get XML Light 2.2: http://tech.motion-twin.com/zip/xml-light-2.2.zip

  RLDEV
  1) Install TortoiseSVN and restart your computer.
  2) Right-click on your desktop and select "TortoiseSVN" -> "Repo-browser"
  3) Enter the RLDev repository URL: http://subversion.assembla.com/svn/clannad/rldev/trunk
  4) Right-click on the trunk "trunk" on the left, and select "Export"
  5) Enter "C:\RLDevSetup\rldev\" as the Export directort, and click "OK"

== PREPARE FILES == 
  1) Check C:\RLDevSetup\ -- It should alread contain an "rldev" folder
  2) Put Cygwin's setup.exe in C:\RLDevSetup
  3) Extract all the OCaml library files into C:\RLDevSetup\ocaml-3.09.3\, C:\RLDevSetup\findlib-1.2.1\, etc. (make sure you extract folders with many files inside, not individual .tar files!)

== INSTALL CYGWIN + PACKAGES ==
  1) Run setup.exe
  2) Click "Next"
  3) Choose "Install From Internet"
  4) Keep clicking "Next" until you're asked to choose a download site
  5) Pick any site; it doesn't really matter (some sites are faster, depending on where you are, but it's hard to tell)
  6) You might get an alert telling you that "This is the first time you're installing Cygwin 1.7.x.". Click "OK"
  7) Select the following additional packages (click on "skip" to make it display a version number):
        All/Devel/binutils
        All/Devel/gcc-core
        All/Devel/gcc-g++
        All/Devel/gcc-mingw-core
        All/Devel/libpng14-devel
        All/Devel/make
        All/Devel/mingw-runtime
        All/Interpreters/m4
        All/Libs/w32api

  8) Click "Next" to download and install the packages.
  9) You might encounter an error message; they're likely harmless.
  10)Click "Finish"

== INSTALL OCAML + LIBRARIES ==
  1) Go to C:\cygwin and run Cygwin.bat
  2) Call "cd c:" (without quotation marks)
  3) Follow the instructions below in the given order, checking the last few lines of each "make" output (it should often say something like "make[1]: Leaving directory XYZ", with no "Error"s.

  OCAML
  1) Call "cd ocaml-3.09.3"
  2) Call "./configure"
  3) Wait for the configuration to finish. Check that the last line says "** Objective Caml configuration completed successfully **"
  4) Call "make world.opt" (go make a cup of coffee; this takes a long time)
  5) Call "make install"
  6) Call "make clean"

  FINDLIB
  1) Call "cd ../findlib-1.2.1/" (to change directory)
  2) Call "./configure"
  3) Check that the 2nd-last line says "Configuration has been written to Makefile.config"
  4) Call "make all"
  5) Call "make opt"
  6) Call "make install"
  7) Call "make clean"

  OMAKE
  1) Call "cd ../omake-0.9.6.8/"
  2) Call "make install"

  EXTLIB
  1) Call "cd ../extlib-1.4/"
  2) Call "ocaml install.ml" (to start installation)
  3) Enter "2" (Choose native installation)
  4) Enter "N" (Choose no documentation)

  ULEX
  1) Call "cd ../ulex-0.8/"
  2) Call "make all.opt"
  3) Call "make install"
  4) Call "make clean"

  XML-LIGHT
  1) Call "cd ../xml-light/"
  2) Call "make install". You might see an error, "No rule to make target `xml_parser.cmi', needed by `xml parser.cmo'.", but...
  3) Just keep calling "make install" until it only displays a line that starts with "cp xml-light.cmxa [...]"
  4) Call "make clean"

== INSTALL RLDEV ==
  1) Call "cd ../rldev/src/"
  2) Call "omake"
  3) Call "omake install"

== USING RLDEV ==
  1) Launch Cygwin.bat
  2) Call "cd c:" to access your C:\ drive
  3) Navigate (using "cd") to your game files, and call "kprl", "rlc", "vaconv", etc.