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

Make it work on macos #1

Open
hasantahir opened this issue Mar 16, 2023 · 8 comments
Open

Make it work on macos #1

hasantahir opened this issue Mar 16, 2023 · 8 comments

Comments

@hasantahir
Copy link

Hi,

First many thanks for writing up this visualisation tool, it has been really helpful. I wanted to ask your help if OrbVis can be run on MacOS. After tweaking with the cglm library, I was able to build the tool but executing it throws the following error:

[0001.431]   shader.c:    shader_compile: 31: Failed to compile shader.
ERROR: 0:1: '' :  version '430' is not supported
ERROR: 0:1: '' : syntax error: #version
ERROR: 0:2: '' :  #version required and missing.
ERROR: 0:2: '0' : syntax error: integers in layouts require GLSL 140 or later

This seems to be a historical issue in MacOS due to a lack of support for OpenGL.

Any ideas/suggestions? many thanks.

@wojciech-graj
Copy link
Owner

wojciech-graj commented Mar 16, 2023

OpenGL support is deprecated in macos, but AFAIK OpenGL 4.1 is still available and likely will be for the foreseeable future. I pushed a commit to downgrade to OpenGL 4.1, so please try pulling and recompiling, and then please let me know if everything is working as expected.

Also (assuming the macos build now works) if you happen to have too much free time and nothing to do with it, adding build instructions for macos to the README would be greatly appreciated.

@wojciech-graj
Copy link
Owner

A lot has changed with OrbVis over the past month or so, hopefully simplifying the compilation process on MacOS. The janky Make build system has been replaced with meson, and cglm is no longer an external dependency because its headers are included in the lib directory. As long as you have meson, Gtk+3, curl, and epoxy, I see no reason for it to not work out-of-the-box.
I (un?)fortunately don't own a mac so I can't test this, so if anyone could try to compile and run OrbVis on a mac, I'd love to hear how it went.

@hasantahir
Copy link
Author

Hi @wojciech-graj

Thanks for continuing to improve Orbvis. I tried compiling the latest version. After successful compiling, I get the following errors when I try to run the application:

build git:(master) ✗ ./orbvis
[0000.347]   shader.c:    shader_compile: 31: Failed to compile shader.
WARNING: 0:2: extension 'GL_ARB_explicit_uniform_location' is not supported
ERROR: 0:9: Invalid use of layout 'location'
ERROR: 0:13: Use of undeclared identifier 'transform'

Seems to be an OpenGL issue.

@wojciech-graj
Copy link
Owner

Hey @hasantahir
Thanks for getting back to me :). Looks like apple's OpenGL support is even worse than I had anticipated, so in the coming days I'll try to change the OpenGL-related code a bit, and I'll post another comment here when I'm done. Hopefully using OpenGL 4.1 without any extensions will work

@hasantahir
Copy link
Author

Thanks. Looking forward to the updates. 👀

@wojciech-graj
Copy link
Owner

Hey @hasantahir
Please feel free to try running the latest version of OrbVis. It's now only using the OpenGL 4.1 core profile, so it should finally work on MacOS.

@hasantahir
Copy link
Author

Thanks for looking into this. I see a blank app window:

Screenshot 2023-04-29 at 22 09 05

The command line prompts are:

➜  OrbVis git:(master) ✗ meson setup build
The Meson build system
Version: 1.1.0
Source dir: /Users/hasan/OrbVis
Build dir: /Users/hasan/OrbVis/build
Build type: native build
Project name: OrbVis
Project version: 0.3.0
C compiler for the host machine: cc (clang 14.0.3 "Apple clang version 14.0.3 (clang-1403.0.22.14.1)")
C linker for the host machine: cc ld64 857.1
Host machine cpu family: aarch64
Host machine cpu: aarch64
Found pkg-config: /opt/homebrew/bin/pkg-config (0.29.2)
Run-time dependency gtk+-3.0 found: YES 3.24.37
Run-time dependency libcurl found: YES 8.0.1
Run-time dependency epoxy found: YES 1.5.10
Library m found: YES
Configuring version.h using configuration
Program python3 found: YES (/opt/homebrew/bin/python3)
Build targets in project: 1

Found ninja-1.11.1 at /opt/homebrew/bin/ninja
Generating targets:   0%|                                                     |                                                                                 Writing build.ninja:   0%|                                                   | 0
➜  OrbVis git:(master) ✗ meson compile -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /opt/homebrew/bin/ninja -C /Users/hasan/OrbVis/build
ninja: Entering directory `/Users/hasan/OrbVis/build'
[16/64] Compiling C object orbvis.p/src_core_system.c.o
../src/core/system.c:59:45: warning: format specifies type 'long' but the argument has type 'long long' [-Wformat]
                g_snprintf(iso8601_str + 19, 5, ".%03ld", epoch_ms % 1000);
                                                  ~~~~~   ^~~~~~~~~~~~~~~
                                                  %03lld
1 warning generated.
[64/64] Linking target orbvis
➜  OrbVis git:(master) ✗ cd build
➜  build git:(master) ✗ ./orbvis

@wojciech-graj
Copy link
Owner

wojciech-graj commented May 4, 2023

Well that certainly doesn't look the way it ought to, but I don't think there's much I can do in the way of debugging without getting my hands on a mac since the program compiles and launches, but something's presumably broken with rendering the GTK GUI.

EDIT: I got my hands on an M1 mac, and can reproduce this issue. OrbVis is in "maintenance mode", so I'm not planning to add new major features or fix this for now, but maybe at some point in the future I'll tackle this, or just re-write OrbVis in rust.

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