Compile error building VTK-9.3.0.rc1 on MacOS sequoia

Building VTK-9.3.0.rc1 on MacOS Sequoia, running xcode Version 16.3 (16E140). Following compile error occurs:

[  1%] Building C object ThirdParty/zlib/vtkzlib/CMakeFiles/zlib.dir/zutil.c.o
cd /Users/oreilly/VTK-9.3.0.rc1/build/ThirdParty/zlib/vtkzlib && /Applications/X
code.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DZLI
B_DLL -I/Users/oreilly/VTK-9.3.0.rc1/build/ThirdParty/zlib/vtkzlib -I/Users/orei
lly/VTK-9.3.0.rc1/ThirdParty/zlib/vtkzlib -isystem /Users/oreilly/VTK-9.3.0.rc1/
build/ThirdParty/zlib -isystem /Users/oreilly/VTK-9.3.0.rc1/ThirdParty/zlib -g -
arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX
.platform/Developer/SDKs/MacOSX15.4.sdk -mmacosx-version-min=15.3 -fPIC -MD -MT 
ThirdParty/zlib/vtkzlib/CMakeFiles/zlib.dir/zutil.c.o -MF CMakeFiles/zlib.dir/zu
til.c.o.d -o CMakeFiles/zlib.dir/zutil.c.o -c /Users/oreilly/VTK-9.3.0.rc1/Third
Party/zlib/vtkzlib/zutil.c
In file included from /Users/oreilly/VTK-9.3.0.rc1/ThirdParty/zlib/vtkzlib/zutil
.c:8:
/Users/oreilly/VTK-9.3.0.rc1/ThirdParty/zlib/vtkzlib/zutil.h:170:11: warning: 'O
S_CODE' macro redefined [-Wmacro-redefined]
  170 | #  define OS_CODE 19
      |           ^
/Users/oreilly/VTK-9.3.0.rc1/ThirdParty/zlib/vtkzlib/zutil.h:141:11: note: previ
ous definition is here
  141 | #  define OS_CODE  7
      |           ^
In file included from /Users/oreilly/VTK-9.3.0.rc1/ThirdParty/zlib/vtkzlib/zutil
.c:10:
In file included from /Users/oreilly/VTK-9.3.0.rc1/ThirdParty/zlib/vtkzlib/gzgut
s.h:21:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOS
X.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/stdio.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/_stdio.h:318:7: error: expected identifier or '('
  318 | FILE    *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
      |          ^

Anyone know how I can fix this?
Thanks!

This was fixed in an updated zlib version that VTK originally included in the 9.4 release (see linked commit below). It resolved issues with newer clang versions as you’ve experienced. If possible, I would suggest using VTK 9.4.2 instead of 9.3.0rc1.

Unfortunately build of VTK 9.4.2 also fails on macos sequoia, for a different reaon - documented here

Anyone know when this VTK bug will be fixed on MacOS Sequoia?

This is already fixed in master.

1 Like

Sweet, master builds on Sequoia! Does anyone know when these fixes will be incoporated into a release? (My app requires VTK 9.3+ on MacOS Sequoia, would be nice if it used an official VTK release)

It will be available in the upcoming v9.5.0 release.