Building OpenCog on Ubuntu
THIS PAGE IS OBSOLETE. SEE HERE INSTEAD
Notice: This page needs to be updated to conform to https://github.com/opencog/cogutil.
See Building OpenCog for general instructions. This page is intended to reference issues for building on specific versions of Ubuntu Linux.
It is recommended to use the latest LTS version of Ubuntu. The latest LTS as of July 2014 is Ubuntu 14.04 Trusty Tahr.
Ubuntu 14.04 LTS (Trusty Tahr) Notes
After cloning cogutil, atomspace, and opencog from GitHub, follow these steps:
cd opencog/scripts
./install-debian-dependencies.shThen, in each of the three cloned directories (cogutil, atomspace, and opencog, in that order), enter into the command line:
mkdir build
cd build
cmake ..
make -j6
# make -j6 test # this is optional; atomspace and opencog should have some errors
sudo make install #you'll be prompted for an administrative password, optional for 'opencog' directoryNote for make install: you may want to use checkinstall instead, e.g. (sample below also if you are Using Eclipse CDT):
mkdir -vp cogutil/build atomspace/build opencog/build
cd cogutil/build
cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ..
make -j4
# make -j4 test # this is optional; atomspace and opencog should have some errors
sudo checkinstall --pkgname=cogutil-dev #you'll be prompted for an administrative password
cd ../..
cd atomspace/build
cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ..
make -j4
# make -j4 test # this is optional; atomspace and opencog should have some errors
sudo checkinstall --pkgname=atomspace-dev #you'll be prompted for an administrative password
cd ../..
cd opencog/build
cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ..
make -j4
# make -j4 test # this is optional; atomspace and opencog should have some errors
cd ../..For more verbose instructions, please turn to Installing OpenCog for Noobs#New_instructions.
Ubuntu 13.10 (Saucy Salamander) Notes
Builds normally with libboost1.49-all-dev instead of libboost1.53-all-dev
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 LTS (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 (note: if you want long-term support, Ubuntu 14.04 is a recent LTS), 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 bzrUbuntu 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.04then run
mkdir temp && sudo ./install-packages-opencog-dep.sh tempto install all that opencog needs.
Once installed you can remove temp
sudo rm -fr tempUbuntu 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.10then run
mkdir temp
sudo ./install-packages-opencog-dep.sh tempto install all that opencog needs.
Once installed you can remove temp
sudo rm -fr tempUbuntu 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.04then run
mkdir temp
sudo ./install-packages-opencog-dep.sh tempto 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 tempPlease report any build issues on the #opencog channel at irc.freenode.net.
Manually installing dependencies
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 updateInstall version control & build systems
OpenCog source code is hosted on Github and uses CMake (analogous to GNU autoconf) to manage builds.
sudo aptitude install git cmake binutils-devnote: 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-devnote: 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, e.g. ~/git (which will create ~/git/opencog subdirectory).
git clone https://github.com/opencog/opencogBuild the core
The core includes PLN and MOSES.
Make a working branch (see full git workflow at Development_standards#Git_HOWTO).
cd opencog
git branch my-branch
mkdir build
cd buildConfigure the build
cmake ..Build OpenCog core
make -j4Currently 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.debInstall the cxxtest package
sudo dpkg -i cxxtest_3.10.1-0ubuntu1~dhart1_all.debRe-configure the build
cmake ..Setup OpenCog tests
makeMake & run OpenCog tests
make testnote: tests can be run after building each following section.
Build the documentation
Also available online at [1]
Install the graphviz and doxygen packages.
sudo aptitude install graphviz doxygenConfigure the build
cmake ..Build OpenCog documentation
make doxygenBuild the Scheme interpreter
Install the development packages for Guile (the GNU scheme interpreter).
sudo aptitude install guile-2.0-devRe-configure the build
cmake ..Build OpenCog with Scheme interpreter
makeBuild 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 updateInstall dependencies
sudo aptitude install libxerces-c2-dev liblua5.1-0-dev libluabind-dev libprotobuf-dev protobuf-compilerConfigure the build
cmake ..Build OpenCog Embodiment
makeSee 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
See also: Installing RelEx