[vtkusers] Failing VTK 6.1.1 build with Tk/Python on OSX 10.9.4

David Gobbi david.gobbi at gmail.com
Wed Sep 17 08:38:32 EDT 2014


Hi Jens,

On my machine (which is also 10.9.4), my cache has the following:

TK_INTERNAL_PATH:PATH=/System/Library/Frameworks/Tk.framework/PrivateHeaders

An "ls -l" of the framework directory shows this, where Current -> 8.5

PrivateHeaders -> Versions/Current/PrivateHeaders

The above link should have been created by Xcode.

The TK_INTERNAL_PATH variable is set in Rendering/Tk/CMakeLists.txt,
and it definitely looks in PrivateHeaders before looking anywhere else.  Does
the PrivateHeaders directory exist in your framework directory?  My machine
has this:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/PrivateHeaders

I have Xcode 5.1.1, and I also have the Xcode command-line tools installed.

 - David

On Wed, Sep 17, 2014 at 4:06 AM, Jens <linucks42 at gmail.com> wrote:
> Hi David,
>
> I'm still struggling to get this build to work. I pointed the CMakeCache.txt
> at the correct header and library directories (for tk 8.5), but it persisted
> in setting:
>
> TK_INTERNAL_PATH:PATH=/opt/VTK-6.1.0/ThirdParty/TclTk/internals/tk8.6
>
> i.e. for version 8.6. In the end I manually set TK_INTERNAL_PATH so that it
> pointed at tk 8.5.
>
> The settings in my CMakeCache.txt are therefore:
>
> //Path to a file.
>
> TCL_INCLUDE_PATH:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/tcl.framework/Headers
>
> //Path to a library.
>
> TCL_LIBRARY:FILEPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/tcl.framework
>
> //Path to a program.
>
> TCL_TCLSH:FILEPATH=/usr/bin/tclsh
>
> //Path to a file.
>
> TK_INCLUDE_PATH:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/tk.framework/Headers
>
> //The path to the Tk internal headers (tkMacOSXDefault.h).
>
> TK_INTERNAL_PATH:PATH=/opt/VTK-6.1.0/ThirdParty/TclTk/internals/tk8.5
>
> //Path to a library.
>
> TK_LIBRARY:FILEPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/tk.framework
>
>
> and just for reference, a long-listing of the tk.framework/Versions
> directory shows:
>
> Current -> 8.5
>
>
> i.e. I'm pretty certain I should be using 8.5.
>
>
> If I now run the make, it dies as follows:
>
>
> [ 59%] Building CXX object
> Rendering/Tk/CMakeFiles/vtkRenderingPythonTkWidgets.dir/vtkCocoaTkUtilities.mm.o
>
> cd /opt/VTK-6.1.0/build/Rendering/Tk && /usr/bin/c++   -DVTK_IN_VTK
> -DvtkRenderingPythonTkWidgets_EXPORTS -g -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
> -fPIC -I/opt/VTK-6.1.0/build/Interaction/Image
> -I/opt/VTK-6.1.0/Interaction/Image -I/opt/VTK-6.1.0/build/Imaging/Color
> -I/opt/VTK-6.1.0/Imaging/Color -I/opt/VTK-6.1.0/build/Imaging/Core
> -I/opt/VTK-6.1.0/Imaging/Core -I/opt/VTK-6.1.0/build/Common/ExecutionModel
> -I/opt/VTK-6.1.0/Common/ExecutionModel
> -I/opt/VTK-6.1.0/build/Common/DataModel -I/opt/VTK-6.1.0/Common/DataModel
> -I/opt/VTK-6.1.0/build/Common/Math -I/opt/VTK-6.1.0/Common/Math
> -I/opt/VTK-6.1.0/build/Common/Core -I/opt/VTK-6.1.0/Common/Core
> -I/opt/VTK-6.1.0/build/Utilities/KWSys -I/opt/VTK-6.1.0/Utilities/KWSys
> -I/opt/VTK-6.1.0/build/Common/Misc -I/opt/VTK-6.1.0/Common/Misc
> -I/opt/VTK-6.1.0/build/Common/System -I/opt/VTK-6.1.0/Common/System
> -I/opt/VTK-6.1.0/build/Common/Transforms -I/opt/VTK-6.1.0/Common/Transforms
> -I/opt/VTK-6.1.0/build/Interaction/Style -I/opt/VTK-6.1.0/Interaction/Style
> -I/opt/VTK-6.1.0/build/Filters/Extraction
> -I/opt/VTK-6.1.0/Filters/Extraction -I/opt/VTK-6.1.0/build/Filters/Core
> -I/opt/VTK-6.1.0/Filters/Core -I/opt/VTK-6.1.0/build/Filters/General
> -I/opt/VTK-6.1.0/Filters/General
> -I/opt/VTK-6.1.0/build/Common/ComputationalGeometry
> -I/opt/VTK-6.1.0/Common/ComputationalGeometry
> -I/opt/VTK-6.1.0/build/Filters/Statistics
> -I/opt/VTK-6.1.0/Filters/Statistics -I/opt/VTK-6.1.0/build/Imaging/Fourier
> -I/opt/VTK-6.1.0/Imaging/Fourier -I/opt/VTK-6.1.0/build/ThirdParty/alglib
> -I/opt/VTK-6.1.0/ThirdParty/alglib -I/opt/VTK-6.1.0/build/Filters/Sources
> -I/opt/VTK-6.1.0/Filters/Sources -I/opt/VTK-6.1.0/build/Rendering/Core
> -I/opt/VTK-6.1.0/Rendering/Core -I/opt/VTK-6.1.0/build/Filters/Geometry
> -I/opt/VTK-6.1.0/Filters/Geometry -I/opt/VTK-6.1.0/build/Interaction/Widgets
> -I/opt/VTK-6.1.0/Interaction/Widgets -I/opt/VTK-6.1.0/build/Filters/Hybrid
> -I/opt/VTK-6.1.0/Filters/Hybrid -I/opt/VTK-6.1.0/build/Imaging/Sources
> -I/opt/VTK-6.1.0/Imaging/Sources -I/opt/VTK-6.1.0/build/Filters/Modeling
> -I/opt/VTK-6.1.0/Filters/Modeling -I/opt/VTK-6.1.0/build/Imaging/General
> -I/opt/VTK-6.1.0/Imaging/General -I/opt/VTK-6.1.0/build/Imaging/Hybrid
> -I/opt/VTK-6.1.0/Imaging/Hybrid -I/opt/VTK-6.1.0/build/IO/Image
> -I/opt/VTK-6.1.0/IO/Image -I/opt/VTK-6.1.0/build/Utilities/DICOMParser
> -I/opt/VTK-6.1.0/Utilities/DICOMParser -I/opt/VTK-6.1.0/build/IO/Core
> -I/opt/VTK-6.1.0/IO/Core -I/opt/VTK-6.1.0/build/ThirdParty/zlib
> -I/opt/VTK-6.1.0/ThirdParty/zlib
> -I/opt/VTK-6.1.0/build/Utilities/MetaIO/vtkmetaio
> -I/opt/VTK-6.1.0/build/Utilities/MetaIO -I/opt/VTK-6.1.0/Utilities/MetaIO
> -I/opt/VTK-6.1.0/build/ThirdParty/jpeg -I/opt/VTK-6.1.0/ThirdParty/jpeg
> -I/opt/VTK-6.1.0/build/ThirdParty/png -I/opt/VTK-6.1.0/ThirdParty/png
> -I/opt/VTK-6.1.0/build/ThirdParty/tiff -I/opt/VTK-6.1.0/ThirdParty/tiff
> -I/opt/VTK-6.1.0/build/Rendering/Annotation
> -I/opt/VTK-6.1.0/Rendering/Annotation
> -I/opt/VTK-6.1.0/build/Rendering/FreeType
> -I/opt/VTK-6.1.0/Rendering/FreeType
> -I/opt/VTK-6.1.0/build/ThirdParty/freetype
> -I/opt/VTK-6.1.0/ThirdParty/freetype -I/opt/VTK-6.1.0/ThirdParty/ftgl/src
> -I/opt/VTK-6.1.0/build/ThirdParty/ftgl -I/opt/VTK-6.1.0/ThirdParty/ftgl
> -I/opt/VTK-6.1.0/build/Rendering/Volume -I/opt/VTK-6.1.0/Rendering/Volume
> -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks
> -I/opt/VTK-6.1.0/build/Rendering/OpenGL -I/opt/VTK-6.1.0/Rendering/OpenGL
> -I/opt/VTK-6.1.0/build/Utilities/ParseOGLExt
> -I/opt/VTK-6.1.0/Utilities/ParseOGLExt
> -I/opt/VTK-6.1.0/build/Utilities/EncodeString
> -I/opt/VTK-6.1.0/Utilities/EncodeString
> -I/opt/VTK-6.1.0/build/ThirdParty/TclTk -I/opt/VTK-6.1.0/ThirdParty/TclTk
> -I/opt/VTK-6.1.0/build/Rendering/Tk -I/opt/VTK-6.1.0/Rendering/Tk
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/tk.framework/Headers
> -I/opt/VTK-6.1.0/ThirdParty/TclTk/internals/tk8.5
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/tcl.framework/Headers
> -I/opt/VTK-6.1.0/Wrapping/Tcl -I/opt/VTK-6.1.0/build/Wrapping/Tcl    -o
> CMakeFiles/vtkRenderingPythonTkWidgets.dir/vtkCocoaTkUtilities.mm.o -c
> /opt/VTK-6.1.0/Rendering/Tk/vtkCocoaTkUtilities.mm
>
> /opt/VTK-6.1.0/Rendering/Tk/vtkCocoaTkUtilities.mm:57:28: error: no member
> named 'view' in 'TkWindowPrivate'
>
>   NSView *result = macWin->view;
>
>                    ~~~~~~  ^
>
> 1 error generated.
>
> make[2]: ***
> [Rendering/Tk/CMakeFiles/vtkRenderingPythonTkWidgets.dir/vtkCocoaTkUtilities.mm.o]
> Error 1
>
> make[1]: *** [Rendering/Tk/CMakeFiles/vtkRenderingPythonTkWidgets.dir/all]
> Error 2
>
> make: *** [all] Error 2
>
> If I get clang to print out the tk.h and tcl.h header files, it shows the
> following:
>
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/tcl.framework/Headers/tcl.h
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/tk.framework/Headers/tk.h
>
>
> Do you have any suggestions as to what might be going wrong here?
>
>
> Best wishes,
>
>
> Jens
>
>
> On 15 September 2014 13:27, David Gobbi <david.gobbi at gmail.com> wrote:
>>
>> Hi Jens,
>>
>> I looked through FindTCL.cmake, and it looks like it tries to match
>> the header to the library.  Since it tries but fails, this could be
>> considered a bug.
>>
>>  - David
>>
>>
>> On Mon, Sep 15, 2014 at 3:21 AM, Jens <linucks42 at gmail.com> wrote:
>> > Hi David,
>> >
>> > Many thanks for the quick and very helpful reply. As you suspected there
>> > was
>> > a mismatch between the tcl/tk headers. The headers were coming from:
>> >
>> > /usr/local/include
>> >
>> > and the libraries from:
>> >
>> >
>> > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/tcl.framework
>> >
>> > I've pointed both at the /Applications/... directories and the build has
>> > now
>> > got beyond that point, so thanks again for your help.
>> >
>> > Would that be considered a bug in cmake, or just bad luck on my part?
>> >
>> > I hadn't knowingly installed anything tk/tcl related on my machine (it's
>> > a
>> > new macbook air and I've not loaded much software at all onto it), so
>> > I've
>> > no idea where the stuff in /usr/local came from.
>> >
>> > However, if cmake had found the include files in /usr/local, shouldn't
>> > it
>> > also have used the related libraries in /usr/local?
>> >
>> > Best wishes,
>> >
>> > Jens
>> >
>> >
>> >
>> > On 14 September 2014 22:34, David Gobbi <david.gobbi at gmail.com> wrote:
>> >>
>> >> Hi Jens,
>> >>
>> >> If the VTK build is looking for a function called Tcl_GetErrorLine(),
>> >> that means that it is using a "tcl.h" for Tcl 8.6.  This function
>> >> doesn't
>> >> exist in Tcl 8.5 or earlier versions of Tcl.
>> >>
>> >> My guess is that you have installed Tcl 8.6 on your system, and
>> >> CMake has found the Tcl 8.6 headers, but is linking to the Tcl 8.5
>> >> libraries in the System folder.
>> >>
>> >> Make sure that your CMakeCache.txt use the same framework for
>> >> all the Tcl variables:
>> >>
>> >> TCL_INCLUDE_PATH:PATH=/System/Library/Frameworks/Tcl.framework/Headers
>> >> TCL_LIBRARY:FILEPATH=/System/Library/Frameworks/Tcl.framework
>> >> TCL_TCLSH:FILEPATH=/usr/bin/tclsh
>> >> TK_INCLUDE_PATH:PATH=/System/Library/Frameworks/Tk.framework/Headers
>> >>
>> >>
>> >> TK_INTERNAL_PATH:PATH=/System/Library/Frameworks/Tk.framework/PrivateHeaders
>> >> TK_LIBRARY:FILEPATH=/System/Library/Frameworks/Tk.framework
>> >>
>> >> If you still have problems after setting your cache as shown above,
>> >> then
>> >> you might have to find and remove the tcl.h file that is causing the
>> >> error.
>> >>
>> >>  - David
>> >>
>> >>
>> >> On Sun, Sep 14, 2014 at 2:57 PM, Jens <linucks42 at gmail.com> wrote:
>> >> > Hi,
>> >> >
>> >> > I'm trying to build VTK 6.1.1 with the Tk and Python bindings on OSX
>> >> > 10.9.4,
>> >> > with cmake 3.0.2 and At 5.3.1.
>> >> >
>> >> > The build is failing with:
>> >> >
>> >> > /usr/bin/c++    -g -isysroot
>> >> >
>> >> >
>> >> > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
>> >> > -dynamiclib -Wl,-headerpad_max_install_names
>> >> > -compatibility_version
>> >> > 1.0.0
>> >> > -current_version 1.0.0 -o ../../lib/libvtkCommonCoreTCL-6.1.1.dylib
>> >> > -install_name
>> >> > /opt/VTK-6.1.0/build/lib/libvtkCommonCoreTCL-6.1.1.dylib
>> >> >
>> >> > ...snip...
>> >> >
>> >> > CMakeFiles/vtkCommonCoreTCL.dir/vtkTypeFloat64ArrayTcl.cxx.o
>> >> > CMakeFiles/vtkCommonCoreTCL.dir/vtkCommonCoreTCLInit.cxx.o
>> >> > CMakeFiles/vtkCommonCoreTCL.dir/__/__/Wrapping/Tcl/vtkTclUtil.cxx.o
>> >> > ../../lib/libvtkCommonCore-6.1.1.dylib
>> >> > ../../lib/libvtksys-6.1.1.dylib
>> >> > -framework tcl -lm
>> >> >
>> >> > Undefined symbols for architecture x86_64:
>> >> >
>> >> >   "_Tcl_GetErrorLine", referenced from:
>> >> >
>> >> >       vtkTclVoidFunc(void*) in vtkTclUtil.cxx.o
>> >> >
>> >> >       vtkTclCommand::Execute(vtkObject*, unsigned long, void*) in
>> >> > vtkTclUtil.cxx.o
>> >> >
>> >> > ld: symbol(s) not found for architecture x86_64
>> >> >
>> >> > clang: error: linker command failed with exit code 1 (use -v to see
>> >> > invocation)
>> >> >
>> >> > make[2]: *** [lib/libvtkCommonCoreTCL-6.1.1.dylib] Error 1
>> >> >
>> >> > make[1]: *** [Common/Core/CMakeFiles/vtkCommonCoreTCL.dir/all] Error
>> >> > 2
>> >> >
>> >> >
>> >> > Can anyone suggest a workaround?
>> >> >
>> >> >
>> >> > Best wishes,
>> >> >
>> >> >
>> >> > Jens
>> >
>> >
>
>


More information about the vtkusers mailing list