Yarp: Running programs that use the YARP language bindings? #15

Created on 18 Dec 2019  路  1Comment  路  Source: robotology/yarp

When I want to run programs that use the YARP language bindings, I find the following instructions.
What is the meaning of the following instruction?
How do I need to operate specifically?

https://www.yarp.it/yarp_swig.html#yarp_swig_configure
There are basic examples in the "bindings" subdirectory of the YARP source code for all the supported languages. There are a few important things to be aware of:

When you compiled the bindings, a shared library (.so/.dll/.pyd/...) was created. This library needs to be in your operating system's library path. On Linux, if you are in the build directory, you can do something like one of:

setenv LD_LIBRARY_PATH $PWD:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
On Windows, you can update your PATH environment variable.
When you compiled the bindings, one or many wrapper files may have been produced in your language of interest. These files will need to be in whatever path is appropriate to guide your language's interpreter/compiler/... to find them.

Bindings QSupport Answered

Most helpful comment

Hi @YANGGANG1971,

As a general posting issue, it's good to know your configuration (as mentioned in the issue templates): OS, as well as how you tried to install YARP and how you tried to install the bindings.

As general pointers:

  1. You must compile the bindings from source. This applies even if you installed YARP binaries. On the bright side, this is easy and most of the hacks regarding environment variables are not even required nowadays.
  2. To compile the bindings from source:

    1. You must have SWIG (which can be as simple as sudo apt install swig on an Ubuntu) and some headers (e.g. sudo apt install python-dev for Python on Ubuntu).

    2. Just activate the corresponding flags on CMake (activating YARP_COMPILE_BINDINGS and CREATE_PYTHON can be as simple as cmake .. -DYARP_COMPILE_BINDINGS=ON -DCREATE_PYTHON=ON for Python on Ubuntu).

    3. Then actually compile and install (e.g. make; sudo make install on Ubuntu).

  3. Examples of use can be found at https://github.com/robotology/yarp/tree/master/bindings/python/examples (perma).

Hope this helps!

>All comments

Hi @YANGGANG1971,

As a general posting issue, it's good to know your configuration (as mentioned in the issue templates): OS, as well as how you tried to install YARP and how you tried to install the bindings.

As general pointers:

  1. You must compile the bindings from source. This applies even if you installed YARP binaries. On the bright side, this is easy and most of the hacks regarding environment variables are not even required nowadays.
  2. To compile the bindings from source:

    1. You must have SWIG (which can be as simple as sudo apt install swig on an Ubuntu) and some headers (e.g. sudo apt install python-dev for Python on Ubuntu).

    2. Just activate the corresponding flags on CMake (activating YARP_COMPILE_BINDINGS and CREATE_PYTHON can be as simple as cmake .. -DYARP_COMPILE_BINDINGS=ON -DCREATE_PYTHON=ON for Python on Ubuntu).

    3. Then actually compile and install (e.g. make; sudo make install on Ubuntu).

  3. Examples of use can be found at https://github.com/robotology/yarp/tree/master/bindings/python/examples (perma).

Hope this helps!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nicogene picture Nicogene  路  3Comments

xEnVrE picture xEnVrE  路  3Comments

traversaro picture traversaro  路  4Comments

drdanz picture drdanz  路  3Comments

Giulero picture Giulero  路  3Comments