5OpenCog is a framework for developing AI systems, especially appropriate
6for integrative multi-algorithm systems, and artificial general intelligence
7systems. Though much work remains to be done,
8it currently contains a functional core framework, and a number of
9cognitive agents at varying levels of completion, some already displaying
10interesting and useful functionalities alone and in combination.
14To build and run OpenCog, the following packages are required. With a
15few exceptions, most Linux distributions will have these packages.
17Older versions of CMake may not have scripts to find all of these packages,
18some needed CMake scripts are included in lib, but others in lib/compat are
19provided if you are trying to build with an old version of CMake (although the
20best option is to get the latest CMake if possible).
22boost -- a C++ utilities package -
24 Debian/Ubuntu package libboost-dev
26cmake -- a build management tool
28 Debian/Ubuntu package cmake
30cxxtest -- a test framework
32 (Not originally available in Debian/Ubuntu; get cxxtest
33 from https://launchpad.net/~dhart/+archive/ppa)
35guile -- Embedded scheme interperter
37 Version 1.8.6 or newer is required.
38 Debian/Ubuntu package guile-1.8-dev
40libgsl -- The GNU Scientific Library
41 Debian/Ubuntu package libgsl0-dev
45The following packages are optional. If they are not installed, some
46optional parts of OpenCog will not be built. The CMake command, during
47the build, will be more precise as to which parts will not be built.
49curl -- cURL groks URLs
50 Optional package
51 Required by opencog/ubigraph
53 Debian/Ubuntu package libcurl4-gnutls-dev
55expat -- an XML parsing library -
56 Optional package, needed for embodiment support.
57 http://www.jclark.com/xml/expat.html (version 1.2)
58 Debian/Ubuntu package libexpat1-dev
59 Alternatively Debian/Ubuntu package libxmltok1-dev
60 (supplies expat v1.2) Version 2 seems to work as well.
63HyperTable -- Distributed storage.
64 Optional package, needed only for experimental support.
66 This requires SIGAR as well.
68MPI -- Message Passing Interface
69 Optional package
70 Required for compute-cluster version of MOSES.
71 Use either MPICHV2 or OpenMPI
73OpenGL -- Open Graphics Library
74 Optional package
75 Required by opencog/spatial/MapTool
76 info: http://www.opengl.org
77 Commonly provided with your video card driver
79SDL -- Simple DirectMedia Layer
80 Optional package
81 Required by opencog/spatial/MapTool
83 Debian/Ubuntu package libsdl1.2-dev
85SDL_gfx -- Simple DirectMedia Layer extension
86 Optional package
87 Required by opencog/spatial/MapTool
89 Debian/Ubuntu package libsdl-gfx1.2-dev
91unixODBC -- Generic SQL Database client access libraries
92 Optional package
93 Required for the distributed-processing atomspace.
95 Debian/Ubuntu packages unixodbc-dev
97xercesc -- Apache Xerces-C++ XML Parser
98 Optional package
99 Requied for embodiment
100 Debian/Ubuntu packages libxerces-c28 and libxerces-c2-dev
102xmlrpc -- XML-RPC support
103 Optional package
104 Required by opencog/ubigraph
106 Debian/Ubuntu package libxmlrpc-c-dev
109To build opencog:
111Peform the following steps at the shell prompt:
113 cd to project root dir
114 mkdir bin
115 cd bin
116 cmake -DCMAKE_BUILD_TYPE=Release ..
119Libraries will be built into subdirectories within bin, mirroring the
120structure of the source directory root. The flag -DCMAKE_BUILD_TYPE=Release
121results in binaries that are optimized for for performance; ommitting
122this flag will result in faster builds, but slower executables.
127To build and run the unit tests, from the ./bin directory enter (after
128building opencog as above):
130 make test
133Running the server:
135The cogserver provides a simple server interface to the reasoning
138See CommandRequestProcessor.cc as an example control interface to
139the server. This command processor understands 3 simple commands:
140load <xml file name>, ls and shutdown. There is an example XML file
143To run a simple test, build everything and execute
144bin/opencog/server/cogserver. Then, from another terminal, run
145"telnet localhost 17001". Try loading the example XML file and ls
146to see all the nodes and links.
151The operation of the server can be altered by means of a config file.
152This config file is in lib/opencog.conf. To make use of it, say
153"cogserver -c <config-filename>" when starting the server.
158The cog server also includes a built-in scheme shell. The shell can be
159started by typing "scm" after entering the opencog server shell. It can
160be exited by placing a single . on a line by itself. This shell allows
161opencog atoms and truth values to be created, manipulated and destroyed
162using a very simple but powerful interface. Examples and documentation
163for the available OpenCog commands can be found in src/guile/README.
164See also the wiki for additional details.
167Modifying the list of basic types
169See the example under ./examples/atomtypes
174Some useful CMake's web sites/pages:
176 - http://www.cmake.org (main page)
177 - http://www.cmake.org/Wiki/CMake_Useful_Variables
178 - http://www.cmake.org/Wiki/CMake_Useful_Variables/Get_Variables_From_CMake_Dashboards
179 - http://www.cmake.org/Wiki/CMakeMacroAddCxxTest
180 - http://www.cmake.org/Wiki/CMake_HowToFindInstalledSoftware
183The main CMakeLists.txt currently sets -DNDEBUG. This disables Boost
184matrix/vector debugging code and safety checks, with the benefit of
185making it much faster. Boost sparse matrixes and (dense) vectors are
186currently used by ECAN's ImportanceDiffusionAgent. If you use Boost
187ublas in other code, it may be a good idea to at least temporarily
188unset NDEBUG. Also if the Boost assert.h is used it will be necessary
189to unset NDEBUG. Boost ublas is intended to respond to a specific
190BOOST_UBLAS_NDEBUG, however this is not available as of the current
191Ubuntu standard version (1.34).
193-Wno-deprecated is currently enabled by default to avoid a number of
194warnings regarding hash_map being deprecated (because the alternative
195is still experimental!)
1Only Util, ComboReduct and MOSES components have been tried to be
2compiled on Cygwin. The only requirement is the Cygwin devel package.
2Instructions for Apple Mac OSX users
5The MacPorts installer does not include /opt/local/lib into the shared
6library search path. Thus, any libraries installed there will fail to
7be found. The search path needs to be fixed manually. This can be done
8by editing ~/.profile and specifying
10 export DYLD_LIBRARY_PATH=/opt/local/lib:$DYLD_LIBRARY_PATH
12A dynamic library search path failure will manifest itself with this
16 Searching for config in default locations...
17 Found ../lib/opencog.conf
18 loaded configuration from file "../lib/opencog.conf"
19 File: ../opencog/scm/utilities.scm line: 9
20 ERROR: In procedure dynamic-link:
21 ERROR: file: "libguile-srfi-srfi-1-v-3", message: "file not found"
22 ABORT: misc-error
24Proper operation can be confirmed with opencog, or by invoking guile on
25the command line:
27 $ guile
28 guile> (use-modules (srfi srfi-1))
31The above should not generate any errors when the shared libary load
32path is correctly configured.
1OpenCog is very easy to build under Ubuntu. Just follow this page
5Below is a just copy/paste of it (Nov 18 2010)
9Building OpenCog on Ubuntu
12There are two options if you are on Ubuntu, you can either use the setup scripts from the Cogbuntu release, or you can manually download and install the various depedencies...
16 * 1 Use Cogbuntu scripts
17 o 1.1 Ubuntu 10.10
18 o 1.2 Ubuntu 10.04
19 o 1.3 Ubuntu 9.10
20 * 2 Manually installing depedencies
21 o 2.1 Install version control & build systems
22 o 2.2 Install the core libraries
23 o 2.3 Get the source code
24 * 3 Build the core
25 * 4 Build & run tests
26 * 5 Build the documentation
27 * 6 Build the Scheme interpreter
28 * 7 Build the Embodiment base system
29 * 8 Build the Embodiment proxy to Metaverse
30 * 9 Build the Embodiment question-answering support
32Use Cogbuntu scripts
34The Cogbuntu scripts are on launchpad at:
38You'll need bzr to download them:
40 sudo aptitude install bzr
44If you checkout revision 29, you get all you need to install all dependencies for OpenCog on Ubuntu 10.10 So:
46bzr branch -r29 lp:~opencog-dev/opencog/cogbuntu cogbuntu-10.10
52sudo ./add-apt-repo.sh && sudo ./install-packages-opencog-dep.sh temp
54to install all that opencog needs. Beware that: add-apt-repo.sh is gonna add some Karmic packages repo in /etc/apt/sources.list.
57If you checkout revision 26, you get all you need to install all dependencies for OpenCog on Ubuntu 10.04 So:
59bzr branch -r26 lp:~opencog-dev/opencog/cogbuntu cogbuntu-10.04
65sudo ./add-apt-repo.sh && sudo ./install-packages-opencog-dep.sh temp
67to install all that opencog needs. Beware that: add-apt-repo.sh is gonna add some Karmic packages repo in /etc/apt/sources.list.
70If you checkout revision 1, you get all you need to install all dependencies for OpenCog on Ubuntu 9.10. So:
72bzr branch -r1 lp:~opencog-dev/opencog/cogbuntu cogbuntu-9.10
79These are instructions for a progressive build of OpenCog on Ubuntu 9.10 (karmic) and Ubuntu 10.04 (lucid).
81Please report any build issues on the #opencog channel at irc.freenode.net.
82Manually installing depedencies
84First insure your repository sources are up to date.
86Open 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.
88Update your package repositories
90sudo aptitude update
92Install version control & build systems
94The OpenCog project uses the Bazaar source code version control system (analogous to SVN or CVS), and the CMake build system (analogous to GNU autoconf).
96sudo aptitude install bzr cmake
98note: 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.
99Install the core libraries
101OpenCog uses the Boost C++ Libraries and the GNU Scientific Library.
103sudo aptitude install libboost-dev libgsl0-dev
105note: 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.
106Get the source code
108Do this in a convenient place, like your home directory or ~/src.
110bzr branch lp:opencog
112Make a local scratch copy
114bzr branch opencog ochack
116Build the core
118The core includes PLN and MOSES.
120Currently parts of OpenCog rely on a hard-coded relative build location, so create your build directory at ochack/bin.
122cd ochack; mkdir bin; cd bin
124Configure the build
128Build OpenCog core
132Currently the OpenCog build system chooses which components to build based upon the existence of certain development packages installed (or not installed) on your system.
133Build & run tests
135OpenCog uses the CxxTest framework (analogous to JUnit).
137Only do the next two steps if you didn't install dependencies with the Cogbuntu scripts...
139Download the cxxtest package:
143Install the cxxtest package
145sudo dpkg -i cxxtest_3.10.1-0ubuntu1~dhart1_all.deb
147Re-configure the build
151Setup OpenCog tests
155Make & run OpenCog tests
159note: tests can be run after building each following section.
161Build the Scheme interpreter
163Install the development packages for Guile (the GNU scheme interpreter).
165sudo aptitude install guile-1.8-dev
167Re-configure the build
171Build OpenCog with Scheme interpreter
175Build the documentation
177Also available online at http://buildbot.opencog.org/doxygen/
179Install the graphviz and doxygen packages.
181sudo aptitude install graphviz doxygen
183Configure the build
187Build OpenCog documentation
191Build the Embodiment base system
193Enable the universe repository by editing /etc/apt/sources.list or ticking the list at System > Administration > Software Sources.
195Update your package repositories
197sudo aptitude update
201sudo aptitude install libxerces-c2-dev
203Configure the build
207Build OpenCog Embodiment
212Build the Embodiment proxy to Metaverse
215Build the Embodiment question-answering support