== Requirements: == ==== LAAS/OpenRobots tools ==== * [[mkdep]] * [[pocolibs]] * [[editline|libedit]] (on platform that don't provide it, ie Linux, Solaris) * [[eltclsh]] * [[genom]] ==== External tools ==== These tools are generally available on most systems. If not, download them from the indicated web sites. * [[http://www.gnu.org/software/autoconf/|autoconf]] version 2.59 or later * [[http://www.gnu.org/software/make/|make]] version 3.79 or later * [[http://pkgconfig.freedesktop.org/|pkgconfig]] version 0.15 or later (Usually part of Gnome development packages). * [[http://www.gnu.org/software/groff/groff.html|groff]] 1.10 or later (Usually part of system packages). * [[http://www.tcl.tk/|Tcl/Tk]] 8.0 or later development files (for eltclsh). === User environment: === Three environment variables need to be set in order to use the OpenRobots tools, when they are installed in a specific directory (ie not directly in {{{/usr}}}). For instance at LAAS we install all the softwares in {{{/usr/local/openrobots}}}. Is is this value, {{{${prefix}}}}, which is given to the option {{{--prefix}}} for GNU configure script. By default, the path for the architecture-dependent files, {{{${exec_prefix}}}}, is equal to {{{${prefix}}}}. However, this path can also be explicitely specified using the option {{{--exec-prefix}}} (eg, {{{${prefix}/i386-linux}}}). It can be usefull if you compile for different architectures. * '''{{{PATH}}}''': add {{{${exec_prefix}/bin}}} to your {{{PATH}}} environment variable. * '''{{{PKG_CONFIG_PATH}}}''': add {{{${exec_prefix}/lib/pkgconfig}}} to your {{{PKG_CONFIG_PATH}}} environment variable, or set it to this value if it was not already defined. * '''{{{LD_LIBRARY_PATH}}}''': add {{{${exec_prefix}/lib:${exec_prefix}/lib/openprs}}} to your {{{LD_LIBRARY_PATH}}} environment variable, or set it to this value if it was not already defined. == Quick start guide == === For a new module === 1. write ''module'''''.gen''', ''module'''''Const.h''', ''module'''''Struct.h''' 1. generate empty module + tcl client with {{{genom -i -t module.gen}}} 1. if your module ''foo'' depends on another module ''bar'': * use {{{-Pbar}}} on the genom command line. One '''-P''' for each dependency * or better, you can use the ''require'' directive in the {{{.gen}}} file. 1. create a build dir and cd to it {{{ /configure --prefix=/home//openrobots/installed make make install}}} * This prefix means simply that your executable files will be placed there ''prefix/bin'' === Adding code files === 1. You put your files in codels/ 1. Edit the codels/Makefile.in ,adding at ''codels_src='' the name of these files. === Modyfying a module === * If you just changed the codels files, call {{{ make make install}}} from the build/ directory of the module. * If you just changed the .gen file or the files included in the .gen file ( like Struct.h file ) or codels/Makefile.in then call * {{{ make regen make make install}}} from the ''build/'' directory of the module. === For an existing module, just checked out of git === * generate the module server part once using either : * {{{genom [options] module.gen}}} You need to figure out the correct options for your environment (dependencies, using TCL or OpenPRS, specific defines, etc.). * or {{{genom-regen}}} if your environemnt matches the environment where the module was last generated. Check GENOMFLAGS in autoconf/genom.mk for the list of arguments. * sometimes you need to specify for which robot you compile the module, use the -D option followed by the robot name : {{{genom [options] -DROBOTNAME module.gen}}} * create a build dir and cd to it {{{ /configure --prefix=/home//openrobots/installed make make install}}} === Running the module & a simple client === {{{ h2 init -b Test 1}}} === Running the module & tcl client === {{{ h2 init tclserv -b eltclsh -package genom connect localhost lm mboxInit}}} Now it's ready to send requests: {{{::::}}}.... === End: === In eltclsh: {{{ kill exit}}} You can also use the {{{die}}} command, which kills tclserv and returns from the tcl interpreter * if the module has not been killed in eltclsh: {{{killmodule }}} * {{{killmymodules}}} kills all the modules of a user * if tclserv has not be died in eltclsh: {{{pkill tclserv}}} {{{ h2 end}}}