miller/doc/content-for-build.html
2015-10-26 21:39:31 -04:00

159 lines
7.3 KiB
HTML

POKI_PUT_TOC_HERE
<h1>Prebuilt executables</h1>
<p/> Please see <a href="https://github.com/johnkerl/miller/releases">
https://github.com/johnkerl/miller/releases</a> where there are builds for OSX
Yosemite, Linux i686 (statically linked), and Linux x86-64 (dynamically
linked).
<p/> Homebrew installation support for OSX is available via
<tt>brew update &amp;&amp; brew install miller</tt>.
<p/> You may already have <tt>mlr</tt> available in your platform&rsquo;s
package manager on NetBSD, Debian Linux, Arch Linux, or perhaps other distributions.
<h1>Building from source</h1>
<h2>From release tarball using autoconfig</h2>
<p/>Miller allows you the option of using GNU autoconfigure to build portably.
<ul>
<li/> Install the <tt>flex</tt> package using your system&rsquo;s package
manager (<tt>apt-get</tt>, <tt>yum install</tt>, etc.).
<li/> Obtain <tt>mlr-i.j.k.tar.gz</tt> from <a
href="https://github.com/johnkerl/miller/tags">https://github.com/johnkerl/miller/tags</a>,
replacing <tt>i.j.k</tt> with the desired release, e.g. <tt>2.2.1</tt>.
<li/> <tt>tar zxvf mlr-i.j.k.tar.gz</tt>
<li/> <tt>cd mlr-i.j.k</tt>
<li> Various configuration options of your choice, e.g.
<ul>
<li/> <tt>./configure</tt>
<li/> <tt>./configure --prefix=/usr/local</tt>
<li/> <tt>./configure --prefix=$HOME/pkgs</tt>
<li/> <tt>./configure CC=clang</tt>
<li/> <tt>./configure --disable-shared</tt> (to make a statically linked executable)
<li/> <tt>./configure 'CFLAGS=-Wall -std=gnu99 -O3'</tt>
<li/> etc.
</ul>
<li/> <tt>make</tt> creates the <tt>c/mlr</tt> executable
<li/> <tt>make check</tt>
<li/> <tt>make install</tt> copies the <tt>c/mlr</tt> executable to your prefix&rsquo;s <tt>bin</tt> subdirectory.
</ul>
<h2>From git clone using autoconfig</h2>
<ul>
<li/> Install the following packages using your system&rsquo;s package manager
(<tt>apt-get</tt>, <tt>yum install</tt>, etc.):
<tt>automake autoconf libtool flex</tt>
<li/> <tt>git clone https://github.com/johnkerl/miller</tt>
<li/> <tt>cd miller</tt>
<li/> <tt>autoreconf -fiv</tt>
<li/> Then continue from <tt>./configure</tt> as above.
</ul>
<h2>Creating a release tarball</h2>
<ul>
<li/> Proceed from git-clone as above.
<li/> Then edit the package version at the top of <tt>configure.ac</tt> as well as <tt>c/mlrvers.h</tt>.
<li/> Then <tt>make distcheck</tt>.
</ul>
<h2>Without using autoconfig</h2>
<p/> GNU autoconfig is familiar to many users, and indeed plenty of folks won&rsquo;t bother to use an open-source
software package which doesn&rsquo;t have autoconfig support. And this is for good reason: GNU autoconfig allows
us to build software on a wide diversity of platforms. For this reason I&rsquo;m happy that Miller supports
autoconfig.
<p/>But, many others (myself included!) find autoconfig confusing: if it works
without errors, great, but if not, the <tt>./configure &amp;&amp; make</tt>
output can be exceedingly difficult to decipher. And this also can be a
turn-off for using open-source software: if you can&rsquo;t figure out the
build errors, you may just keep walking. For this reason I&rsquo;m happy that
Miller allows you to build without autoconfig. (Of course, if you have any
build errors, feel free to contact me at
<a href="mailto:kerl.john.r+miller@gmail.com">kerl.john.r+miller@gmail.com</a>,
&mdash; or, better, open an issue with &ldquo;New Issue&rdquo; at
<a href="https://github.com/johnkerl/miller/issues">
https://github.com/johnkerl/miller/issues</a>.)
<p/>Steps:
<ul>
<li/> Obtain a release tarball or git clone.
<li/> <tt>cd</tt> into the <tt>c</tt> subdirectory.
<li/> Edit the <tt>INSTALLDIR</tt> in <tt>Makefile.no-autoconfig</tt>.
<li/> To change the C compiler, edit the <tt>CC=</tt> lines in
<tt>Makefile.no-autoconfig</tt> and <tt>dsls/Makefile.no-autoconfig</tt>.
<li/> <tt>make -f Makefile.no-autoconfig</tt> creates the <tt>mlr</tt>
executable and runs unit/regression tests (i.e. the equivalent of both
<tt>make</tt> and <tt>make check</tt> using autoconfig).
<li/> <tt>make install</tt> copies the <tt>mlr</tt> executable to your install directory.
</ul>
<p/>The <tt>Makefile.no-autoconfig</tt> is simple: little more than <tt>gcc
*.c</tt>. Customzing is less automatic than autoconfig, but more transparent.
I expect this makefile to work with few modifications on a large fraction of
modern Linux/BSD-like systems: I&rsquo;m aware of successful use with
<tt>gcc</tt> and <tt>clang</tt>, on Ubuntu 12.04 LTS, SELinux, Darwin (MacOS
Yosemite), and FreeBSD.
<h1>In case of problems</h1>
<p/> If you have any build errors, feel free to contact me at <a
href="mailto:kerl.john.r+miller@gmail.com">kerl.john.r+miller@gmail.com</a>,
&mdash; or, better, open an issue with &ldquo;New Issue&rdquo; at
<a href="https://github.com/johnkerl/miller/issues">
https://github.com/johnkerl/miller/issues</a>.
<h1>Dependencies</h1>
<h2>Required external dependencies</h2>
<p/> These are necessary to produce the <tt>mlr</tt>
executable.
<ul>
<li/> <tt>gcc</tt>, <tt>clang</tt>, etc. (or presumably other compilers; please
open an issue or send me a pull request if you have information for me about
other 21st-century compilers)
<li/> The standard C library
<li/> <tt>flex</tt>
<li/> <tt>automake</tt>, <tt>autoconf</tt>, and <tt>libtool</tt>, if you build with autoconfig
</ul>
<h2>Optional external dependencies</h2>
This documentation pageset is built using <boldmaroon>Poki</boldmaroon>:
<a href="http://johnkerl.org/poki/doc">docs here</a>,
<a href="https://github.com/johnkerl/poki">source code here</a>.
Note that <a href="http://johnkerl.org/miller/doc/index.html">http://johnkerl.org/miller/doc/index.html</a>
is nothing more than Miller&rsquo;s <tt>doc</tt> directory served up by a web server.
You&rsquo;ll need <tt>poki</tt> if you modify documents, or if you modify the code in a way that affects the documents
(there are auto-run snippets inserted into the doc).
The best way to discover this is to run <tt>make install</tt> as above, then run <tt>poki</tt> in Miller&rsquo;s
<tt>doc</tt> subdirectory, then run <tt>git diff</tt> to see if docs were affected
by the code mod. (If so, commit and push them.)
<h2>Internal dependencies</h2>
These are included within the <a href="https://github.com/johnkerl/miller">Miller source tree</a> and do not
need to be separately installed (and in fact any separate installation will not be picked up in the Miller build):
<ul>
<li/><a href="http://en.wikipedia.org/wiki/Mersenne_Twister">Mersenne Twister</a> for pseudorandom-number
generation: <a href="https://github.com/johnkerl/miller/blob/master/c/lib/mtrand.c">C implementation by Nishimura and Matsumoto</a> with license terms respected.
<li/> <a href="http://www.jera.com/techinfo/jtns/jtn002.html">MinUnit</a> for unit-testing,
with as-is-no-warranty license <a href="http://www.jera.com/techinfo/jtns/jtn002.html#License">http://www.jera.com/techinfo/jtns/jtn002.html#License</a>,
<a href="https://github.com/johnkerl/miller/blob/master/c/lib/minunit.h">
https://github.com/johnkerl/miller/blob/master/c/lib/minunit.h</a>.
<li/> The <a href="http://www.hwaci.com/sw/lemon/">Lemon parser-generator</a>, the author of which
<a href="https://github.com/johnkerl/miller/blob/master/c/dsls/lemon.c">explicitly disclaims
copyright</a>.
</ul>
<h1>License</h1>
<p/>Two-clause BSD license <a href="https://github.com/johnkerl/miller/blob/master/LICENSE.txt">
https://github.com/johnkerl/miller/blob/master/LICENSE.txt</a>.