Monday, September 6, 2010

Installing Apache Mahout

To start, you need to install the following prerequisites:

* JDK 1.6 or higher
* Ant 1.7 or higher
* If you want to build the Mahout source, Maven 2.0.9 or 2.0.10

You also need this article's sample code (Download), which includes a copy of Mahout and its dependencies. Follow these steps to install the sample code:

1. unzip sample.zip
2. cd apache-mahout-examples
3. ant install

Step 3 downloads the necessary Wikipedia files and compiles the code. The Wikipedia file used is approximately 2.5 gigabytes, so download times will depend on your bandwidth. It also uncompresses the files. You need to have 10 GB of free space.
Occasionally, there may be an error.
You can try commenting the lines of download of 2.5 GB of wiki pages and download them separately with the link given. Then ant install will give you build failed. Do not worry. A folder named Wikipedia would have been created in the apache-mahout-examples directory. If not, create one. Place the downloaded content of wikipedia file there. Do ant install again. Now those files already downloaded will just uncompress and it will take about half an hour. Depending upon your system configuration, this may vary. The result will be installation of mahout.

Sunday, September 5, 2010

Installing ant

First, Please make sure you have the Latest jdk. Currently java1.6 with update 21 would be required.
Now download ant from http://ant.apache.org/
The binary edition of Ant is shipped with 3 different compression formats:

1. .zip - Recommended compression format for Windows, can also be used on other platforms. Supported by many programs and some operating systems natively.
2. .tar.gz - Uses the tar program to gather files together, and gzip to compress and uncompress.
3. .tar.bz2 - Uses the tar program to gather files together, and bzip2 to compress and uncompress..

Choose the format that is best supported for your platform.
Next step would be to extract the folder and place in the directory.
Set environmental variables JAVA_HOME to your Java environment, ANT_HOME to the directory you uncompressed Ant to, and add ${ANT_HOME}/bin (Unix) or %ANT_HOME%/bin (Windows) to your PATH.

Setting up environment Variables.
From the Start Menu, select Start > Settings > Control Panel.
Double-click System to open the System Properties window.
On the Advanced tab, select environmental variables .
Modify each environmental or system variable.
Set the PATH environment variable to include the directory where you installed the Ant bin directory:

1. Find the PATH environment variable in the list. If PATH is not listed, click on New under the System variables section.
2. Type %ANT_HOME%\bin;%JAVA_HOME%\bin;
Important: If there are other variables listed, create a new variable separated by a semicolon. Ensure there are no spaces before or after the semicolon.

Set the ANT_HOME environment variable to the directory where you installed Ant:

1. Click on New under the System variables section.
2. Type ANT_HOME in the variable name field.
3. Type the location where you extracted your ant in the variable value field.

Set the JAVA_HOME environment variable to the directory where you installed the J2SE SDK application:

1. Click on New under the System variables section.
2. Type JAVA_HOME in the variable name field.
3. Type C:\j2sdk1.4.2_13 in the variable value field.

Done!
You've just installed ant. To check, open command prompt and type ant -version.
If it shows you the version of ant you installed, everything went on fine.
Congrats.