View Issue Details

IDProjectCategoryView StatusLast Update
0003405Slicer4Core: Building (CMake, Superbuild)public2017-06-10 08:51
Reportersnape Assigned Tojcfr  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformAppleOSOS XOS Version10.8.5
Product VersionSlicer 4.3.0 
Target VersionSlicer 4.5.0-1Fixed in VersionSlicer 4.4.0 
Summary0003405: Superbuild fails when compiling Python and Tk extension on OS X 10.8/10.9 with XQuartz
Description

The file <X11/Xlib.h> included by tkappinit.c and _tkinter.c via <tk.h> cannot be found during the build Python step of the superbuild.

Additional Information

$ uname -rsv
Darwin 12.5.0 Darwin Kernel Version 12.5.0: Mon Jul 29 16:33:49 PDT 2013; root:xnu-2050.48.11~1/RELEASE_X86_64

$ cmake --version
cmake version 2.8.11.2

$ make --version
GNU Make 3.81

$ c++ --version
Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

$ mdls -name kMDItemVersion /Applications/Utilities/XQuartz.app
kMDItemVersion = "2.7.4"

$ git clone git://github.com/Slicer/Slicer.git
$ cd Slicer
$ git svn find-rev HEAD
22454

$ cd ..
$ mkdir Slicer-build
$ cd Slicer-build
$ cmake ../Slicer
$ make
...

Building C object CMakeBuild/extensions/CMakeFiles/extension_tkinter.dir/./Slicer-build/Python-2.7.3/Modules/tkappinit.c.o
In file included from ./Slicer-build/Python-2.7.3/Modules/tkappinit.c:17:
./Slicer-build/tcl-build/include/tk.h:81:11: fatal error: 'X11/Xlib.h' file not found

include <X11/Xlib.h>

            ^

1 error generated.
make: *** [CMakeBuild/extensions/CMakeFiles/extension_tkinter.dir/./Slicer-build/Python-2.7.3/Modules/tkappinit.c.o] Error 1

...

Building C object CMakeBuild/extensions/CMakeFiles/extension_tkinter.dir/./Slicer-build/Python-2.7.3/Modules/_tkinter.c.o
In file included from ./Slicer-build/Python-2.7.3/Modules/_tkinter.c:67:
./Slicer-build/tcl-build/include/tk.h:81:11: fatal error: 'X11/Xlib.h' file not found

include <X11/Xlib.h>

make: *** [CMakeBuild/extensions/CMakeFiles/extension_tkinter.dir/./Slicer-build/Python-2.7.3/Modules/_tkinter.c.o] Error 1

$ locate X11/Xlib.h
...

./Slicer-build/tcl/tk/xlib/X11/Xlib.h
/opt/X11/include/X11/Xlib.h

TagsNo tags attached.

Relationships

has duplicate 0003527 closedjcfr Build fails on Mac OS X 10.9 Maverick - xcode 5.0.2 
related to 0003521 closedjcfr Build fails on Mac OS X 10.9 Maverick due to compile error in VTK 

Activities

snape

snape

2013-09-18 08:03

developer   ~0010003

Last edited: 2013-09-18 08:03

There is an issue with the "--x-libraries" and "--x-includes" options of Superbuild/tk_configure_step.cmake.in:41, but patching that with a version check for OS X 10.8 or a check for the presence of XQuartz does not solve the issue.

jcfr

jcfr

2013-09-25 13:00

administrator   ~0010089

Workaround: Build with -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF

Tcl is required only for EMSegment module.

fedorov

fedorov

2013-10-04 09:38

developer   ~0010134

Workaround if you need TCL: run "make VERBOSE=1", copy the failing compile command, manually add -I/usr/X11R6/include to the command line to build the failing components (there are only 2-3 items where this is needed).

pieper

pieper

2013-10-06 13:44

administrator   ~0010146

The issue is actually in the python build system - error occurs here: Slicer-superbuild/Python-2.7.3/Modules/tkappinit.c

Python should inherit the command line flags (include path) from tk. It's not clear to me how to add this to the cmakeified python superbuild.

hjmjohnson

hjmjohnson

2013-12-30 08:39

developer   ~0010473

FYI: I wanted to confirm that this issues is still a problem without a good resolution.

pieper

pieper

2014-02-27 04:56

administrator   ~0010649

Corresponding bug filed with cmake'ified python:

https://github.com/davidsansome/python-cmake-buildsystem/issues/33

jcfr

jcfr

2014-08-21 13:44

administrator   ~0012408

Fixed in r23608
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=23608

Related Changesets

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

2014-08-21 17:32:17

jcfr

Details Diff
COMP: Fix build error when building on MacOSX 10.8/10.9. Issue 0003405

This commit updates the python build system and ensure tk can be configured
when X11 header and libraries are in non-system location.

Python build system changes:

$ git shortlog 3c5864f2..47845 --no-merges
Jean-Christophe Fillion-Robin (12):
Update .gitignore
README: Re-organize README using markdown
README: Associate Apache 2.0 License
README: Update curl command to follow redirect
README: Add instruction to check MD5 sum of the downloaded source package
README: Add instruction to extract Python source archive
README: Reference license file using relative link
README: Format list of CMake options
Display system processor
Fix get_target_property warning related to non existent target
Fix readline build error occurring when targeting MacOSX SDK 10.4
Find X11 library and header to fix tkinter compile error. Fixes 0000033

Matt McCormick (3):
Update Python version in README 2.7.1 -> 2.7.3.
Support build for Linux/ARM.
Reformat README from Markdown to reStructuredText.

Yann Collette (2):
Simplify handling of python version introducing PY_VERSION CMake variable
Fix failed uint{32,64}_t / int{32,64}_t detection on some platforms.

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

Issue History

Date Modified Username Field Change
2013-09-18 07:50 snape New Issue
2013-09-18 07:50 snape Status new => assigned
2013-09-18 07:50 snape Assigned To => jcfr
2013-09-18 07:55 snape Additional Information Updated
2013-09-18 08:03 snape Note Added: 0010003
2013-09-18 08:03 snape Note Edited: 0010003
2013-09-18 08:11 snape OS => OS X
2013-09-18 08:11 snape OS Version => 10.8.5
2013-09-18 08:11 snape Platform => Apple
2013-09-18 08:11 snape Build => svn22454
2013-09-25 13:00 jcfr Note Added: 0010089
2013-09-25 13:01 jcfr Target Version => Slicer 4.4.0
2013-10-04 09:38 fedorov Note Added: 0010134
2013-10-06 13:44 pieper Note Added: 0010146
2013-12-06 08:45 jcfr Relationship added related to 0003521
2013-12-30 08:39 hjmjohnson Note Added: 0010473
2014-02-27 04:56 pieper Note Added: 0010649
2014-03-07 10:26 jcfr Relationship added has duplicate 0003527
2014-03-07 10:26 jcfr Summary Superbuild fails when compiling Python and Tk extension on OS X 10.8 with XQuartz => Superbuild fails when compiling Python and Tk extension on OS X 10.8/10.9 with XQuartz
2014-07-29 10:09 jcfr Target Version Slicer 4.4.0 => Slicer 4.5.0-1
2014-08-21 13:44 jcfr Note Added: 0012408
2014-08-21 13:44 jcfr Status assigned => resolved
2014-08-21 13:44 jcfr Fixed in Version => Slicer 4.4.0
2014-08-21 13:44 jcfr Resolution open => fixed
2014-08-29 07:50 jcfr Status resolved => closed
2017-06-10 08:51 jcfr Changeset attached => Slicer master c80c3351