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

Plugins not working with manually-built magnum-examples #1

Closed
dyzdyz010 opened this issue Apr 9, 2018 · 9 comments
Closed

Plugins not working with manually-built magnum-examples #1

dyzdyz010 opened this issue Apr 9, 2018 · 9 comments

Comments

@dyzdyz010
Copy link

I installed all taps:

brew install --HEAD mosra/magnum/corrade
brew install --HEAD mosra/magnum/magnum
brew install --HEAD mosra/magnum/magnum-plugins
brew install --HEAD mosra/magnum/magnum-integration
brew install --HEAD mosra/magnum/magnum-extras

Then build magnum-examples manually using cmake -G Xcode, then open the generated Xcode project, run target magnum-cubemap, the console shows following error:

Renderer: AMD Radeon R9 M370X OpenGL Engine by ATI Technologies Inc.
OpenGL version: 4.1 ATI-1.66.31
Using optional features:
    GL_ARB_ES2_compatibility
    GL_ARB_separate_shader_objects
    GL_ARB_texture_filter_anisotropic
    GL_ARB_texture_storage
    GL_ARB_vertex_array_object
    GL_EXT_debug_label
    GL_EXT_debug_marker
Using driver workarounds:
    no-layout-qualifiers-on-old-glsl
PluginManager::Manager::load(): plugin JpegImporter is not static and was not found in /usr/local/Cellar/magnum/HEAD-920db7a/lib/magnum/importers
Program ended with exit code: 1

I checked the directory mentioned, and there's only .conf and .so files, no static lib files:

image

ENV: macOS High Sierra 10.13.4, Xcode 9.2

@mosra
Copy link
Owner

mosra commented Apr 9, 2018

Hi, thanks for the report!

This looks like the plugins from magnum-plugins got installed in a wrong location. What does the following command show?

brew list magnum-plugins

@dyzdyz010
Copy link
Author

image

@mosra
Copy link
Owner

mosra commented Apr 9, 2018

Huh. I see. The assumption is that the lib/magnum/ is shared by both magnum and magnum-plugins and ... well, the project got confused by Homebrew installing every package to a special directory.

Does /usr/local/lib/magnum/ exist? What does the following show?

ls /usr/local/lib/magnum

If so, then fixing this should be just a matter of a simple patch to the main magnum formula like below. I'll push the update as soon as you confirm that the directory exists and contains all the plugins.

diff --git a/Formula/magnum.rb b/Formula/magnum.rb
index 3b41d88..436a8c1 100644
--- a/Formula/magnum.rb
+++ b/Formula/magnum.rb
@@ -13,7 +13,7 @@ class Magnum < Formula
   def install
     system "mkdir build"
     cd "build" do
-      system "cmake", "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_INSTALL_PREFIX=#{prefix}", "-DWITH_AUDIO=ON", "-DWITH_GLFWAPPLICATION=OFF", "-DWITH_SDL2APPLICATION=ON", "-DWITH_WINDOWLESSCGLAPPLICATION=ON", "-DWITH_CGLCONTEXT=ON", "-DWITH_OPENGLTESTER=ON", "-DWITH_ANYAUDIOIMPORTER=ON", "-DWITH_ANYIMAGECONVERTER=ON", "-DWITH_ANYIMAGEIMPORTER=ON", "-DWITH_ANYSCENEIMPORTER=ON", "-DWITH_MAGNUMFONT=ON", "-DWITH_MAGNUMFONTCONVERTER=ON", "-DWITH_OBJIMPORTER=ON", "-DWITH_TGAIMAGECONVERTER=ON", "-DWITH_TGAIMPORTER=ON", "-DWITH_WAVAUDIOIMPORTER=ON", "-DWITH_DISTANCEFIELDCONVERTER=ON", "-DWITH_FONTCONVERTER=ON", "-DWITH_IMAGECONVERTER=ON", "-DWITH_MAGNUMINFO=ON", "-DWITH_AL_INFO=ON", ".."
+      system "cmake", "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_INSTALL_PREFIX=#{prefix}", "-DMAGNUM_PLUGINS_DIR=#{HOMEBREW_PREFIX}/lib/magnum", "-DWITH_AUDIO=ON", "-DWITH_GLFWAPPLICATION=OFF", "-DWITH_SDL2APPLICATION=ON", "-DWITH_WINDOWLESSCGLAPPLICATION=ON", "-DWITH_CGLCONTEXT=ON", "-DWITH_OPENGLTESTER=ON", "-DWITH_ANYAUDIOIMPORTER=ON", "-DWITH_ANYIMAGECONVERTER=ON", "-DWITH_ANYIMAGEIMPORTER=ON", "-DWITH_ANYSCENEIMPORTER=ON", "-DWITH_MAGNUMFONT=ON", "-DWITH_MAGNUMFONTCONVERTER=ON", "-DWITH_OBJIMPORTER=ON", "-DWITH_TGAIMAGECONVERTER=ON", "-DWITH_TGAIMPORTER=ON", "-DWITH_WAVAUDIOIMPORTER=ON", "-DWITH_DISTANCEFIELDCONVERTER=ON", "-DWITH_FONTCONVERTER=ON", "-DWITH_IMAGECONVERTER=ON", "-DWITH_MAGNUMINFO=ON", "-DWITH_AL_INFO=ON", ".."
       system "cmake", "--build", "."
       system "cmake", "--build", ".", "--target", "install"
     end

Thank you!

@dyzdyz010
Copy link
Author

Thanks for such a top speed response :P It seems this directory exists and contains all plugins:

image

image

@mosra
Copy link
Owner

mosra commented Apr 9, 2018

I just pushed c08ce3f with the above patch. Can you

brew reinstall --HEAD mosra/magnum/magnum

and try the example again? Just reinstalling the core package should be enough, no need to do that for the others.

@dyzdyz010
Copy link
Author

I reinstalled magnum as you said, re-cmaked the project, however the same error still comes up 😅

I noticed that it says the plugin needed(JpegImporter) is not static, so maybe it's because of magnum-plugins building settings? cuz in the screenshot I posted above shows only .so files in required location.

@mosra
Copy link
Owner

mosra commented Apr 10, 2018

Huh. This is weird. Sorry. I am not keeping up with Homebrew core functionality changes, but it might now be that you have to call

brew update

in order to pick up the change I pushed (and then perform the reinstall). I'm pretty sure this was not required a year ago, but who knows.

I noticed that it says the plugin needed (JpegImporter) is not static [...]

No, it should pick up the *.so file, static plugins are mainly a fallback option used on platforms with poor dlopen() support.

The magnum package should install the magnum-imageconverter tool, can you run it like this? If the following succeeds, then the example should work as well.

magnum-imageconverter some-jpeg-image-you-have.jpg output.png

In 6d0f47d I made a simple Travis CI setup to verify that the packages build correctly and the above works there. So I hope it was just the missing brew update.

@dyzdyz010
Copy link
Author

Ah, sorry my fault, brew update and it works now, thank you so much!🎉

@mosra
Copy link
Owner

mosra commented Apr 12, 2018

Great! Closing this then :)

@mosra mosra closed this as completed Apr 12, 2018
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