Building OpenCog

From OpenCog
Jump to: navigation, search

Linux is the primary development platform for OpenCog. The reference configuration used for continuese integration is Ubuntu 14.04 and it is the recommended platform for development.

Setting Development Environment

These are options for setting development envrionment for working on opencog and it's subprojects.

Linux Host

On systems that have linux os installed, use the appropriate script for installing system dependencies. Distros which have dependency installation scripts are,

octool for ubuntu

For a quick start using Ubuntu version >= 14.04, use octool script.

  • get it by running
wget -O octool && chmod +rx octool
  • Options that are available can be displayed by running
./octool -h
  • To install all dependencies necessary to build OpenCog run
./octool -rsdpcalv
  • To install all dependencies necessary to build AtomSpace and MOSES run
./octool -rdcv
# Optional: For atomspace add -s for installing dependencies for haskell binding.
  • To install all dependencies necessary to build Cogutils run
./octool -rdv

For building opencog or updating it's dependencies scroll to the sections below

Virtual Machine

For using ubuntu in virtual machine managed by vagrant for repo, first install the tools for your os and then follow instruction below under Run Vagrant.

Windows setup

Mac setup

Linux setup

Install virutalbox, git and vagrant. See here on instructions on vagrant installation.

Run Vagrant

Vagrant is only configured for openocg/opencog repository

If you are new to vagrant, see or if you like to understand what vagrant is. Understanding the working of vagrant is not required for contributing to opencog.

The common steps after installing VirtualBox, git and Vagrant for your os and running a bash shell, are:

git clone 
cd opencog/lib
vagrant up
vagrant ssh
# do your thing
vagrant halt

For building opencog or updating it's dependencies scroll to the sections below


For using containers managed by docker, follow instructions here.

For building opencog or updating its dependencies scroll to the sections below

Other options


Build OpenCog using the following commands after moving to the root of the three cloned directories (cogutils, atomspace, optionally moses, and opencog, in that order) or the corresponding directories in your vagrant/docker setup:

mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install

If you are using octool from the git clone directory, run

./octool -b

Updating Dependencies

To update your opencog's sub-project installations(cogutils, link-grammar and atomsapce), as they are in a continues state of development, you will need to run these series of commands, once/multiple times a week/day depending on what type of fun you are having with opencog, from your git clone.

If you are using octool, run

./octool -cal


For backing up contents of an atomspace


See instructions here

  • If you are using octool then use -rd option for installing dependencies.
  • If you are using docker full configuration are done for you.