mirror of https://gitee.com/bigwinds/arangodb
182 lines
12 KiB
HTML
182 lines
12 KiB
HTML
<html><head><title>ArangoDB Manual</title> <style media="screen" type="text/css" style="display:none">body{background-color:white;font:13px Helvetica,arial,freesans,clean,sans-serif;line-height:1.4;color:#333;}#access{font-size:16px;margin-left:12px;display:block;margin-left:10px;margin-right:10px;background-color:#F3F1EE!important;}#access a{border-right:1px solid #DBDEDF;color:#A49F96;display:block;line-height:38px;padding:0 10px;text-decoration:none;}#navigation ul{text-transform:uppercase;list-style:none;margin:0;}#navigation li{float:left;position:relative;}#container{width:920px;margin:0 auto;}a{color:#4183C4;text-decoration:none;}.contents h2{font-size:24px;border-bottom:1px solid #CCC;color:black;}.contents h1{font-size:33px;border-bottom:1px solid #CCC;color:black;}.clearfix:after{content:".";display:block;clear:both;font-size:0;height:0;visibility:hidden;}/**/ *:first-child+html .clearfix{min-height:0;}/**/ * html .clearfix{height:1%;}</style></head><body><div id="container"><img src="images/logo_arangodb.png" width="397" height="67" alt="ArangoDB"><div id="access" role="navigation"><div id="navigation"><ul id="menu-ahome" class="menu"><li><a href="Home.html">Table of contents</a></li> <li><a href="http://www.arangodb.org">ArangoDB homepage</a></li></ul></div><div class="clearfix"></div></div><div>
|
|
<!-- Generated by Doxygen 1.7.5.1 -->
|
|
</div>
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<h1>Compiling ArangoDB from scratch </h1> </div>
|
|
</div>
|
|
<div class="contents">
|
|
<div class="textblock"><p>The following sections describe how to compile and build the ArangoDB from scratch. The ArangoDB will compile on most Linux and Mac OS X systems. It assumes that you use the GNU C++ compiler to compile the source. The ArangoDB has been tested with the GNU C++ compiler, but should compile with any Posix compliant compiler. Please let us know, whether you successfully compiled it with another C++ compiler.</p>
|
|
<p>There are possibilities:</p>
|
|
<ul>
|
|
<li>all-in-one: this version contains the source code of the ArangoDB, all generated files from the autotools, FLEX, and BISON as well as a version of V8, libev and boost</li>
|
|
</ul>
|
|
<ul>
|
|
<li>devel: this version contains the development version of the ArangoDB. Use this branch, if you want to make changes to ArangoDB source.</li>
|
|
</ul>
|
|
<p>The devel version requires a complete development environment, while the all-in-one version allows you to compile the ArangoDB without installing all the prerequisites. The disadvantage is that it takes longer to compile and you cannot make changes to the flex or bison files.</p>
|
|
<hr/>
|
|
<ul>
|
|
<li>
|
|
<a class="el" href="Compiling.html">Compiling ArangoDB from scratch</a> <ul>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingAmazonMicroInstance">Amazon Micro Instance</a> </li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingAIO">All-In-One Version</a> <ul>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingAIOPrerequisites">Basic System Requirements</a> </li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#DownloadSourceAIO">Download the Source</a> </li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingAIOConfigure">Configure</a> </li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingAIOCompile">Compile</a> </li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingAIOTest">Test</a> </li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingAIOInstall">Install</a> </li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingDevel">Devel Version</a> <ul>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingDevelPrerequisites">Basic System Requirements</a> </li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#DownloadSourceDevel">Download the Source</a> </li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingDevelSetup">Setup</a> </li>
|
|
<li>
|
|
<a class="el" href="Compiling.html#CompilingDevelConfigure">Configure</a> </li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<hr/>
|
|
<h2><a class="anchor" id="CompilingAmazonMicroInstance"></a>
|
|
Amazon Micro Instance</h2>
|
|
<p>@sohgoh has reported that it is very easy to install ArangoDB on a Amazon Micro Instance:</p>
|
|
<div class="fragment"><pre class="fragment"> > sudo yum install readline-devel
|
|
> ./configure
|
|
> make
|
|
> make install
|
|
</pre></div><p>For detailed instructions the following section.</p>
|
|
<h2><a class="anchor" id="CompilingAIO"></a>
|
|
All-In-One Version</h2>
|
|
<h3><a class="anchor" id="CompilingAIOPrerequisites"></a>
|
|
Basic System Requirements</h3>
|
|
<p>Verify that your system contains:</p>
|
|
<ul>
|
|
<li>the GNU C++ compiler "g++" and standard C++ libraries</li>
|
|
<li>the GNU make</li>
|
|
</ul>
|
|
<p>In addition you will need the following library:</p>
|
|
<ul>
|
|
<li>the GNU readline library</li>
|
|
</ul>
|
|
<p>Under Mac OS X you also need to install:</p>
|
|
<ul>
|
|
<li>Xcode</li>
|
|
<li>scons</li>
|
|
</ul>
|
|
<h3><a class="anchor" id="DownloadSourceAIO"></a>
|
|
Download the Source</h3>
|
|
<p>Download the latest source using GIT:</p>
|
|
<p><code>git clone git://github.com/triAGENS/ArangoDB.git</code></p>
|
|
<h3><a class="anchor" id="CompilingAIOConfigure"></a>
|
|
Configure</h3>
|
|
<p>Switch into the ArangoDB directory</p>
|
|
<div class="fragment"><pre class="fragment"> cd ArangoDB
|
|
</pre></div><p>In order to configure the build environment execute</p>
|
|
<div class="fragment"><pre class="fragment"> ./configure
|
|
</pre></div><p>to setup the makefiles. This will check the various system characteristics and installed libraries.</p>
|
|
<h3><a class="anchor" id="CompilingAIOCompile"></a>
|
|
Compile</h3>
|
|
<p>Compile the program by executing</p>
|
|
<div class="fragment"><pre class="fragment"> make
|
|
</pre></div><p>This will compile the ArangoDB and create a binary of the server in</p>
|
|
<div class="fragment"><pre class="fragment"> ./bin/arangod
|
|
</pre></div><h3><a class="anchor" id="CompilingAIOTest"></a>
|
|
Test</h3>
|
|
<p>Check the binary by starting it using the command line.</p>
|
|
<div class="fragment"><pre class="fragment"> ./arangod --server.endpoint tcp:<span class="comment">//127.0.0.1:12345 /tmp/vocbase</span>
|
|
</pre></div><p>This will start up the ArangoDB and listen for HTTP requests on port 12345 bound to IP address 127.0.0.1. You should see the startup messages</p>
|
|
<div class="fragment"><pre class="fragment">> ./arangod --server.endpoint tcp://127.0.0.1:12345 /tmp/vocbase
|
|
2012-02-05T13:23:52Z [455] INFO ArangoDB (version 1.x.y) is ready for business
|
|
2012-02-05T13:23:52Z [455] INFO HTTP client port: 12345
|
|
2012-02-05T13:23:52Z [455] INFO Have Fun!
|
|
</pre></div> <p>Use your favorite browser to access the URL</p>
|
|
<div class="fragment"><pre class="fragment"> http:<span class="comment">//127.0.0.1:12345/version</span>
|
|
</pre></div><p>This should produce a JSON object like</p>
|
|
<div class="fragment"><pre class="fragment"> {<span class="stringliteral">"server"</span> : <span class="stringliteral">"arango"</span>, <span class="stringliteral">"version"</span> : <span class="stringliteral">"1.x.y"</span>}
|
|
</pre></div><p>as result.</p>
|
|
<p>Note that starting ArangoDB in this way will result in error messages being displayed, because the paths are not yet set up. This will be corrected in the next step.</p>
|
|
<h3><a class="anchor" id="CompilingAIOInstall"></a>
|
|
Install</h3>
|
|
<p>Install everything by executing</p>
|
|
<div class="fragment"><pre class="fragment"> make install
|
|
</pre></div><p>You must be root to do this or at least have write permission to the corresponding directories.</p>
|
|
<p>The server will by default be installed in</p>
|
|
<div class="fragment"><pre class="fragment"> /usr/sbin/arangod
|
|
</pre></div><p>The configuration file will be installed in</p>
|
|
<div class="fragment"><pre class="fragment"> /etc/arangodb/arangod.conf
|
|
</pre></div><p>The database will be installed in</p>
|
|
<div class="fragment"><pre class="fragment"> /var/arangodb
|
|
</pre></div><p>The arango shell will be installed in</p>
|
|
<div class="fragment"><pre class="fragment"> /usr/bin/arangosh
|
|
</pre></div><h2><a class="anchor" id="CompilingDevel"></a>
|
|
Devel Version</h2>
|
|
<h3><a class="anchor" id="CompilingDevelPrerequisites"></a>
|
|
Basic System Requirements</h3>
|
|
<p>Verify that your system contains</p>
|
|
<ul>
|
|
<li>the GNU C++ compiler "g++" and standard C++ libraries</li>
|
|
<li>the GNU autotools (autoconf, automake)</li>
|
|
<li>the GNU make</li>
|
|
<li>the GNU scanner generator FLEX, at least version 2.3.35</li>
|
|
<li>the GNU parser generator BISON, at least version 2.4</li>
|
|
</ul>
|
|
<p>In addition you will need the following libraries</p>
|
|
<ul>
|
|
<li>libev in version 3 or 4</li>
|
|
<li>Google's V8 engine</li>
|
|
<li>the GNU readline library</li>
|
|
<li>boost header files, at least version 1.33</li>
|
|
</ul>
|
|
<p>To compile Google V8 yourself, you will also need Python 2 and SCons.</p>
|
|
<p>Some distributions, for example Centos 5, provide only very out-dated versions of FLEX, BISON, and the V8 engine. In that case you need to compile newer versions of the programs and/or libraries.</p>
|
|
<p>Install or download the prerequisites</p>
|
|
<ul>
|
|
<li>boost development package (see www.boost.org)</li>
|
|
<li>Google's V8 engine (see code.google.com/p/v8)</li>
|
|
<li>SCons for compiling V8 (see www.scons.org)</li>
|
|
<li>libev (see software.schmorp.de/pkg/libev.html)</li>
|
|
</ul>
|
|
<p>if neccessary. Most linux systems already supply RPM or DEP for these packages. Please note that you have to install the development packages.</p>
|
|
<h3><a class="anchor" id="DownloadSourceDevel"></a>
|
|
Download the Source</h3>
|
|
<p>Download the latest source using GIT:</p>
|
|
<div class="fragment"><pre class="fragment"> git clone git:<span class="comment">//github.com/triAGENS/ArangoDB.git</span>
|
|
</pre></div><h3><a class="anchor" id="CompilingDevelSetup"></a>
|
|
Setup</h3>
|
|
<p>Switch into the ArangoDB directory</p>
|
|
<div class="fragment"><pre class="fragment"> cd ArangoDB
|
|
</pre></div><p>The source tarball contains a pre-generated "configure" script. You can regenerate this script by using the GNU auto tools. In order to do so, execute</p>
|
|
<div class="fragment"><pre class="fragment"> make setup
|
|
</pre></div><p>This will call aclocal, autoheader, automake, and autoconf in the correct order.</p>
|
|
<h3><a class="anchor" id="CompilingDevelConfigure"></a>
|
|
Configure</h3>
|
|
<p>In order to configure the build environment execute</p>
|
|
<div class="fragment"><pre class="fragment"> ./configure --disable-all-in-one-v8 --disable-all-in-one-libev --enable-bison --enable-flex
|
|
</pre></div><p>to setup the makefiles. This will check for the various system characteristics and installed libraries. If the configure scripts fail to find the boost library, check that C++ is installed and working and that the boost-devel package was successfully installed.</p>
|
|
<p>Now continue with <a class="el" href="Compiling.html#CompilingAIOCompile">Compile</a>.</p>
|
|
<p>The following configuration options exists:</p>
|
|
<p><code>--disable-all-in-one-boost</code> tells the build system to use the installed system version of BOOST instead of the supplied files in the 3rdParty directory.</p>
|
|
<p><code>--disable-all-in-one-libev</code> tells the build system to use the installed system version of LIBEV instead of compiling the supplied version from the 3rdParty disable in the make run.</p>
|
|
<p><code>--disable-all-in-one-protobuf</code> tells the build system to use the installed system version of protocol buffers instead of compiling the supplied version from the 3rdParty disable in the make run.</p>
|
|
<p><code>--disable-all-in-one-v8</code> tells the build system to use the installed system version of V8 instead of compiling the supplied version from the 3rdParty disable in the make run.</p>
|
|
<p><code>--enable-bison</code> tells the build system to use the BISON to regenerate the parser files. If disabled, the supplied files be used and you cannot make changes to the parser files. You need at least BISON 2.4.1.</p>
|
|
<p><code>--enable-flex</code> tells the build system to use the FLEX to regenerate the scanner files. If disabled, the supplied files be used and you cannot make changes to the scanner files. You need at least FLEX 2.5.35. </p>
|
|
</div></div>
|
|
</div></body></html>
|