Building OpenCog on Ubuntu
From OpenCog
See Building OpenCog for general instructions. This page is intended to reference issues for building on specific versions of Ubuntu Linux.
Ubuntu 12.10 (Quantal Quetzal) Notes
After installing all build dependencies from the standard Ubuntu package repositories, it is necessary to upgrade cython to version 0.17. The cython_0.17.3-1_amd64.deb package built for Ubuntu 13.04 works on Ubuntu 12.10 and can be downloaded from http://archive.ubuntu.com/ubuntu/pool/main/c/cython/.
Ubuntu 12.04 (Precise Pangolin) Notes
The Ocpkg script will download and install all necessary dependencies; the script itself serves as a good reference for requirements of building OpenCog.
Get dependencies
Ubuntu 11+ is recommended because building OpenCog requires gcc/g++ 4.5 or greater. If you really want to build for an earlier version (like 10.04 because you like long-term support), updated packages can be found on the web, e.g., http://www.justsoftwaresolutions.co.uk/news/gcc_4.5_for_ubuntu_lucid.html
Use Cogbuntu scripts
The Cogbuntu scripts are on launchpad at:
https://code.launchpad.net/cogbuntu
You'll need bzr to download them:
sudo apt-get install bzr
Ubuntu 12.04
If you checkout revision 41, you get all you need to install all dependencies for OpenCog on Ubuntu 12.04 So:
bzr branch -r41 lp:cogbuntu cogbuntu-12.04 cd cogbuntu-12.04
then run
mkdir temp && sudo ./install-packages-opencog-dep.sh temp
to install all that opencog needs.
Once installed you can remove temp
sudo rm -fr temp
Ubuntu 11.10
If you checkout revision 40, you get all you need to install all dependencies for OpenCog on Ubuntu 11.10 So:
bzr branch -r40 lp:cogbuntu cogbuntu-11.10 cd cogbuntu-11.10
then run
mkdir temp sudo ./install-packages-opencog-dep.sh temp
to install all that opencog needs.
Once installed you can remove temp
sudo rm -fr temp
Ubuntu 11.04
If you checkout revision 37, you get all you need to install all dependencies for OpenCog on Ubuntu 11.04 So:
bzr branch -r37 lp:cogbuntu cogbuntu-11.04 cd cogbuntu-11.04
then run
mkdir temp sudo ./install-packages-opencog-dep.sh temp
to install all that opencog needs. Beware that this script is gonna compile and install libboost 1.46 (on /usr/local to not overwrite Ubuntu's libboost package in case that one gets installed).
Once installed you can remove temp
sudo rm -fr temp
Please report any build issues on the #opencog channel at irc.freenode.net.
Manually installing depedencies
First insure your repository sources are up to date.
Open a command line, e.g. from Applications > Accessories > Terminal. The boxes below surrounded with dotted lines are commands to be pasted onto the command line.
Update your package repositories
sudo aptitude update
Install version control & build systems
OpenCog source code is hosted on Github and uses CMake (analogous to GNU autoconf) to manage builds.
sudo aptitude install bzr cmake
note: the command above will also install necessary dependencies, such as a C compiler and other libraries and tools. If your system hasn't been used before to build software, it may take many minutes to download and install all dependencies.
Install the core libraries
OpenCog uses the Boost C++ Libraries, the GNU Scientific Library and the Expat XML parsing library.
sudo aptitude install libboost-all-dev libgsl0-dev libexpat1-dev
note: the command above will also install necessary dependencies, such as a C++ compiler and other libraries and tools. If your system hasn't been used before to build software, it may take many minutes to download and install all dependencies.
List of other Debian package names
libboost-date-time-dev libboost-filesystem-dev libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-signals-dev libboost-thread-dev
guile-1.8-dev libxerces-c2-dev libluabind-dev
Get the source code
Do this in a convenient place, like your home directory or ~/src.
bzr branch lp:opencog
Build the core
The core includes PLN and MOSES.
Make a local scratch copy and since parts of OpenCog currently rely on a hard-coded relative build location, create your build directory at ochack/bin.
bzr branch opencog ochack cd ochack mkdir bin cd bin
Configure the build
cmake ..
Build OpenCog core
make
Currently the OpenCog build system chooses which components to build based upon the existence of certain development packages installed (or not installed) on your system.
Build & run tests
OpenCog uses the CxxTest framework (analogous to JUnit).
Only do the next two steps if you didn't install dependencies with the Cogbuntu scripts...
Download the cxxtest package:
wget https://launchpad.net/~dhart/+archive/ppa/+files/cxxtest_3.10.1-0ubuntu1~dhart1_all.deb
Install the cxxtest package
sudo dpkg -i cxxtest_3.10.1-0ubuntu1~dhart1_all.deb
Re-configure the build
cmake ..
Setup OpenCog tests
make
Make & run OpenCog tests
make test
note: tests can be run after building each following section.
Build the documentation
Also available online at http://doxygen.opencog.org/
Install the graphviz and doxygen packages.
sudo aptitude install graphviz doxygen
Configure the build
cmake ..
Build OpenCog documentation
make doxygen
Build the Scheme interpreter
Install the development packages for Guile (the GNU scheme interpreter).
sudo aptitude install guile-1.8-dev
Re-configure the build
cmake ..
Build OpenCog with Scheme interpreter
make
Build the Embodiment base system
Enable the universe repository by editing /etc/apt/sources.list or ticking the list at System > Administration > Software Sources.
If you're using an older version of Ubuntu, you'll need to obtain packages for protobuf-compiler 2.3+. See, for example: https://launchpad.net/~goby-dev/+archive/ppa
Update your package repositories
sudo aptitude update
Install dependencies
sudo aptitude install libxerces-c2-dev liblua5.1-0-dev libluabind-dev libprotobuf-dev protobuf-compiler
Configure the build
cmake ..
Build OpenCog Embodiment
make
See opencog/embodiment/README for instructions on running the Embodiment server using scripts in opencog/scripts/embodiment
Build the Embodiment proxy to Metaverse
TBD
Build the Embodiment question-answering support
uses Relex/NLGen
TBD