GLVis / glvis

Lightweight OpenGL tool for accurate and flexible finite element visualization
http://glvis.org
BSD 3-Clause "New" or "Revised" License
251 stars 51 forks source link

Difficulty connecting mfem to glvis on latest MacOS Catalina #178

Closed ilonster closed 3 years ago

ilonster commented 3 years ago

I recently obtained a new mac running Catalina 10.15.7. I can compile glvis with no errors reported and I can start the glvis daemon without errors reported. After running a program in the terminal on the new MacOS, a window pops up that asks the user "whether to allow incoming network connections." I assume at this point that the correct answer is "yes".

However, when I run an mfem program that tries to connect to glvis, the following error is reported:

Waiting for data on port 19916 ... terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_M_construct null not valid

Any clue as to what might be causing the problem?

tzanio commented 3 years ago

Hi @ilonster,

Was this with the current master of both MFEM and GLVis?

Does it work in non-server mode, e.g. glvis -m ../mfem/data/escher.mesh?

Tzanio

ilonster commented 3 years ago

@tzanio Tzanio,

That doesn't seem to work either. I get the error:

Generating coloring starting with element 3 / 42 Number of colors: 3 terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_M_construct null not valid Abort trap: 6

tzanio commented 3 years ago

Was this ☝️ with the latest master of both MFEM and GLVis?

ilonster commented 3 years ago

It occurs with the fusion-ldrd-dev branch of mfem and glvis

tzanio commented 3 years ago

I can't reproduce this, but I am on macOS Big Sur.

@cjvogl, do you think you can help? Maybe it is a question of just pulling master into fusion-ldrd-dev and rebuilding everything from scratch?

cjvogl commented 3 years ago

@tzanio, will do. FWIW, the fusion-ldrd-dev branch is basically a mirror of the MFEM master at this point (with some code added to get the SUNDIALS interface to work correctly); however, we use glvis v3.4 by default... so we'll try updating the glvis version and rebuilding (unless you already tried that @ilonster?)

tzanio commented 3 years ago

@tzanio, will do.

thank you

however, we use glvis v3.4 by default...

oh, glvis-3.4 will likely have issues in server mode on Catalina, see https://github.com/GLVis/glvis/discussions/141

ilonster commented 3 years ago

I just tried to replace glvis v3.4 with v4.0. Unfortunately, now I get a compilation error that begins with:

Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentHistoryTransaction.h:29:20: error: unknown property attribute before ',' token 29 | @property (nullable,readonly,copy) NSArray<NSPersistentHistoryChange >changes;

tzanio commented 3 years ago

Do you mind trying the current glvis master?

ilonster commented 3 years ago

Again, the master branch of glvis does not compile. The first error message appears to be related to the Objective C sdl_mac.mm file:

/Users/joseph5/Projects/mhd-mfem/glvis/lib/sdl_mac.mm:37:4: error: stray '@' in program 37 | @autoreleasepool

publixsubfan commented 3 years ago

Hi @ilonster, it seems like there may be an issue with your compiler. Are you using gcc on mac? It may be worth switching to Apple clang (e.g. CXX = clang++ in your mfem config)

ilonster commented 3 years ago

@kanye-quest Some progress! Changing from gcc to clang works for glvis but now breaks our mfem code compilation.

Let me note that glvis does not appear to be able to compile with homebrew's version of gcc-9 or gcc-11 for Catalina. Similar errors appear in the form:

/Users/joseph5/Projects/mhd-mfem/glvis/lib/sdl_mac.mm:37:4: error: stray '@' in program 37 | @autoreleasepool

ilonster commented 3 years ago

I was able to compile everything with homebrew's llvm clang compiler. so this addresses the issue for now.

JianboLong commented 11 months ago

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); | ^~~~~