[Insight-users] ITK on OS X with Python
Carlos Phillips
carlos . phillips at mail . mcgill . ca
Mon, 8 Dec 2003 01:09:38 -0500
Hi,
I have just compiled ITK on OS X.3 with MacPython (python 2.3). When
the compilation finishes, the examples have compiled and seem to work.
However, the python wrapper layer does not seem to work at all. When I
run "import InsightToolkit" in python, I get a segmentation fault.
The main changes I made to the file are:
BUILD_SHARED_LIBS:BOOL=ON
CMAKE_INSTALL_PREFIX:PATH=/usr/local
ITK_CSWIG_PYTHON:BOOL=ON
Can ITK be built with support for this version of python on OS X.3 ? If
so what is wrong with my config?
Carlos
I have included a backtrace of python before it crashes:
#0 0x088b3690 in std::locale::facet::facet[unified](unsigned long)
(std::locale::facet::facet[unified](unsigned long) + 8)
#1 0x088d8654 in std::ctype<char>::ctype[unified](unsigned long
const*, bool, unsigned long) (std::ctype<char>::ctype[unified](unsigned
long const*, bool, unsigned long) + 44)
#2 0x088df9a0 in
std::locale::_Impl::_Impl[unified](std::locale::facet**, unsigned long,
bool) (std::locale::_Impl::_Impl[unified](std::locale::facet**,
unsigned long, bool) + 228)
#3 0x088b3418 in std::locale::classic() (std::locale::classic() + 92)
#4 0x088b259c in std::locale::locale[unified]()
(std::locale::locale[unified]() + 48)
#5 0x088d963c in std::basic_filebuf<char, std::char_traits<char>
>::basic_filebuf[unified]() (std::basic_filebuf<char,
std::char_traits<char> >::basic_filebuf[unified]() + 108)
#6 0x088b1df8 in _gnu_cxx::stdio_filebuf<char,
std::char_traits<char> >::stdio_filebuf[unified](__sFILE*,
std::_Ios_Openmode, unsigned long) (_gnu_cxx::stdio_filebuf<char,
std::char_traits<char> >::stdio_filebuf[unified](__sFILE*,
std::_Ios_Openmode, unsigned long) + 44)
#7 0x0889e6cc in std::ios_base::Init::_S_ios_create(bool)
(std::ios_base::Init::_S_ios_create(bool) + 104)
#8 0x0889ebbc in std::ios_base::Init::Init[unified]()
(std::ios_base::Init::Init[unified]() + 64)
#9 0x091cb8a4 in 0x91cb8a4
#10 0x091cb908 in 0x91cb908
#11 0x8fe17b38 in call_module_initializers_for_objects
(call_module_initializers_for_objects + 428)
#12 0x8fe17600 in call_module_initializers (call_module_initializers
+ 64)
#13 0x8fe118ac in link_in_need_modules (link_in_need_modules + 468)
#14 0x8fe134e4 in _dyld_link_module (_dyld_link_module + 564)
#15 0x9003f5a8 in NSLinkModule (NSLinkModule + 104)
#16 0x95fcc4e4 in _PyImport_GetDynLoadFunc (_PyImport_GetDynLoadFunc
+ 200)
#17 0x95fc1b6c in _PyImport_LoadDynamicModule
(_PyImport_LoadDynamicModule + 116)
#18 0x95fbf7a4 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 6072)
#19 0x95fc08c4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
2352)
#20 0x95fc02e0 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
844)
#21 0x95fbfe00 in PyImport_ImportModule (PyImport_ImportModule + 200)
#22 0x95fbffd4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
64)
#23 0x95f9cbf0 in _PyUnicodeUCS2_IsAlpha (_PyUnicodeUCS2_IsAlpha +
144)
#24 0x95f4a8d0 in PyObject_Call (PyObject_Call + 48)
#25 0x95fa91ec in PyEval_CallObjectWithKeywords
(PyEval_CallObjectWithKeywords + 256)
#26 0x95fa6984 in PyEval_EvalCode (PyEval_EvalCode + 8832)
#27 0x95fa7e30 in PyEval_EvalCodeEx (PyEval_EvalCodeEx + 2128)
#28 0x95fa4734 in PyEval_EvalCode (PyEval_EvalCode + 48)
#29 0x95fbe100 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 276)
#30 0x95fbe808 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 2076)
#31 0x95fbf784 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 6040)
#32 0x95fc08c4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
2352)
#33 0x95fc02e0 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
844)
#34 0x95fbfe00 in PyImport_ImportModule (PyImport_ImportModule + 200)
#35 0x95fbffd4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
64)
#36 0x95f9cbf0 in _PyUnicodeUCS2_IsAlpha (_PyUnicodeUCS2_IsAlpha +
144)
#37 0x95f4a8d0 in PyObject_Call (PyObject_Call + 48)
#38 0x95fa91ec in PyEval_CallObjectWithKeywords
(PyEval_CallObjectWithKeywords + 256)
#39 0x95fa6984 in PyEval_EvalCode (PyEval_EvalCode + 8832)
#40 0x95fa7e30 in PyEval_EvalCodeEx (PyEval_EvalCodeEx + 2128)
#41 0x95fa4734 in PyEval_EvalCode (PyEval_EvalCode + 48)
#42 0x95fbe100 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 276)
#43 0x95fbe808 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 2076)
#44 0x95fbf784 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 6040)
#45 0x95fc08c4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
2352)
#46 0x95fc02e0 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
844)
#47 0x95fbfe00 in PyImport_ImportModule (PyImport_ImportModule + 200)
#48 0x95fbffd4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
64)
#49 0x95f9cbf0 in _PyUnicodeUCS2_IsAlpha (_PyUnicodeUCS2_IsAlpha +
144)
#50 0x95f4a8d0 in PyObject_Call (PyObject_Call + 48)
#51 0x95fa91ec in PyEval_CallObjectWithKeywords
(PyEval_CallObjectWithKeywords + 256)
#52 0x95fa6984 in PyEval_EvalCode (PyEval_EvalCode + 8832)
#53 0x95fa7e30 in PyEval_EvalCodeEx (PyEval_EvalCodeEx + 2128)
#54 0x95fa4734 in PyEval_EvalCode (PyEval_EvalCode + 48)
#55 0x95fbe100 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 276)
#56 0x95fbe808 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 2076)
#57 0x95fbf784 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 6040)
#58 0x95fc08c4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
2352)
#59 0x95fc02e0 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
844)
#60 0x95fbfe00 in PyImport_ImportModule (PyImport_ImportModule + 200)
#61 0x95fbffd4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
64)
#62 0x95f9cbf0 in _PyUnicodeUCS2_IsAlpha (_PyUnicodeUCS2_IsAlpha +
144)
#63 0x95f4a8d0 in PyObject_Call (PyObject_Call + 48)
#64 0x95fa91ec in PyEval_CallObjectWithKeywords
(PyEval_CallObjectWithKeywords + 256)
#65 0x95fa6984 in PyEval_EvalCode (PyEval_EvalCode + 8832)
#66 0x95fa7e30 in PyEval_EvalCodeEx (PyEval_EvalCodeEx + 2128)
#67 0x95fa4734 in PyEval_EvalCode (PyEval_EvalCode + 48)
#68 0x95fbe100 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 276)
#69 0x95fbe808 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 2076)
#70 0x95fbf784 in PyImport_ExecCodeModuleEx
(PyImport_ExecCodeModuleEx + 6040)
#71 0x95fc08c4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
2352)
#72 0x95fc02e0 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
844)
#73 0x95fbfe00 in PyImport_ImportModule (PyImport_ImportModule + 200)
#74 0x95fbffd4 in PyImport_ImportModuleEx (PyImport_ImportModuleEx +
64)
#75 0x95f9cbf0 in _PyUnicodeUCS2_IsAlpha (_PyUnicodeUCS2_IsAlpha +
144)
#76 0x95f4a8d0 in PyObject_Call (PyObject_Call + 48)
#77 0x95fa91ec in PyEval_CallObjectWithKeywords
(PyEval_CallObjectWithKeywords + 256)
#78 0x95fa6984 in PyEval_EvalCode (PyEval_EvalCode + 8832)
#79 0x95fa7e30 in PyEval_EvalCodeEx (PyEval_EvalCodeEx + 2128)
#80 0x95fa4734 in PyEval_EvalCode (PyEval_EvalCode + 48)
#81 0x95fc85f0 in PyRun_FileExFlags (PyRun_FileExFlags + 228)
#82 0x95fc7354 in PyRun_InteractiveOneFlags
(PyRun_InteractiveOneFlags + 496)
#83 0x95fc713c in PyRun_InteractiveLoopFlags
(PyRun_InteractiveLoopFlags + 268)
#84 0x95fc6fd4 in PyRun_AnyFileExFlags (PyRun_AnyFileExFlags + 84)
#85 0x95fd1ec0 in Py_Main (Py_Main + 1996)
#86 0x00003c78 in start (start + 444)
#87 0x00003aec in start (start + 48)