welcome: please sign in

Diff for "DomTool/Building"

Differences between revisions 5 and 13 (spanning 8 versions)
Revision 5 as of 2009-09-27 16:59:52
Size: 4546
Editor: AdamChlipala
Comment: SML/NJ packages
Revision 13 as of 2018-08-11 16:36:04
Size: 4028
Editor: ClintonEbadi
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
== Compilers == DomTool minimally requires an SML compiler, libpcre for regex handling, libssl for communications, and rsync to publish configuration.
Line 7: Line 7:
To compile the standalone DomTool tools, you will need the [[http://mlton.org/|MLton]] [[http://www.standardml.org/|Standard ML]] compiler. It's available as Debian package "mlton". The version in Debian testing works fine, but the stable version is too old, so grab the Debian stable version of the latest release from [[http://mlton.org/Download|the MLton download page]]. For Debian, the following packages are required for a standard build: {{{
mlton libpcre3-dev libssl-dev ml-nlffigen ml-yacc rsync}}}
Line 9: Line 10:
To use DomTool from an interactive SML REPL session, you will need a recent version of [[http://www.smlnj.org/|Standard ML of New Jersey]]. The SML/NJ packages in non-experimental Debian are so old that I don't bother using them, opting to install SML/NJ manually following the directions on the SML/NJ web site. Chances are you can get by just fine without support for interactive REPL use and can skip installing SML/NJ if you don't want it for some other purpose. You may optionally install SML/NJ packages for interactive development: {{{
smlnj libmlnlffi-smlnj}}}

== A Note On Compilers ==

To compile the standalone DomTool tools, you will need the [[http://mlton.org/|MLton]] [[http://www.standardml.org/|Standard ML]] compiler. It's available as Debian package `mlton`.

To use DomTool from an interactive SML REPL session, you will need a recent version of [[http://www.smlnj.org/|Standard ML of New Jersey]]. Version 110.74 is sufficient, so packages in Debian 6 and above are adequate, for other distributions you may need to compile it manually.
Line 13: Line 21:
== Libraries ==

You will need the OpenSSL C library with development files, available in Debian package "libssl-dev".

== Utilities ==

If you plan to run a server (dispatcher or slave), you'll need rsync, which is available in Debian package "rsync".
Line 23: Line 24:
You can obtain the approximately-latest version of the DomTool source code from [[http://sourceforge.net/cvs/?group_id=99567|SourceForge anonymous CVS]]. The module name is `domtool2`. I write "approximately" because it can take about a day for the latest changes to propagate from developer CVS to anonymous CVS. I'll duplicate the directions from that Source``Forge help page and tell you that you can check out this module by running: You can obtain the approximately-latest version of the DomTool source code from [[https://git.hcoop.net/?p=hcoop/domtool2.git;a=summary|HCoop Anonymous Git]]. To clone simply execute:
Line 25: Line 26:
cvs -d:pserver:anonymous@hcoop.cvs.sourceforge.net:/cvsroot/hcoop login
cvs -z3 -d:pserver:anonymous@hcoop.cvs.sourceforge.net:/cvsroot/hcoop co -P domtool2}}}
git clone git://git.hcoop.net/git/hcoop/domtool2.git}}}
Line 28: Line 28:
Just press enter when prompted for a password.

If you have been granted write permission to the repository and plan to commit code changes, then you'll want to check the repo out from developer CVS, like so:
If you have been granted write permission to the repository and plan to commit code changes, then you'll want to check the repo out either via ssh or openafs using an account with credentials to write to the domtool git directory.
Line 32: Line 30:
export CVS_RSH=ssh
cvs -z3 -d:ext:developername@hcoop.cvs.sourceforge.net:/cvsroot/hcoop co -P domtool2}}}
git clone ssh://USER@ssh.hcoop.net/afs/hcoop.net/user/h/hc/hcoop/.hcoop-git/domtool2.git
git clone /afs/hcoop.net/user/h/hc/hcoop/.hcoop-git/domtool2.git}}}
Line 43: Line 41:
Heck, you could even go ahead and set some non-standard configuration values! If you leave it as is, you inherit the defaults, which should be appropriate for HCoop servers. Heck, you could even go ahead and set some non-standard configuration values! If you leave it as is, you inherit the defaults, which should be appropriate for HCoop servers. If you are not installation DomTool at HCoop, see [[DomTool/NonHCoopSetup]] for details on configuring DomTool to run outside of HCoop.
Line 76: Line 74:

You may need to manually `apt-get install` these Debian packages: `ml-nlffigen`, `libmlnlffi-smlnj`, `ml-yacc`

1. Prerequisites

DomTool minimally requires an SML compiler, libpcre for regex handling, libssl for communications, and rsync to publish configuration.

For Debian, the following packages are required for a standard build:

mlton libpcre3-dev libssl-dev ml-nlffigen ml-yacc rsync

You may optionally install SML/NJ packages for interactive development:

smlnj libmlnlffi-smlnj

1.1. A Note On Compilers

To compile the standalone DomTool tools, you will need the MLton Standard ML compiler. It's available as Debian package mlton.

To use DomTool from an interactive SML REPL session, you will need a recent version of Standard ML of New Jersey. Version 110.74 is sufficient, so packages in Debian 6 and above are adequate, for other distributions you may need to compile it manually.

Why am I referencing two different compilers here? Well, developing with SML/NJ and building release binaries with MLton is standard practice in the SML world. SML/NJ supports separate compilation and interactive use, which are very helpful during development. MLton is a whole-program optimizing compiler that produces extremely efficient binaries, at the cost of much greater compile-time time and memory usage than SML/NJ.

2. Getting the source code

You can obtain the approximately-latest version of the DomTool source code from HCoop Anonymous Git. To clone simply execute:

git clone git://git.hcoop.net/git/hcoop/domtool2.git

If you have been granted write permission to the repository and plan to commit code changes, then you'll want to check the repo out either via ssh or openafs using an account with credentials to write to the domtool git directory.

git clone ssh://USER@ssh.hcoop.net/afs/hcoop.net/user/h/hc/hcoop/.hcoop-git/domtool2.git
git clone /afs/hcoop.net/user/h/hc/hcoop/.hcoop-git/domtool2.git

3. Building the standalone tools

First, in the domtool2 directory that you have checked out, create a file config.sml containing:

structure Config :> CONFIG = struct
  open ConfigDefault
end

Heck, you could even go ahead and set some non-standard configuration values! If you leave it as is, you inherit the defaults, which should be appropriate for HCoop servers. If you are not installation DomTool at HCoop, see DomTool/NonHCoopSetup for details on configuring DomTool to run outside of HCoop.

Even if you set configuration parameters until you're blue in the face, this stuff probably won't work very well in environments that don't look much like Linux. Perhaps some day greater portability will become enough of a priority for us to fix that.

Once you have that done, the rest is easy! Just run

make

This will populate domtool2/bin/ with the compiled DomTool programs. As root, run

make install

to copy these programs and some additional scripts to appropriate standard locations. Consult the Makefile if you'd like to see what those locations are ahead of time.

3.1. Reinstalling the standalone tools

If you want to reinstall domtool on machines that are running it already, then it is best to use a slightly modified set of instructions.

First, create a config.sml file as directed above, and run make.

If the current machine is a slave, then run

make install_slave

If the current machine is a server, then run

make install_server

4. Building for SML/NJ

After following the same procedure as above for config.sml, run

make smlnj

followed by

make install

as root. Now you should be able to run sml in the base domtool2 directory and run CM.make "src/domtool.cm";. If you don't see any error messages, then the DomTool modules are loaded and you can start poking them. For instance, running open Main; should print information on the primary entry-points.

DomTool/Building (last edited 2018-08-11 16:36:04 by ClintonEbadi)