Tom94 / tev

High dynamic range (HDR) image viewer for graphics people
BSD 3-Clause "New" or "Revised" License
1.08k stars 86 forks source link

Issues building on MacOS #111

Closed JiayinCao closed 3 years ago

JiayinCao commented 3 years ago

Hi,

It seems that Tev, specifically one of its dependencies, doesn't compile on MacOS. Here is the compiling error.

caojiayin@Caos-Air build % make
[  1%] Built target clip
[  1%] Building C object dependencies/nanogui/ext_build/glfw/src/CMakeFiles/glfw_objects.dir/cocoa_init.m.o
/Users/caojiayin/Desktop/GitHub/tev/dependencies/nanogui/ext/glfw/src/cocoa_init.m:282:1: error: expected identifier or '('
@interface GLFWLayoutListener : NSObject
^
/Users/caojiayin/Desktop/GitHub/tev/dependencies/nanogui/ext/glfw/src/cocoa_init.m:292:1: error: expected identifier or '('
@end
^
/Users/caojiayin/Desktop/GitHub/tev/dependencies/nanogui/ext/glfw/src/cocoa_init.m:354:9: error: expected expression
        [NSApp setDelegate:nil];
        ^
/Users/caojiayin/Desktop/GitHub/tev/dependencies/nanogui/ext/glfw/src/cocoa_init.m:355:9: error: expected expression
        [_glfw.ns.delegate release];
        ^
/Users/caojiayin/Desktop/GitHub/tev/dependencies/nanogui/ext/glfw/src/cocoa_init.m:361:9: error: expected expression
        [[NSDistributedNotificationCenter defaultCenter]
        ^
/Users/caojiayin/Desktop/GitHub/tev/dependencies/nanogui/ext/glfw/src/cocoa_init.m:365:9: error: expected expression
        [_glfw.ns.listener release];
        ^
/Users/caojiayin/Desktop/GitHub/tev/dependencies/nanogui/ext/glfw/src/cocoa_init.m:369:5: error: expected expression
    [_glfw.ns.cursor release];
    ^
/Users/caojiayin/Desktop/GitHub/tev/dependencies/nanogui/ext/glfw/src/cocoa_init.m:378:5: error: expected expression
    [_glfw.ns.autoreleasePool release];
    ^
8 errors generated.
make[2]: *** [dependencies/nanogui/ext_build/glfw/src/CMakeFiles/glfw_objects.dir/cocoa_init.m.o] Error 1
make[1]: *** [dependencies/nanogui/ext_build/glfw/src/CMakeFiles/glfw_objects.dir/all] Error 2
make: *** [all] Error 2
Tom94 commented 3 years ago

I'm having trouble reproducing the problem. Compiling a fresh clone goes through without a hitch.

I'm also on Big Sur 11.1, using a later version of XCode than you (12.4 12D4e), and I'm on Intel. (Unfortunately, I don't have a M1 machine yet. Waiting for the 16 inch for that.)

~Checking out the latest commits on the clip side, I don't see anything that might fix the problem you report. It's probably worth it to open an issue over at their repo.~

Apologies, I misread your compiler log and thought clip was the culprit. Have you tried using the latest version of GLFW to see if it fixes your problem?

JiayinCao commented 3 years ago

I have exactly the same error on Intel Mac. I'll try with some other of my Macs that are intel based later. I will also give it a try with the latest GLFW once I have a chance.

Thanks.

JiayinCao commented 3 years ago

I got more info for this bug.

It turns out both of my two MacOS have a version of CMake that triggered this error. Updating my CMake to the latest one fixed the problem.

If you want to reproduce the problem, my previous cmake version is '3.19.0-rc3'. Or if you don't have time for this, closing this issue is also fine.

Tom94 commented 3 years ago

Thanks a bunch for the update! I'll go with closing and crossing my fingers that not too many people are stuck on an affected version of CMake. :)