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

Trouble loading plugins in Viewer demo #96

Closed
tomlankhorst opened this issue Jan 24, 2021 · 5 comments
Closed

Trouble loading plugins in Viewer demo #96

tomlankhorst opened this issue Jan 24, 2021 · 5 comments

Comments

@tomlankhorst
Copy link

The maintainers of this project are doing a formidable job. 😄

I am trying to get the viewer example going (2020.06).

I installed magnum the vcpkg way, I use CMake on Ubuntu 20.04.
Then, I installed the magnum plugins too vcpkg install magnum-plugins\[\*\].

Now, I see that these plugin libraries are present in the lib dir of vcpkg, although static .a.

When I try to run the example, I run into the following issue:

PluginManager::Manager::Manager(): none of the plugin search paths in {/home/me/vcpkg/installed/x64-linux/debug/bin/magnum-d/importers, ../lib/magnum-d/importers, magnum-d/importers} exists and pluginDirectory was not set, skipping plugin discovery
PluginManager::Manager::load(): plugin AnySceneImporter is not static and was not found in

I have tried passing the vcpkg prefix to the plugin manager.
I feel like I am missing a step, how do I get dynamic plugins working the vcpkg way?

Thanks in advance for your time.

@tomlankhorst
Copy link
Author

Now, it seems like the vcpkg magnum-plugins are static by default.
I tried the static plugins method and stumbled upon an issue where CMake couldn't find Assimp.
As I understand it, assimp is to be found with find_package(assimp), lower-case.
As a work-around, I copied the FindAssimp.cmake file from magnum-plugins/modules, but shouldn't this be done automatically?

Also, what's the way to use dynamic modules with vcpkg?

@mosra
Copy link
Owner

mosra commented Jan 25, 2021

Hi!

Not exactly sure what vcpkg does on linux/macOS, on Windows at least you have an option to build a dynamic or a static version, and with the dynamic version things should magically "just work". I vaguely remember some update where vcpkg stopped offering dynamic builds on non-Windows platforms? In that case you'd be out of luck, since all examples assume dynamic plugins (as that's the default, and a much more flexible workflow since you're not tied to a particular plugin but "whatever can open PNGs" instead, for example).

For static plugins you'd need to explicitly link those (as you did), and the Find modules currently have to be copied, yes (I can't just install the 3rd party Find modules on the system to avoid conflicts, but I plan on fixing that somehow for the next release -- mosra/magnum#453).

In general, I'd suggest to avoid using vcpkg unless you're on Windows, as the other systems have far better package managers that don't try to force silly restrictions like vcpkg does, not to mention vcpkg upgrades have always been extremely painful for everybody. On Ubuntu you're encouraged to build & install the .deb packages :)

@mosra mosra added this to the 2020.0b milestone Jan 25, 2021
@mosra
Copy link
Owner

mosra commented Jan 26, 2021

Update -- I got another report related to this today, and after digging a bit I realized what's the culprit -- for dynamic plugins to work, these two lines https://github.com/microsoft/vcpkg/blob/b759049a36728d18260963799a56e6b19cb4a2ef/ports/magnum-plugins/portfile.cmake#L102-L103 should be wrapped in if(WIN32). If you do that change locally in your vcpkg copy, dynamic plugins should get installed properly.

We have one vcpkg PR pending right now, when that one is merged I'll submit a fix for this. Will keep you updated.

@tomlankhorst
Copy link
Author

Very nice. Thank you.

For now, I am using the Git submodule approach combined with Conan for dependency management.
That works okay for now.

@mosra
Copy link
Owner

mosra commented Oct 17, 2021

This is fixed as of microsoft/vcpkg#16245, which got merged on Feb 18th. Apologies for not updating the issue sooner :)

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

No branches or pull requests

2 participants