00001
00002 OpenCog
00003 -------
00004
00005 OpenCog is a framework for developing and running general-purpose
00006 reasoning systems. It currently consists of only the barest of
00007 essentials.
00008
00009
00010 Prerequisites:
00011 --------------
00012 To build and run OpenCog, the following packages are required. With a
00013 few exceptions, most Linux distributions will have these packages.
00014
00015 Older versions of CMake may not have scripts to find all of these packages,
00016 some needed CMake scripts are included in lib, but others in lib/compat are
00017 provided if you are trying to build with an old version of CMake (although the
00018 best option is to get the latest CMake if possible).
00019
00020 cmake -- a build management tool
00021 http:
00022 Debian/Ubuntu package cmake
00023
00024 cxxtest -- a test framework
00025 http:
00026 (Not originally available in Debian/Ubuntu; get cxxtest
00027 from https:
00028
00029 boost -- a C++ utilities package -
00030 http:
00031 Debian/Ubuntu package libboost-dev
00032 Version 1.35 or greater is required for embodiment
00033
00034 expat -- an XML parsing library -
00035 http:
00036 Debian/Ubuntu package libexpat1-dev
00037 Alternatively Debian/Ubuntu package libxmltok1-dev
00038 (supplies expat v1.2) Version 2 seems to work as well.
00039 http:
00040
00041 guile -- Embedded scheme interperter
00042 http:
00043 Version 1.8.6 is required.
00044 Debian/Ubuntu package guile-1.8-dev
00045
00046 unixODBC -- Generic SQL Database client access libraries
00047 http:
00048 Debian/Ubuntu packages unixodbc-dev
00049
00050 libgsl -- The GNU Scientific Library
00051 Debian/Ubuntu package libgsl0-dev
00052
00053 xercesc -- Apache Xerces-C++ XML Parser
00054 Debian/Ubuntu packages libxerces-c28 and libxerces-c2-dev
00055
00056 Lua -- Lua programming language
00057 http:
00058 Debian/Ubuntu package liblua5.1-dev
00059
00060 Luabind -- Binding between C++ and Lua
00061 http:
00062 0.8.1 or later) (Not originally available in Debian/Ubuntu;
00063 get libluabind-dev from
00064 https:
00065
00066 HyperTable -- Distributed storage.
00067 Optional package, needed only for experimental support.
00068 http:
00069 This requires SIGAR as well.
00070
00071 OpenGL -- Open Graphics Library
00072 Optional package
00073 Required by opencog/spatial/MapTool
00074 info: http:
00075 Commonly provided with your video card driver
00076
00077 SDL -- Simple DirectMedia Layer
00078 Optional package
00079 Required by opencog/spatial/MapTool
00080 http:
00081 Debian/Ubuntu package libsdl1.2-dev
00082
00083 SDL_gfx -- Simple DirectMedia Layer extension
00084 Optional package
00085 Required by opencog/spatial/MapTool
00086 http:
00087 Debian/Ubuntu package libsdl-gfx1.2-dev
00088
00089 To build opencog:
00090 -----------------
00091 Peform the following steps at the shell prompt:
00092
00093 cd to project root dir
00094 mkdir bin
00095 cd bin
00096 cmake -DCMAKE_BUILD_TYPE=Release ..
00097 make
00098
00099 Libraries will be built into subdirectories within bin, mirroring the
00100 structure of the source directory root. The flag -DCMAKE_BUILD_TYPE=Release
00101 results in binaries that are optimized for for performance; ommitting
00102 this flag will result in faster builds, but slower executables.
00103
00104
00105 Unit tests:
00106 -----------
00107 To build and run the unit tests, from the ./bin directory enter (after
00108 building opencog as above):
00109
00110 make test
00111
00112
00113 Running the server:
00114 -------------------
00115 The cogserver provides a simple server interface to the reasoning
00116 system.
00117
00118 See CommandRequestProcessor.cc as an example control interface to
00119 the server. This command processor understands 3 simple commands:
00120 load <xml file name>, ls and shutdown. There is an example XML file
00121 under tests/server/atomSpace.xml
00122
00123 To run a simple test, build everything and execute
00124 bin/opencog/server/cogserver. Then, from another terminal, run
00125 "telnet localhost 17001". Try loading the example XML file and ls
00126 to see all the nodes and links.
00127
00128
00129 Config file
00130 -----------
00131 The operation of the server can be altered by means of a config file.
00132 This config file is in lib/opencog.conf. To make use of it, say
00133 "cogserver -c <config-filename>" when starting the server.
00134
00135
00136 Scheme shell
00137 ------------
00138 The cog server also includes a built-in scheme shell. The shell can be
00139 started by typing "scm" after entering the opencog server shell. It can
00140 be exited by placing a single . on a line by itself. This shell allows
00141 opencog atoms and truth values to be created, manipulated and destroyed
00142 using a very simple but powerful interface. Examples and documentation
00143 for the available OpenCog commands can be found in src/guile/README.
00144
00145
00146 Modifying the list of basic types
00147 ---------------------------------
00148 See the example under ./examples/atomtypes
00149
00150
00151 CMake notes
00152 -----------
00153 Some useful CMake's web sites/pages:
00154
00155 - http://www.cmake.org (main page)
00156 - http://www.cmake.org/Wiki/CMake_Useful_Variables
00157 - http://www.cmake.org/Wiki/CMake_Useful_Variables/Get_Variables_From_CMake_Dashboards
00158 - http://www.cmake.org/Wiki/CMakeMacroAddCxxTest
00159 - http://www.cmake.org/Wiki/CMake_HowToFindInstalledSoftware
00160
00161
00162 The main CMakeLists.txt currently sets -DNDEBUG. This disables Boost
00163 matrix/vector debugging code and safety checks, with the benefit of
00164 making it much faster. Boost sparse matrixes and (dense) vectors are
00165 currently used by ECAN's ImportanceDiffusionAgent. If you use Boost
00166 ublas in other code, it may be a good idea to at least temporarily
00167 unset NDEBUG. Also if the Boost assert.h is used it will be necessary
00168 to unset NDEBUG. Boost ublas is intended to respond to a specific
00169 BOOST_UBLAS_NDEBUG, however this is not available as of the current
00170 Ubuntu standard version (1.34).
00171
00172 -Wno-deprecated is currently enabled by default to avoid a number of
00173 warnings regarding hash_map being deprecated (because the alternative
00174 is still experimental!)
00175
00176