Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit to specify directory where to load plugins from without using LD_LIBRARY_PATH/PATH #109

Open
traversaro opened this issue Apr 26, 2020 · 2 comments

Comments

@traversaro
Copy link
Member

See discussion robotology/robotology-superbuild#95 for more info.

@drdanz
Copy link
Member

drdanz commented Apr 27, 2020

Related: ami-iit/sharedlibpp#7

@traversaro
Copy link
Member Author

For qpsolvers-eigen I implemented yet another improvement, that I think is quite convenient and permits us to avoid setting any env variables, at least in most cases.

The main library is called <prefix>qpsolvers-eigen<extension> (where <prefix> and <extension> are os-specific values), while plugins are called in <prefix>qpsolvers-eigen-osqp<extension>, ``qpsolvers-eigen-proxqpetc etc. Differently from rtf that installs the main library in/lib` (or `/bin` for Windows) and the plugins in `/lib/rtf`, for qpsolvers all libraries are installed in `/lib`, as anyhow they are not ambiguous thanks to the `qpsolvers-eigen-` prefix in their name.

Then, in the main library I extend the search path based on the location of the main <prefix>qpsolvers-eigen<extension> library (see https://github.com/ami-iit/qpsolvers-eigen/blob/dfd9b3e326e27f8f73646070d120c53e42c4fbda/core/QpSolversEigen/Solver.cpp#L102-L110 and https://github.com/ami-iit/qpsolvers-eigen/blob/dfd9b3e326e27f8f73646070d120c53e42c4fbda/core/QpSolversEigen/Solver.cpp#L21-L57), so that as long as the library and the plugins are installed in the same install prefix (as it happens with conda packages, robotology-superbuild and colcon workspace with --merge-install option) the plugins can be found without the need of setting any env variable.

In case plugins are installed in a separate install prefix with respect to the main <prefix>qpsolvers-eigen<extension> library, then the install directory can be added to the SHLIBPP_PLUGIN_PATH env variable (or a custom env variable as done by blockfactory with BLOCKFACTORY_PLUGIN_PATH, see https://github.com/robotology/blockfactory/blob/9921b59725b31cc5a655b9bdb316c634df6085d8/sources/Core/src/FactorySingleton.cpp#L30 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants