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

Support OSX builds #1

Closed
NSkelsey opened this issue Jun 5, 2019 · 7 comments
Closed

Support OSX builds #1

NSkelsey opened this issue Jun 5, 2019 · 7 comments
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@NSkelsey
Copy link
Owner

NSkelsey commented Jun 5, 2019

An experimental build of monopticon was attempted on OSX with mixed results and no final binary.

The following dependencies were installed following the magnum's project recommendations

> brew install mosra/magnum/magnum
> brew install mosra/magnum-integration

These are not all of the dependencies because monopticon also depends on ImGui and integrated libraries that must be specifically compiled and linked within magnum-integration.

The imgui headers and files were placed on the system at /usr/local/include/imgui.

The homebrew tap of magnum-integration was modified with some extra arguments forcmake and then rebuilt and installed. This build encountered errors related to linking against system functions within OSX. Specifcally ldd failed. The error is reported below.

This issue was resolved by manually modifying the link.txt of the CMake target ImGuiIntegration with the following parameters: -framework CoreFoundation -framework ApplicationServices which allowed the build of magnum-integration to finish. Immediately after a cmake install was executed.

Unfortunately, the subsequent preparation to build from within monopticon could not find MagnumIntegration which included the compiled ImGuiIntegration and as a result the attempt was abandoned.

> cmake -DWITH_IMGUI=ON -DIMGUI_DIR=/usr/local/include/imgui ..
> cmake --build .
.
.
.
’[100%] Linking CXX shared library libMagnumImGuiIntegration.dylib
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld” 
-demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib 
-dynamic -dylib -dylib_compatibility_version 2.0.0 -dylib_current_version 2.2.0 -arch x86_64 
-dylib_install_name @rpath/libMagnumImGuiIntegration.2.dylib -macosx_version_min 10.14.0 
-syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -o libMagnumImGuiIntegration.2.2.dylib 
-headerpad_max_install_names CMakeFiles/MagnumImGuiIntegration.dir/Context.cpp.o 
CMakeFiles/MagnumImGuiIntegration.dir/resource_MagnumImGuiIntegrationShaders_RCS.cpp.o 
CMakeFiles/MagnumImGuiIntegration.dir/usr/local/include/imgui/imgui.cpp.o 
CMakeFiles/MagnumImGuiIntegration.dir/usr/local/include/imgui/imgui_widgets.cpp.o 
CMakeFiles/MagnumImGuiIntegration.dir/usr/local/include/imgui/imgui_draw.cpp.o 
CMakeFiles/MagnumImGuiIntegration.dir/usr/local/include/imgui/imgui_demo.cpp.o 
/usr/local/lib/libMagnumGL.dylib -framework OpenGL /usr/local/lib/libMagnum.dylib 
/usr/local/lib/libCorradeUtility.dylib -lc++ -lSystem 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.osx.a



Undefined symbols for architecture x86_64:
.
.
.
 “_PasteboardSynchronize”, referenced from:
     GetClipboardTextFn_DefaultImpl(void*) in imgui.cpp.o
 “___CFConstantStringClassReference”, referenced from:
     CFString in imgui.cpp.o
     CFString in imgui.cpp.o
 “_kCFAllocatorDefault”, referenced from:
     SetClipboardTextFn_DefaultImpl(void*, char const*) in imgui.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/Magnum/ImGuiIntegration/libMagnumImGuiIntegration.2.2.dylib] Error 1
make[1]: *** [src/Magnum/ImGuiIntegration/CMakeFiles/MagnumImGuiIntegration.dir/all] Error 2
make: *** [all] Error 2
@NSkelsey NSkelsey added the bug Something isn't working label Jun 5, 2019
@NSkelsey NSkelsey added this to the 0.2.0 milestone Jun 5, 2019
@NSkelsey NSkelsey changed the title Support building on OSX Support OSX builds Jun 5, 2019
@NSkelsey
Copy link
Owner Author

NSkelsey commented Jun 5, 2019

It is worth noting that the requirements and installation process inside of this repository are almost identical and could be used to structure another attempt

@NSkelsey NSkelsey removed this from the v0.2.0 milestone Oct 6, 2019
@NSkelsey NSkelsey added enhancement New feature or request help wanted Extra attention is needed labels Oct 6, 2019
@NSkelsey
Copy link
Owner Author

Some more detailed failure logs.

A docker container was created on an OSX machine running xQuartz 2.7.11 (xorg-server v1.18.4) as an x-server the container could forward too.

The app failed on startup with:

[build@e62093fd24f7 pkg]$ monopticon
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Platform: can't get Xft.dpi property for virtual DPI scaling, falling back to physical DPI
Platform::Sdl2Application: can't get physical display DPI, falling back to no scaling: Couldn't get DPI
Platform::Sdl2Application::tryCreate(): cannot create core context: Could not create GL context (falling back to compatibility context)
Platform::Sdl2Application::tryCreate(): cannot create context: Could not create GL context

When executing programs that required a GLX configuration the following issue was returned by any binaries that relied on Magnum and GLX IE magnum-gl-info and monopticon.

An attempt was made to enable Indirect GLX forwarding to but this did not resolve the issue.

The apps inside of mesa-demos all worked with X-forwarding once they were installed in the container.

At the same time with the same docker container with a xming based Windows X11 forwarder an attempt was made to run Monopticon. That failed with following output:

[build@e621c97f39b0 ~]$ monopticon
Platform: can't get Xft.dpi property for virtual DPI scaling, falling back to physical DPI
Platform::Sdl2Application::tryCreate(): cannot create window: Couldn't find matching GLX visual```

In both cases the GLX visual from code compiled with Magnum cannot identify a GLX visual.

Extra details (gl-info):

IMada8

@mosra
Copy link

mosra commented Feb 15, 2020

Just randomly landed here -- on a Mac, Sdl2Application shouldn't need GLX or anything X11-related, it uses the native APIs. That holds for magnum installed from Homebrew as well, magnum-gl-info from there uses CGL and should "just work".

@NSkelsey
Copy link
Owner Author

Thanks for taking a look ;)

The original issue, as I understand now, is just from the fact that magnum-integration is not by default compiled the IMGUI flag. This could be resolved by producing a separate package that handles the integration like I've done with in AUR.

The real issue is just how much time I have :)

@mosra
Copy link

mosra commented Feb 15, 2020

ImGui in Homebrew is one of my TODOs for 2020.02: mosra/magnum#411

Will ping you back when that's done.

@mosra
Copy link

mosra commented Jun 26, 2020

Hi, as of mosra/magnum-integration@03f3257, mosra/homebrew-magnum@7fd472b and mosra/magnum-integration@af5e7ed, both the Homebrew and the AUR packages have ImGui bundled, in order to use it from your app you need to update FindImGui.cmake so it's aware of the new bundled location for ImGui headers. Let me know if you run into any issues there.

This also means your imgui-src and monopticon-magnum-integration packages could be removed from AUR again to avoid user confusion. Could you take care of that? Thanks!

@NSkelsey
Copy link
Owner Author

Hi @mosra, no problem.

I am going to give remove imgui-src on July 1st to give imgui-sfml sometime but I've written @CarloMara to remove monopticon-magnum-integration completely.

I've also moved migrated the whole frontend into a emscripten application anyway, so OSX support means something totally different now anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants