View Issue Details

IDProjectCategoryView StatusLast Update
0003822Slicer4Core: Building (CMake, Superbuild)public2017-06-10 08:51
Reporterjcfr Assigned Tojcfr  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.4.0Fixed in VersionSlicer 4.4.0 
Summary0003822: Fix packaging of libtk8.6.dylib on MacOSX
Description

Slicer r23629

TagsNo tags attached.

Relationships

related to 0003809 closedjcfr slicer hangs on startup and can lead to machine crashing 

Activities

jcfr

jcfr

2014-09-10 09:15

administrator   ~0012492

Seems there are an issue linking _tkinter module.

As detailed below, it should be:

/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib:/usr/X11R6/lib/libtk8.6.dylib

instead of

/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtk8.6.dylib

$ otool -L ~/Dashboards/Nightly/Slicer-0-build/python-install/lib/python2.7/lib-dynload/_tkinter.so
/Users/kitware/Dashboards/Nightly/Slicer-0-build/python-install/lib/python2.7/lib-dynload/_tkinter.so:
_tkinter.so (compatibility version 0.0.0, current version 0.0.0)
/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.1)
/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib:/usr/X11R6/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.1)
/usr/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
/usr/X11/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/usr/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)

jcfr

jcfr

2014-09-10 09:17

administrator   ~0012493

Looking at python-build/CMakeCache.txt, the library path looks good:

[...]
//No help, variable specified on the command line.
TK_LIBRARY:FILEPATH=/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtk8.6.dylib
[...]

jcfr

jcfr

2014-09-10 09:18

administrator   ~0012494

Looking at the _tkinter.so in the build directory, there is also the problem:

factory@kitware:/Users/kitware/Dashboards/Nightly/Slicer-0-build/python-build> otool -L lib/python2.7/lib-dynload/_tkinter.so
lib/python2.7/lib-dynload/_tkinter.so:
_tkinter.so (compatibility version 0.0.0, current version 0.0.0)
/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.1)
/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib:/usr/X11R6/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.1)

jcfr

jcfr

2014-09-10 09:26

administrator   ~0012495

Strangely the linker command looks good ...

// -----------
$ make extension_tkinter/fast -B VERBOSE=1

[...]

Linking C shared library ../../lib/python2.7/lib-dynload/_tkinter.so
cd /Users/kitware/Dashboards/Nightly/Slicer-0-build/python-build/CMakeBuild/extensions && "/Users/kitware/Dashboards/Support/CMake 3.0.1.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/extension_tkinter.dir/link.txt --verbose=1
"/Users/kitware/Dashboards/Support/CMake 3.0.1.app/Contents/bin/ctest" --launch --target-name extension_tkinter --build-dir /Users/kitware/Dashboards/Nightly/Slicer-0-build/python-build/CMakeBuild/extensions --output ../../lib/python2.7/lib-dynload/_tkinter.so --target-type SHARED_LIBRARY --language C -- /usr/bin/clang -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -O3 -DNDEBUG -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -dynamiclib -Wl,-headerpad_max_install_names -Wl,-undefined,dynamic_lookup -o ../../lib/python2.7/lib-dynload/_tkinter.so -install_name _tkinter.so CMakeFiles/extension_tkinter.dir/Users/kitware/Dashboards/Nightly/Slicer-0-build/Python-2.7.3/Modules/_tkinter.c.o CMakeFiles/extension_tkinter.dir/Users/kitware/Dashboards/Nightly/Slicer-0-build/Python-2.7.3/Modules/tkappinit.c.o /Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtcl8.6.dylib /Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtk8.6.dylib /usr/X11R6/lib/libSM.dylib /usr/X11R6/lib/libICE.dylib /usr/X11R6/lib/libX11.dylib /usr/X11R6/lib/libXext.dylib

// -----------

Here is the same command with space changed into new line:

// --------------
Linking
C
shared
library
../../lib/python2.7/lib-dynload/_tkinter.so
cd
/Users/kitware/Dashboards/Nightly/Slicer-0-build/python-build/CMakeBuild/extensions
&&
"/Users/kitware/Dashboards/Support/CMake
3.0.1.app/Contents/bin/cmake"
-E
cmake_link_script
CMakeFiles/extension_tkinter.dir/link.txt
--verbose=1
"/Users/kitware/Dashboards/Support/CMake
3.0.1.app/Contents/bin/ctest"
--launch
--target-name
extension_tkinter
--build-dir
/Users/kitware/Dashboards/Nightly/Slicer-0-build/python-build/CMakeBuild/extensions
--output
../../lib/python2.7/lib-dynload/_tkinter.so
--target-type
SHARED_LIBRARY
--language
C

/usr/bin/clang

-fno-strict-aliasing
-fwrapv
-Wall
-Wstrict-prototypes
-fPIC
-O3
-DNDEBUG
-arch
x86_64
-isysroot
/Developer/SDKs/MacOSX10.6.sdk
-mmacosx-version-min=10.6
-dynamiclib
-Wl,-headerpad_max_install_names
-Wl,-undefined,dynamic_lookup

-o
../../lib/python2.7/lib-dynload/_tkinter.so
-install_name
_tkinter.so
CMakeFiles/extension_tkinter.dir/Users/kitware/Dashboards/Nightly/Slicer-0-build/Python-2.7.3/Modules/_tkinter.c.o
CMakeFiles/extension_tkinter.dir/Users/kitware/Dashboards/Nightly/Slicer-0-build/Python-2.7.3/Modules/tkappinit.c.o
/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtcl8.6.dylib
/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtk8.6.dylib
/usr/X11R6/lib/libSM.dylib
/usr/X11R6/lib/libICE.dylib
/usr/X11R6/lib/libX11.dylib
/usr/X11R6/lib/libXext.dylib

// ------------

jcfr

jcfr

2014-09-10 09:37

administrator   ~0012496

To summarize, despite the fact the path to tk library is correct:

/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtk8.6.dylib

and the build command is correct:

/usr/bin/clang -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -O3 -DNDEBUG -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -dynamiclib -Wl,-headerpad_max_install_names -Wl,-undefined,dynamic_lookup -o ../../lib/python2.7/lib-dynload/_tkinter.so -install_name _tkinter.so CMakeFiles/extension_tkinter.dir/Users/kitware/Dashboards/Nightly/Slicer-0-build/Python-2.7.3/Modules/_tkinter.c.o CMakeFiles/extension_tkinter.dir/Users/kitware/Dashboards/Nightly/Slicer-0-build/Python-2.7.3/Modules/tkappinit.c.o /Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtcl8.6.dylib /Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtk8.6.dylib /usr/X11R6/lib/libSM.dylib /usr/X11R6/lib/libICE.dylib /usr/X11R6/lib/libX11.dylib /usr/X11R6/lib/libXext.dylib

.. the list of dependency displayed by otool -L is incorrect:

$ otool -L ~/Dashboards/Nightly/Slicer-0-build/python-install/lib/python2.7/lib-dynload/_tkinter.so
/Users/kitware/Dashboards/Nightly/Slicer-0-build/python-install/lib/python2.7/lib-dynload/_tkinter.so:
_tkinter.so (compatibility version 0.0.0, current version 0.0.0)
/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.1)
/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib:/usr/X11R6/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.1)
/usr/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
/usr/X11/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/usr/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)

Additional running the build command with the clang flag "-v" give the complete list of option passed to "ld" linker:

"/usr/bin/ld" -demangle -dynamic -dylib -arch x86_64 -dylib_install_name _tkinter.so -macosx_version_min 10.6.0 -syslibroot /Developer/SDKs/MacOSX10.6.sdk -o ../../lib/python2.7/lib-dynload/_tkinter.so -headerpad_max_install_names -undefined dynamic_lookup CMakeFiles/extension_tkinter.dir/Users/kitware/Dashboards/Nightly/Slicer-0-build/Python-2.7.3/Modules/_tkinter.c.o CMakeFiles/extension_tkinter.dir/Users/kitware/Dashboards/Nightly/Slicer-0-build/Python-2.7.3/Modules/tkappinit.c.o /Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtcl8.6.dylib /Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib/libtk8.6.dylib /usr/X11R6/lib/libSM.dylib /usr/X11R6/lib/libICE.dylib /usr/X11R6/lib/libX11.dylib /usr/X11R6/lib/libXext.dylib -lSystem /Users/kitware/Dashboards/Support/clang+llvm-3.1-x86_64-apple-darwin11/bin/../lib/clang/3.1/lib/darwin/libclang_rt.osx.a

.. and it looks good.

jcfr

jcfr

2014-09-10 09:40

administrator   ~0012497

Pushing further the analysis, and looking at the dependency of tk itself .. we can see something is also wrong:

factory@kitware:/Users/kitware/Dashboards/Nightly/Slicer-0-build/python-build/CMakeBuild/extensions> otool -L ../../../tcl-build/lib/libtk8.6.dylib
../../../tcl-build/lib/libtk8.6.dylib:
/Users/kitware/Dashboards/Nightly/Slicer-0-build/tcl-build/lib:/usr/X11R6/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.1)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
/usr/X11/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/usr/X11/lib/libXss.1.dylib (compatibility version 2.0.0, current version 2.0.0)
/usr/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.44.0)

jcfr

jcfr

2014-09-10 09:44

administrator   ~0012498

Others got similar issue: http://sourceforge.net/p/tcl/mailman/message/30354096/

jcfr

jcfr

2014-09-10 10:37

administrator   ~0012499

Fixed in r23667
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=23667

Related Changesets

Import 2017-06-07 23:51:09: master f199fdb2

2014-09-10 14:23:15

jcfr

Details Diff
BUG: Fix packaging of libtk8.6.dylib on MacOSX. Fixes 0003822

This commit fixes a regression introduced by r23613 (attempts to
address 0003809 by updating tcl version)

Tk 8.6 build system has a known problem building the tk shared library.
To ensure fixup_bundle properly process the _tkinter.so python module,
we implemented the following workaround to fix the library id.
For more details
http://sourceforge.net/p/tcl/mailman/message/30354096/
http://na-mic.org/Mantis/view.php?id=3822

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23667 3bd1e089-480b-0410-8dfb-8563597acbee
mod - SuperBuild/External_tk.cmake Diff File

Issue History

Date Modified Username Field Change
2014-08-27 22:54 jcfr New Issue
2014-08-27 22:54 jcfr Status new => assigned
2014-08-27 22:54 jcfr Assigned To => jcfr
2014-08-27 22:55 jcfr Relationship added related to 0003809
2014-08-27 22:55 jcfr Target Version => Slicer 4.4.0
2014-09-10 09:15 jcfr Note Added: 0012492
2014-09-10 09:17 jcfr Note Added: 0012493
2014-09-10 09:18 jcfr Note Added: 0012494
2014-09-10 09:26 jcfr Note Added: 0012495
2014-09-10 09:37 jcfr Note Added: 0012496
2014-09-10 09:40 jcfr Note Added: 0012497
2014-09-10 09:44 jcfr Note Added: 0012498
2014-09-10 10:37 jcfr Note Added: 0012499
2014-09-10 10:37 jcfr Status assigned => resolved
2014-09-10 10:37 jcfr Fixed in Version => Slicer 4.4.0
2014-09-10 10:37 jcfr Resolution open => fixed
2014-09-17 22:54 jcfr Status resolved => closed
2017-06-10 08:51 jcfr Changeset attached => Slicer master f199fdb2