How to compile VTK 8.2.0 with gcc-7 and Qt 5.9.1 on MacOS 10.14?

I am trying hard since a while already to compile VTK 8.2.0 with CMake 3.16.0, Qt 5.9.1 and MacPorts gcc7 7.4.0_3 on MacOS Mojave, i.e. with MacOSX10.14.sdk (Xcode), but I can’t get it to work. I had the same problems already with MacOS High Sierra and gcc 4.9.

I get it configured and generated by cmake successfully, but it always fails with a compilation (see log below). This is very annoying for us as it currently prevents us from using VTK. Any ideas or any hints on how to compile and use VTK on MacOS? Any help or hints are appreciated!

I took these steps so far:

VTK-8.2.0.tar.gz is unpacked into:

/Users/Shared/Development/VTK-8.2.0/source

CMake build directory is configured as:

/Users/Shared/Development/VTK-8.2.0/build

In CMake, I first specified these native compilers:

CMAKE_C_COMPILER: /opt/local/bin/gcc-mp-7
CMAKE_CXX_COMPILER: /opt/local/bin/g+±mp-7

Then, I configured these variables:

CMAKE_PREFIX_PATH=/Users/Shared/Qt5.9.1/5.9.1/clang_64
BUILD_TESTING=TRUE
CMAKE_BUILD_TYPE=Release
CMAKE_INSTALL_PREFIX=/Users/Shared/Development/VTK-8.2.0/install
CMAKE_OSX_ARCHITECTURES=x86_64
CMAKE_OSX_DEPLOYMENT_TARGET=10.9
CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
VTK_Group_Qt=TRUE

Then after pressing “Configure” a couple of times until no entry was red anymore, I press “Generate” and then call “make” in the path /Users/Shared/Development/VTK-8.2.0/build in a Terminal.

This compiles successfully until about 45% and then aborts with an error (see log below).

Note that the problem might be related to:

Parallel VTK 8.2 failed to build with gcc-8 on MacOS 10.14
http://vtk.1045678.n5.nabble.com/Build-error-VTK-6-2-Mac-OS-X-10-10-4-GCC-4-9-td5732749.html

Has anyone any ideas?

=== Build log:

...
[ 44%] Building C object ThirdParty/zlib/vtkzlib/CMakeFiles/vtkzlib.dir/zutil.c.o
[ 45%] Linking C shared library ../../../lib/libvtkzlib-8.2.dylib
[ 45%] Built target vtkzlib
[ 45%] Building C object ThirdParty/freetype/vtkfreetype/CMakeFiles/vtkfreetype.dir/src/base/ftbase.c.o
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h:32:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:42,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h:43,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h:29,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h:23,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:23,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:45,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftmac.c:100,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftbase.c:38:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h:193:7: error: variably modified 'bytes' at file scope
  char bytes[kAuthorizationExternalFormLength];
       ^~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:18:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:9,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:11,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:35,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftmac.c:101,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftbase.c:38:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h:53:40: error: initializer element is not constant
 static const CGFontIndex kCGGlyphMax = kCGFontIndexMax;
                                        ^~~~~~~~~~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:21:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:9,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:11,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:35,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftmac.c:101,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftbase.c:38:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h:391:15: error: expected identifier or '(' before '^' token
 typedef void (^CGPathApplyBlock)(const CGPathElement * element);
               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h:393:53: error: unknown type name 'CGPathApplyBlock'
 CG_EXTERN void CGPathApplyWithBlock(CGPathRef path, CGPathApplyBlock CF_NOESCAPE block)
                                                     ^~~~~~~~~~~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h:14:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h:15,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h:16,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:23,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:9,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:11,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:35,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftmac.c:101,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftbase.c:38:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h:103:15: error: expected identifier or '(' before '^' token
 typedef bool (^CGPDFArrayApplierBlock)(size_t index,
               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h:113:5: error: unknown type name 'CGPDFArrayApplierBlock'; did you mean 'CFArrayApplierFunction'?
     CGPDFArrayApplierBlock cg_nullable block, void * __nullable info)
     ^~~~~~~~~~~~~~~~~~~~~~
     CFArrayApplierFunction
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h:15:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h:16,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:23,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:9,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:11,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:35,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftmac.c:101,
                 from /Users/Shared/Development/VTK-8.2.0/source/ThirdParty/freetype/vtkfreetype/src/base/ftbase.c:38:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h:116:15: error: expected identifier or '(' before '^' token
 typedef bool (^CGPDFDictionaryApplierBlock)(const char * key,
               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h:126:5: error: unknown type name 'CGPDFDictionaryApplierBlock'; did you mean 'CGPDFDictionaryApplierFunction'?
     CGPDFDictionaryApplierBlock cg_nullable block, void * __nullable info)
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
     CGPDFDictionaryApplierFunction
make[2]: *** [ThirdParty/freetype/vtkfreetype/CMakeFiles/vtkfreetype.dir/src/base/ftbase.c.o] Error 1
make[1]: *** [ThirdParty/freetype/vtkfreetype/CMakeFiles/vtkfreetype.dir/all] Error 2
make: *** [all] Error 2
1 Like

The errors indicate that freetype uses Apple system headers that gcc cannot parse, because those headers use Apple-specific C extensions.

You can try configuring VTK with VTK_USE_SYSTEM_FREETYPE=ON. This means that you’ll have to install freetype yourself (you can probably install freetype via MacPorts, and if not, then you can build it yourself with clang).

There’s a fair chance that you’ll run into other compile problems further on, there are probably quite a few Apple SDK headers that aren’t gcc compatible.

1 Like

More than a fair chance, once the Obj-C++ files pull in Foundation and the like there will be other errors.

Benjamin, can you not use clang instead of gcc? Does “gcc-mp-7” refer to OpenMP? Although AppleClang doesn’t have OpenMP support, regular Clang does, and it will probably compile Apple’s headers too.

Cheers,

Sean

1 Like

Firstly, thank you very much for trying to help and for your hints!
I will try to apply them and post my results here.

@dgobbi

I just tried building with the option VTK_USE_SYSTEM_FREETYPE=ON
Fortunately, CMake found freetype automatically without installing anything here: /opt/local/lib/libfreetype.dylib

Unfortunately, it failed to build with a huge list of errors. Here is just an excerpt of more than 35.000 lines:

[ 50%] Building CXX object Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkTextureObjectVS.cxx.o
[ 50%] Building CXX object Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkDummyGPUInfoList.cxx.o
[ 50%] Building CXX object Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkCocoaRenderWindowInteractor.mm.o
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h:101:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h:48,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:22:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 - (instancetype)self;
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:36:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 - (instancetype)retain OBJC_ARC_UNAVAILABLE;
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:38:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 - (instancetype)autorelease OBJC_ARC_UNAVAILABLE;
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:63:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 - (instancetype)init
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:69:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 + (instancetype)new OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:70:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 + (instancetype)allocWithZone:(struct _NSZone *)zone OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
    ^~~~~~~~~~~~
    iswctype
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/NSObject.h:71:4: error: 'instancetype' does not name a type; did you mean 'iswctype'?
 + (instancetype)alloc OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
    ^~~~~~~~~~~~
    iswctype
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:19:21: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (id)copyWithZone:(nullable NSZone *)zone;
                     ^~~~~~~~
                     _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:25:28: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (id)mutableCopyWithZone:(nullable NSZone *)zone;
                            ^~~~~~~~
                            _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:32:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder; // NS_DESIGNATED_INITIALIZER
    ^~~~~~~~
    _Nullable
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:43:12: error: expected identifier before 'class'
 @property (class, readonly) BOOL supportsSecureCoding;
            ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:43:12: error: expected ')' before 'class'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:53:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable id)replacementObjectForCoder:(NSCoder *)aCoder;
    ^~~~~~~~
    _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:54:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable id)awakeAfterUsingCoder:(NSCoder *)aDecoder NS_REPLACES_RECEIVER;
    ^~~~~~~~
    _Nullable
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:15: error: expected ';' before '<' token
 @class NSArray<ObjectType>;
               ^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:35: error: cannot find protocol declaration for 'ObjectType'
 @interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:37: error: expected unqualified-id before ':' token
 @interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
                                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:35: error: duplicate interface declaration for class 'NSEnumerator'
 @interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:35: error: cannot find protocol declaration for 'ObjectType'
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:10:60: error: redefinition of 'struct NSEnumerator'
 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
                                                            ^~~~~~~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:35: error: trying to finish struct, but kicked out due to previous parse errors
 @interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:1: error: expected constructor, destructor, or type conversion before 'property'
 @property (readonly, copy) NSArray<ObjectType> *allObjects;
 ^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRange.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:7,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:18:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
    ^~~~~~~~
    _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:31:42: error: 'nullable' does not name a type; did you mean '_Nullable'?
 + (NSValue *)valueWithNonretainedObject:(nullable id)anObject;
                                          ^~~~~~~~
                                          _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:32:20: error: unknown property attribute before ',' token
 @property (nullable, readonly) id nonretainedObjectValue;
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:32:20: error: expected ')' before ',' token
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:32:1: note: 'assign' can be unsafe for Objective-C objects; please state explicitly if you need it
 @property (nullable, readonly) id nonretainedObjectValue;
 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:34:32: error: 'nullable' does not name a type; did you mean '_Nullable'?
 + (NSValue *)valueWithPointer:(nullable const void *)pointer;
                                ^~~~~~~~
                                _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:35:20: error: unknown property attribute before ',' token
 @property (nullable, readonly) void *pointerValue;
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:35:20: error: expected ')' before ',' token
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:43:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
    ^~~~~~~~
    _Nullable
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRange.h:5:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:7,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:82:38: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (NSString *)descriptionWithLocale:(nullable id)locale;
                                      ^~~~~~~~
                                      _Nullable
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:42: error: cannot find protocol declaration for 'ObjectType'
 @interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
                                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:44: error: expected unqualified-id before ':' token
 @interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:19:4: error: 'ObjectType' does not name a type; did you mean 'ResType'?
 - (ObjectType)objectAtIndex:(NSUInteger)index;
    ^~~~~~~~~~
    ResType
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:40: error: expected ')' before 'ObjectType'
 - (instancetype)initWithObjects:(const ObjectType _Nonnull [_Nullable])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
                                        ^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:60: error: expected ';' before '[' token
 - (instancetype)initWithObjects:(const ObjectType _Nonnull [_Nullable])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
                                                            ^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:22:4: error: 'nullable' does not name a type; did you mean '_Nullable'?
 - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
    ^~~~~~~~
    _Nullable
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:30: error: duplicate interface declaration for class 'NSArray'
 @interface NSArray<ObjectType> (NSExtendedArray)
                              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:30: error: cannot find protocol declaration for 'ObjectType'
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:8: error: redefinition of 'struct NSArray'
 @class NSArray<ObjectType>;
        ^~~~~~~
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /Users/Shared/Development/VTK-8.2.0/source/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:30: error: trying to finish struct, but kicked out due to previous parse errors
 @interface NSArray<ObjectType> (NSExtendedArray)
                              ^
... (many more, about 35.000 lines)

@seanm
Thank you very much. I’ve got some good progress over here! I successfully compiled VTK 8.2.0 using clang.

Now, I tried to run the Cylinder Example with Qt Creator, which works like a charm as long as I compile it with clang as well.

However, in our project we are using GCC, so I tried to compile the example with the latter (using the VTK library compiled with clang) and it indeed compiles and links. Unfortunately, I only get a black screen as output then.

Do you have any idea or hint to solve that?

This is the *.pro file I used (which I created by myself):

TEMPLATE = app
SOURCES += CylinderExample.cxx
INCLUDEPATH += /Users/Shared/Development/VTK-8.2.0_clang/install/include/vtk-8.2
LIBS += \
  -L/Users/Shared/Development/VTK-8.2.0_clang/install/lib \
  -lvtkCommonColor-8.2 \
  -lvtkCommonCore-8.2 \
  -lvtkFiltersSources-8.2 \
  -lvtkInteractionStyle-8.2 \
  -lvtkRenderingContextOpenGL2-8.2 \
  -lvtkRenderingCore-8.2 \
  -lvtkRenderingFreeType-8.2 \
  -lvtkRenderingGL2PSOpenGL2-8.2 \
  -lvtkRenderingOpenGL2-8.2 \
  -lvtkCommonExecutionModel-8.2 \

This is the CylinderExample.cxx with an added define in the beginning to make it work:

#define vtkRenderingCore_AUTOINIT 2(vtkRenderingOpenGL2, vtkInteractionStyle)

#include <vtkActor.h>
#include <vtkCamera.h>
#include <vtkCylinderSource.h>
#include <vtkNamedColors.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkSmartPointer.h>

#include <array>

int main(int, char *[]) {
  vtkSmartPointer<vtkNamedColors> colors =
      vtkSmartPointer<vtkNamedColors>::New();

  // Set the background color.
  std::array<unsigned char, 4> bkg{{26, 51, 102, 255}};
  colors->SetColor("BkgColor", bkg.data());

  // This creates a polygonal cylinder model with eight circumferential facets
  // (i.e, in practice an octagonal prism).
  vtkSmartPointer<vtkCylinderSource> cylinder =
      vtkSmartPointer<vtkCylinderSource>::New();
  cylinder->SetResolution(8);

  // The mapper is responsible for pushing the geometry into the graphics
  // library. It may also do color mapping, if scalars or other attributes are
  // defined.
  vtkSmartPointer<vtkPolyDataMapper> cylinderMapper =
      vtkSmartPointer<vtkPolyDataMapper>::New();
  cylinderMapper->SetInputConnection(cylinder->GetOutputPort());

  // The actor is a grouping mechanism: besides the geometry (mapper), it
  // also has a property, transformation matrix, and/or texture map.
  // Here we set its color and rotate it around the X and Y axes.
  vtkSmartPointer<vtkActor> cylinderActor = vtkSmartPointer<vtkActor>::New();
  cylinderActor->SetMapper(cylinderMapper);
  cylinderActor->GetProperty()->SetColor(
      colors->GetColor4d("Tomato").GetData());
  cylinderActor->RotateX(30.0);
  cylinderActor->RotateY(-45.0);

  // The renderer generates the image
  // which is then displayed on the render window.
  // It can be thought of as a scene to which the actor is added
  vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
  renderer->AddActor(cylinderActor);
  renderer->SetBackground(colors->GetColor3d("BkgColor").GetData());
  // Zoom in a little by accessing the camera and invoking its "Zoom" method.
  renderer->ResetCamera();
  renderer->GetActiveCamera()->Zoom(1.5);

  // The render window is the actual GUI window
  // that appears on the computer screen
  vtkSmartPointer<vtkRenderWindow> renderWindow =
      vtkSmartPointer<vtkRenderWindow>::New();
  renderWindow->SetSize(300, 300);
  renderWindow->AddRenderer(renderer);
  renderWindow->SetWindowName("Cylinder");

  // The render window interactor captures mouse events
  // and will perform appropriate camera or actor manipulation
  // depending on the nature of the events.
  vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
      vtkSmartPointer<vtkRenderWindowInteractor>::New();
  renderWindowInteractor->SetRenderWindow(renderWindow);

  // This starts the event loop and as a side effect causes an initial render.
  renderWindow->Render();
  renderWindowInteractor->Start();

  return EXIT_SUCCESS;
}

If the cylinder example works with clang but not gcc, then perhaps the compilers aren’t bringing in the same libraries.

Run “otool -L” on the gcc version of the example and also on the clang version of the example. Any differences will provide some clues.

1 Like

@dgobbi
Thanks again for your useful advice! Using otool, I indeed found out that there were library discrepancies. The VTK lib, which I compiled with clang is linked against libc++ whereas the CylinderExample, which I compiled with gcc is linked against libstdc++. There is more information about it here including a description on how to use libc++ in a gcc compiled program.

This doesn’t yet explain why exactly the screen stays black, however, I successfully ran the example compiled with gcc and with a working visualization when adding the corresponding compiler flag and include path by adding these two lines to the pro file:

QMAKE_CXXFLAGS += -nostdinc++
INCLUDEPATH += /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1

I will now have to check though whether I am able to use libc++ in our project since there are some other libraries linked, which might link to libstdc++ as well. Also, a first attempt to compile our project with the additional flags produced compile errors with calls to e.g. std::atan2:

In file included from ../../implementation/library/source/linear_algebra_library/coordinate_vector.h:8:0,
                 from ../library/source/general_structs/general_structs.h:4,
                 from ../library/source/general_structs/general_structs.cpp:1:
../../implementation/library/source/linear_algebra_library/coordinate_vector_array.h: In member function 'CoordinateVectorArray<ValueType, MaxSize> CoordinateVectorArray<ValueType, MaxSize>::cartesianToPolar() const':
../../implementation/library/source/linear_algebra_library/coordinate_vector_array.h:611:33: error: 'atan2' is not a member of 'std'
     polarCoords.mData[1] = std::atan2(mData[1], mData[0]);
                                 ^~~~~
../../implementation/library/source/linear_algebra_library/coordinate_vector_array.h:611:33: note: suggested alternative:
In file included from ../../implementation/library/source/linear_algebra_library/coordinate_vector_array.h:4:0,
                 from ../../implementation/library/source/linear_algebra_library/coordinate_vector.h:8,
                 from ../library/source/general_structs/general_structs.h:4,
                 from ../library/source/general_structs/general_structs.cpp:1:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:823:1: note:   'atan2'
 atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
 ^~~~~

Instead, I might need to figure out how to compile VTK with clang, but link against libstdc++, if that is actually possible.

Remaining question for me is, which library (libc++ or libstdc++) is more preferable anyways especially regarding compatibility to other libraries and other target systems.

Thanks so far!

If you are using c++11 (or later) on OS X, then libc++ is definitely the preferred library. It’s what Qt uses by default.

Run otool on one of the Qt libraries (e.g. QtWidgets) to see which one your Qt package is using. You’ll definitely want to use the same one when you build VTK and when you build your app.

Benjamin, it might help to tell us why you are trying to use gcc instead of clang (on macOS). As you’ve seen, gcc can’t even parse the system SDK, so just imagine what kind of other pain lies beyond. :slight_smile:

libstdc++ on macOS is ancient and has no future.

Sean

Thanks for the advice! I’m actually trying to figure out exactly that since the project was created before I started working on it :slight_smile:

So, I’m actually now trying to compile everything with gcc/libc++. And I might even try clang/libc++.

I will let you know if there is any progress or problems.

I’m actually running into linker problems at the moment. For example this:

  "std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
      void std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >::__push_back_slow_path<std::__1::vector<double, std::__1::allocator<double> > const&>(std::__1::vector<double, std::__1::allocator<double> > const&) in debug_results.o
      void std::__1::vector<QString, std::__1::allocator<QString> >::__push_back_slow_path<QString const&>(QString const&) in debug_results.o
      void std::__1::vector<double, std::__1::allocator<double> >::__push_back_slow_path<double const&>(double const&) in debug_results.o
      DebugResults::addPoint(double, double, double, double, QString const&) in debug_results.o
      std::__1::vector<double, std::__1::allocator<double> >::resize(unsigned long) in debug_results.o
      std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >::__append(unsigned long) in debug_results.o
      std::__1::vector<QString, std::__1::allocator<QString> >::__append(unsigned long) in debug_results.o
      ...
  "std::__1::__vector_base_common<true>::__throw_out_of_range() const", referenced from:
      VtkHelper::makeVtkPoints(std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > > const&) in vtk_helper.o

I will have to continue investigating tomorrow. However, if you have a spontaneous idea, I’d be glad to know :slight_smile:

gcc was once the default compiler on macOS. If your project was created long ago it may have been using gcc merely for that reason.

If I were you, I’d start with clang and libc++.

Do you really trust a compiler that can’t build the system SDK to not have code gen bugs or other serious issues? It clearly had limited QA against macOS.

Sean

Here’s an update on my compilation attempt.

I tried to compile our project with clang (using the default stdc++ library), but encountered new errors when it came to compile the FLENS library parts. Here is an excerpt of the error messages:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -isystem /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/ -isystem /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens -isystem /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/blas -isystem /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/super_lu -isystem /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/super_lu_mt -O2 -Wno-deprecated -std=gnu++1y  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DCLIENT -DHYDRAULIC_VERSION -DFRACTURE_FLOW_VERSION -DDEVELOPER_VERSION -DCLIENT_GIT_VERSION="\"git revision count = 4715, git commit = 1928ffd40fd\"" -DQT_THREAD_SUPPORT -DEXPORT_PLOT_OVER_POINTS_TO_ONLY_ONE_FILE_FOR_EACH_EXPORTED_IMAGE -DQT_NO_DEBUG -DQT_MULTIMEDIA_LIB -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_XMLPATTERNS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I../client -I. -I../library/inc/apache_xalanc -I../../implementation -I../client/source -I/Users/Shared/Development/VTK-8.2.0_clang/install/include/vtk-8.2 -I/Users/Shared/Development/netgen-5.3.1_clang/install/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AGL.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtMultimedia.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtOpenGL.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtPrintSupport.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtWidgets.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtQuick.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtGui.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtXmlPatterns.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtQml.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtNetwork.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtSql.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtXml.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtConcurrent.framework/Headers -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib/QtCore.framework/Headers -I. -I. -I/Users/Shared/Qt5.9.1/5.9.1/clang_64/mkspecs/macx-clang -F/Users/Shared/Qt5.9.1/5.9.1/clang_64/lib -o helper.o ../library/source/computation_helper/helper.cpp
In file included from ../library/source/computation_helper/helper.cpp:6:
In file included from ../library/source/computation_helper/../linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:45:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:53:8: error: explicit specialization of non-template struct 'remove_reference'
struct remove_reference<T &>
       ^               ~~~~~
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:59:8: error: explicit specialization of non-template struct 'remove_reference'
struct remove_reference<T &&>
       ^               ~~~~~~
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:75:8: error: explicit specialization of non-template struct 'is_floating_point'
struct is_floating_point<long double>
       ^                ~~~~~~~~~~~~~
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:75:8: error: redefinition of 'is_floating_point' as different kind of symbol
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:68:8: note: previous definition is here
struct is_floating_point
       ^
In file included from ../library/source/computation_helper/helper.cpp:6:
In file included from ../library/source/computation_helper/../linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:36:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:288:27: error: reference to 'remove_reference' is ambiguous
    typedef typename std::remove_reference<T>::type  TT;
                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:1104:50: note: candidate found by name lookup is 'std::__1::remove_reference'
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _Tp type;};
                                                 ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:47:8: note: candidate found by name lookup is 'std::remove_reference'
struct remove_reference
       ^
In file included from ../library/source/computation_helper/helper.cpp:6:
In file included from ../library/source/computation_helper/../linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:36:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:288:43: error: expected member name or ';' after declaration specifiers
    typedef typename std::remove_reference<T>::type  TT;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:290:42: error: use of undeclared identifier 'TT'
    static const bool value = IsGbMatrix<TT>::value
                                         ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:300:27: error: reference to 'remove_reference' is ambiguous
    typedef typename std::remove_reference<T>::type  TT;
                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:1104:50: note: candidate found by name lookup is 'std::__1::remove_reference'
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _Tp type;};
                                                 ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:47:8: note: candidate found by name lookup is 'std::remove_reference'
struct remove_reference
       ^
In file included from ../library/source/computation_helper/helper.cpp:6:
In file included from ../library/source/computation_helper/../linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:36:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:300:43: error: expected member name or ';' after declaration specifiers
    typedef typename std::remove_reference<T>::type  TT;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:302:42: error: use of undeclared identifier 'TT'
    static const bool value = IsGbMatrix<TT>::value
                                         ^
In file included from ../library/source/computation_helper/helper.cpp:6:
In file included from ../library/source/computation_helper/../linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:37:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/geccsmatrix.h:133:27: error: reference to 'remove_reference' is ambiguous
    typedef typename std::remove_reference<T>::type  TT;
                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:1104:50: note: candidate found by name lookup is 'std::__1::remove_reference'
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _Tp type;};
                                                 ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:47:8: note: candidate found by name lookup is 'std::remove_reference'
struct remove_reference
       ^
In file included from ../library/source/computation_helper/helper.cpp:6:
In file included from ../library/source/computation_helper/../linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:37:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/geccsmatrix.h:133:43: error: expected member name or ';' after declaration specifiers
    typedef typename std::remove_reference<T>::type  TT;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/geccsmatrix.h:135:45: error: use of undeclared identifier 'TT'
    static const bool value = IsGeCCSMatrix<TT>::value
                                            ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/geccsmatrix.h:145:27: error: reference to 'remove_reference' is ambiguous
    typedef typename std::remove_reference<T>::type  TT;
                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:1104:50: note: candidate found by name lookup is 'std::__1::remove_reference'
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _Tp type;};
                                                 ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:47:8: note: candidate found by name lookup is 'std::remove_reference'
struct remove_reference
       ^
In file included from ../library/source/computation_helper/helper.cpp:6:
In file included from ../library/source/computation_helper/../linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:37:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/geccsmatrix.h:145:43: error: expected member name or ';' after declaration specifiers
    typedef typename std::remove_reference<T>::type  TT;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/geccsmatrix.h:147:45: error: use of undeclared identifier 'TT'
    static const bool value = IsGeCCSMatrix<TT>::value
                                            ^
In file included from ../library/source/computation_helper/helper.cpp:6:
In file included from ../library/source/computation_helper/../linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:40:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gematrix.h:415:27: error: reference to 'remove_reference' is ambiguous
    typedef typename std::remove_reference<T>::type  TT;
                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:1104:50: note: candidate found by name lookup is 'std::__1::remove_reference'
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _Tp type;};
                                                 ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:47:8: note: candidate found by name lookup is 'std::remove_reference'
struct remove_reference
       ^
In file included from ../library/source/computation_helper/helper.cpp:6:
In file included from ../library/source/computation_helper/../linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:40:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gematrix.h:415:43: error: expected member name or ';' after declaration specifiers
    typedef typename std::remove_reference<T>::type  TT;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gematrix.h:417:42: error: use of undeclared identifier 'TT'
    static const bool value = IsGeMatrix<TT>::value
                                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
In file included from ../library/source/geometry_toolkit/linear_geometry.cpp:1:
In file included from ../library/source/geometry_toolkit/linear_geometry.h:8:
In file included from ../../implementation/library/source/linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:45:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:53:8: error: explicit specialization of non-template struct 'remove_reference'
struct remove_reference<T &>
       ^               ~~~~~
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:59:8: error: explicit specialization of non-template struct 'remove_reference'
struct remove_reference<T &&>
       ^               ~~~~~~
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:75:8: error: explicit specialization of non-template struct 'is_floating_point'
struct is_floating_point<long double>
       ^                ~~~~~~~~~~~~~
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:75:8: error: redefinition of 'is_floating_point' as different kind of symbol
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:68:8: note: previous definition is here
struct is_floating_point
       ^
In file included from ../library/source/geometry_toolkit/linear_geometry.cpp:1:
In file included from ../library/source/geometry_toolkit/linear_geometry.h:8:
In file included from ../../implementation/library/source/linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:36:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:288:27: error: reference to 'remove_reference' is ambiguous
    typedef typename std::remove_reference<T>::type  TT;
                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:1104:50: note: candidate found by name lookup is 'std::__1::remove_reference'
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _Tp type;};
                                                 ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:47:8: note: candidate found by name lookup is 'std::remove_reference'
struct remove_reference
       ^
In file included from ../library/source/geometry_toolkit/linear_geometry.cpp:1:
In file included from ../library/source/geometry_toolkit/linear_geometry.h:8:
In file included from ../../implementation/library/source/linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:36:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:288:43: error: expected member name or ';' after declaration specifiers
    typedef typename std::remove_reference<T>::type  TT;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:290:42: error: use of undeclared identifier 'TT'
    static const bool value = IsGbMatrix<TT>::value
                                         ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:300:27: error: reference to 'remove_reference' is ambiguous
    typedef typename std::remove_reference<T>::type  TT;
                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:1104:50: note: candidate found by name lookup is 'std::__1::remove_reference'
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _Tp type;};
                                                 ^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/hacks/std.h:47:8: note: candidate found by name lookup is 'std::remove_reference'
struct remove_reference
       ^
In file included from ../library/source/geometry_toolkit/linear_geometry.cpp:1:
In file included from ../library/source/geometry_toolkit/linear_geometry.h:8:
In file included from ../../implementation/library/source/linear_algebra_library/flens_dense.h:19:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/../inc/flens/flens/flens.cxx:52:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/flens.h:37:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/blas.h:35:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/blas/assign.h:38:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/matrixtypes.h:39:
In file included from /Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/impl.h:36:
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:300:43: error: expected member name or ';' after declaration specifiers
    typedef typename std::remove_reference<T>::type  TT;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/benjaminwelle/Coding/git/clean/project/implementation/library/source/../inc/flens/flens/matrixtypes/general/impl/gbmatrix.h:302:42: error: use of undeclared identifier 'TT'
    static const bool value = IsGbMatrix<TT>::value
                                         ^

To me it seems FLENS doesn’t support clang? However, on the FLENS homepage it says clang is supported. When I compile it using gcc but with the stdc++ library (see here), it compiles, but I get these linker errors (Note that I took out the referencing classes from the log):

Undefined symbols for architecture x86_64:
  "std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
  "std::__1::__vector_base_common<true>::__throw_out_of_range() const", referenced from:
  "std::__1::__basic_string_common<true>::__throw_length_error() const", referenced from:
  "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
  "std::__1::ios_base::getloc() const", referenced from:
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()", referenced from:
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from:
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(double)", referenced from:
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int)", referenced from:
  "std::__1::random_device::random_device(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
  "std::__1::random_device::~random_device()", referenced from:
  "std::__1::random_device::operator()()", referenced from:
  "std::__1::cout", referenced from:
  "std::__1::ctype<char>::id", referenced from:
  "std::__1::mutex::lock()", referenced from:
  "std::__1::mutex::unlock()", referenced from:
  "std::__1::mutex::~mutex()", referenced from:
  "std::__1::locale::~locale()", referenced from:
  "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
  "std::__1::ios_base::clear(unsigned int)", referenced from:
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

I’m kinda stuck here. Do you or somebody has an idea how to proceed by any chance?

Are you missing “-std=c++11” on your compiler command-line?

FLENS is not part of VTK, so you’ve gone off-topic here.

Yeah, I tried to compile a minimum example now, which I try to compile with:

g++ -Wall -std=c++11 -I/Users/Shared/flens FlensMinimalExample.cxx

However, I still get the same compilation errors when compiling with clang 10.0.1, but it compiles when using gcc 7.4.0 from macports. Anyway, totally right that it’s off-topic, so I will have to switch over to stackoverflow here.

Thanks for all your help!