Building OpenCog (Hands On)

From OpenCog
Jump to: navigation, search

Background

OpenCog is mainly been developed on Ubuntu Linux, and this guide assumes Ubuntu as the build environment.

Instructions on how to install all dependencies and build OpenCog on Mac or inside a virtual machine running Linux can be found on this page.
The instructions to setup a Linux build are repeated here in an attempt to get everything in one place.

The source code for OpenCog can be found on its github repository. After installing all dependencies you can clone this repository using git.

Installing dependencies on Linux

Bash scripts are available for installing dependencies in Debian, ArchLinux,Fedora and openSUSE. For Ubuntu see next section. You can get these scripts by opening them in your browser, right-clicking and choosing `Save Page As` option. After saving you can provide execute permission on the script to all users by running:

chmod a+rx <replace_with_script_name>

You can run the fedora and archlinux scripts with -h option to see a list of all options available. For the other two you just have to run the script without any options.

All these scripts are broken into functions and a main program so they are very easy to read and understand if something goes wrong. If you want to read the scripts then start at the bottom after the comment `#Main Program`.

Installing dependencies on Ubuntu

For Ubuntu (>= 14.04) / ElementaryOs a script is available that will install all the dependencies for you. To get this script run:

wget http://raw.github.com/opencog/ocpkg/master/ocpkg -O octool && chmod +rx octool

After running this command the current directory will contain an executable bash script named octool. To see all the options available with this script run:

./octool -h

To get everything that is needed to build OpenCog run:

./octool -rsdpcav -l default

  • Firewalls: It is possible that your Internet connection is using some firewalls. If this is the case, you might have some problems while getting some keys required to add some repositories in apt-get. To get around this there are three ways:
  1. Use some other Internet connection.
  2. Get the key from elsewhere.
  3. Download the dependency separately and install it manually. This will be much harder than the other two methods.
  • Getting help: If you are stuck you can get help by heading over to the google group and posting your problem.

Building OpenCog

After running the scripts above depending on your distro you may already have cloned the OpenCog repository on your system. If this is not the case then you should clone the repository by running:

git clone https://github.com/opencog/opencog 

Now we are ready to build OpenCog. To do this by run the following:

cd opencog
mkdir build
cd build
cmake ..
make -j4
sudo make install

Thats it! If you didn't get any errors then you have installed OpenCog on your system.

Quiz

Notes

Adam, Misgana, Man Hin, Amen