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

Build GLVis using gcc under MacOS #264

Open
JianboLong opened this issue Sep 25, 2023 · 2 comments
Open

Build GLVis using gcc under MacOS #264

JianboLong opened this issue Sep 25, 2023 · 2 comments

Comments

@JianboLong
Copy link

Has anyone successfully built GLVis on MacOS using gcc installed by brew ? Related to a previous issue, it seems there's still troubles building GLVis this way. I wonder if there's any solution ? Please see my comment to that previous issue (#178)

          Hello @ilonster @tzanio  I am having similar troubles in building GLVis 4.2 on MacOS Ventura. For other reasons, I could only build MFEM using gcc, instead of Apple's clang. I am trying to build GLVis using the same compiler and flags, but got SDK related errors (see below).  Any solutions for this ?

g++ -O3 -std=c++11 -I../mfem_build -DGLVIS_MULTISAMPLE=4 -DGLVIS_MS_LINEWIDTH=1.0 -DGLVIS_OGL3 -DGLVIS_USE_LOGO -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include -I/usr/local/include -DGLVIS_USE_LIBPNG -o lib/sdl_mac.o -c lib/sdl_mac.mm
g++ -O3 -std=c++11 -I../mfem_build -DGLVIS_MULTISAMPLE=4 -DGLVIS_MS_LINEWIDTH=1.0 -DGLVIS_OGL3 -DGLVIS_USE_LOGO -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include -I/usr/local/include -DGLVIS_USE_LIBPNG -o share/logo.rgba.bin.o -c share/logo.rgba.bin.cpp
lib/sdl_mac.mm:37:4: error: stray '@' in program
37 | @autoreleasepool
| ^
lib/sdl_mac.mm:50:4: error: stray '@' in program
50 | @autoreleasepool
| ^
lib/sdl_mac.mm:82:4: error: stray '@' in program
82 | @autoreleasepool
| ^
lib/sdl_mac.mm:92:4: error: stray '@' in program
92 | @autoreleasepool
| ^
lib/sdl_mac.mm:102:4: error: stray '@' in program
102 | @autoreleasepool
| ^
lib/sdl_mac.mm:113:4: error: stray '@' in program
113 | @autoreleasepool
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/dispatch/dispatch.h:63,
from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20,
from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17,
from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:66,
from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6,
from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
from lib/sdl_mac.mm:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/os/object.h:206:1: error: expected unqualified-id before 'interface'
206 | OS_OBJECT_DECL_BASE(object, NSObject);
| ^~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/os/workgroup_object.h:49:1: error:expected unqualified-id before 'interface'
49 | OS_WORKGROUP_DECL(os_workgroup, WorkGroup);
| ^~~~~~~~~~~~~~~~~

Originally posted by @JianboLong in #178 (comment)

@v-dobrev
Copy link
Member

On Mac we have some Objective C++ sources that allow us to use some Mac-specific (Cocoa) stuff. I'm not sure GCC really supports this type of sources, so I think you need to use Apple's clang compiler, clang++.

@tzanio
Copy link
Member

tzanio commented Oct 31, 2023

There is also a Mac binary that you can download and use directly: https://bit.ly/glvis-mac

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

3 participants