hopf icon indicating copy to clipboard operation
hopf copied to clipboard

Problem compiling "hopf" on macOS

Open DKPeterson opened this issue 4 years ago • 3 comments

Hi, Michael--

After reading David Lyons' article on the Hopf fibration, I was psyched to see that you have written a visualization demo for this. But I had trouble building the package.

I'm on a macOS 10.15 (Catalina) laptop. I've downloaded the git source and submodules. Followed the directions (cmake ..). This results in a Makefile. Although the README doesn't say so, I presume the next step is to "make" the project. When I type "make" at the command prompt, the compiler throws 27 warnings and 2 errors (log text file attached, here): hopf make log.txt

The two errors are most distressing:

/Users/kent/Documents/hopf/include/shader.h:198:42: error: no member named 'make_unique' in namespace 'std' auto uniform_name = std::make_unique<char[]>(max_name_len); ~~~~~^ /Users/kent/Documents/hopf/include/shader.h:198:58: error: expected '(' for function-style cast or type construction auto uniform_name = std::make_unique<char[]>(max_name_len); ~~~~^

I guess the first question is whether there is any known incompatibility with macOS. And then, if not, whether the "make" directive is the expected way to complete the build.

RSVP, thanks.

--Kent

DKPeterson avatar Aug 09 '20 21:08 DKPeterson

Hey @DKPeterson thanks for checking out the repo...I'll start by saying that I haven't compiled the program on Mac OS myself. One issue I could forsee is, Apple stopped supporting OpenGL a few years ago, and this program makes use of several new-ish OpenGL features which might not be readily available on your machine, such as Direct State Access.

In theory, if you know OpenGL, it wouldn't be too hard to change some of the code to get it to compile with earlier versions of OpenGL (it looks like a lot of the newer Macbooks support up to version 4.1).

I'm not sure why you're getting an error on that particular line, but I took a quick look, and you should be able to comment out that entire function in shader.h (the function named perform_reflection), as it isn't actually being used. But I expect you will run into some of the OpenGL issues mentioned above afterwards...

I might have some time to investigate further in the coming weeks, as I just got a Macbook. In the meantime, please let me know if you come up with any solutions or fixes on your own! Sorry it's not working for you at the moment. Admittedly, I only tested the program on my Windows machine.

mwalczyk avatar Aug 09 '20 21:08 mwalczyk

I might try building/running on an Ubuntu VM. Not sure how swift the VM is with GPU acceleration, though. Anyway, thank you for the quick reply. I’ll let you know what success (if any) I have.

—Kent

On Aug 9, 2020, at 2:47 PM, Michael Walczyk [email protected] wrote:

Hey @DKPeterson https://urldefense.com/v2/url?u=https-3A__github.com_DKPeterson&d=DwMCaQ&c=WHGKFvgO2qimUZAvLY1cWUNKWXmDUFtKeA75Gj_3XxI&r=Swihb4uLUbf89mjcKponRNUfJDI2Y2_L2DaEmPK8KGk&m=-re1z7kFxaU-pYXDLZ5hfVqXyRcwEpoTALTWauhzN8c&s=U1X7q8ZFDvP1n6kKLnNWRvp5HgTDmlJBkYwpdBIKs5E&e= thanks for checking out the repo...I'll start by saying that I haven't compiled the program on Mac OS myself. One issue I could forsee is, Apple stopped supporting OpenGL a few years ago, and this program makes use of several new-ish OpenGL features which might not be readily available on your machine, such as Direct State Access https://urldefense.com/v2/url?u=https-3A__www.khronos.org_opengl_wiki_Direct-5FState-5FAccess&d=DwMCaQ&c=WHGKFvgO2qimUZAvLY1cWUNKWXmDUFtKeA75Gj_3XxI&r=Swihb4uLUbf89mjcKponRNUfJDI2Y2_L2DaEmPK8KGk&m=-re1z7kFxaU-pYXDLZ5hfVqXyRcwEpoTALTWauhzN8c&s=B-FMUK1QXNKGTyXcOEGqrn6K5CU4ku4Gh1RYJ3H3-c8&e=.

In theory, if you know OpenGL, it wouldn't be too hard to change some of the code to get it to compile with earlier versions of OpenGL (it looks like a lot of the newer Macbooks support up to version 4.1).

I'm not sure why you're getting an error on that particular line, but I took a quick look, and you should be able to comment out that entire function in shader.h (the function named perform_reflection), as it isn't actually being used. But I expect you will run into some of the OpenGL issues mentioned above afterwards...

I might have some time to investigate further in the coming weeks, as I just got a Macbook. In the meantime, please let me know if you come up with any solutions or fixes on your own! Sorry it's not working for you at the moment. Admittedly, I only tested the program on my Windows machine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://urldefense.com/v2/url?u=https-3A__github.com_mwalczyk_hopf_issues_1-23issuecomment-2D671104897&d=DwMCaQ&c=WHGKFvgO2qimUZAvLY1cWUNKWXmDUFtKeA75Gj_3XxI&r=Swihb4uLUbf89mjcKponRNUfJDI2Y2_L2DaEmPK8KGk&m=-re1z7kFxaU-pYXDLZ5hfVqXyRcwEpoTALTWauhzN8c&s=s9_-P3k6Qtd5eCuZtyRnycUdofbIZzOqNM6TRc8QFwA&e=, or unsubscribe https://urldefense.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AOHIIIMAOA6WPHC44GRK7STR74KPDANCNFSM4PZMBNEQ&d=DwMCaQ&c=WHGKFvgO2qimUZAvLY1cWUNKWXmDUFtKeA75Gj_3XxI&r=Swihb4uLUbf89mjcKponRNUfJDI2Y2_L2DaEmPK8KGk&m=-re1z7kFxaU-pYXDLZ5hfVqXyRcwEpoTALTWauhzN8c&s=vjLPX_7YFyF0IMVoMVigaL_r9vLgyhLvjrUAlDJnNyM&e=.

DKPeterson avatar Aug 10 '20 15:08 DKPeterson

Hello, I was able to get around this error on linux by adding the following include to shader.h: #include <memory>

I added a pull request with this change. IUnfortunately have no way to test if this causes issues on Windows.

BenBarker avatar Nov 23 '20 17:11 BenBarker