前提・実現したいこと
pyenv上のpython3.6.5でのpyROOTのimport
発生している問題
CERNの提供するデータ解析用ライブラリ群ROOTをmacにインストールしていますが、C++ベースの記述では問題なく動くのに対して、python上でpyROOTをimportしようとした際にはセグメンテーション違反を起こしてそのままpythonごと落ちてしまいます。
システム上のpython2.7を指定してビルドした際には問題なくimportできていたため、おそらくROOTをビルドする際にpyenv上のpython3.6を指定しているためなのではと考えていますが、問題を解決できず困っています。
エラー文
shu:~ $ python Python 3.6.5 (default, Apr 26 2019, 15:48:26) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ROOT *** Break *** segmentation violation [/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info) [/usr/lib/system/libsystem_c.dylib] tzsetwall_basic (no debug info) [/Users/shu/root/lib/libPyROOT.so] _GLOBAL__sub_I_TMemoryRegulator.cxx /Users/shu/root-6.14.06/bindings/pyroot/src/TMemoryRegulator.cxx:30 [/usr/lib/dyld] ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (no debug info) [/usr/lib/dyld] ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (no debug info) [/usr/lib/dyld] ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) (no debug info) [/usr/lib/dyld] ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) (no debug info) [/usr/lib/dyld] ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) (no debug info) [/usr/lib/dyld] dyld::runInitializers(ImageLoader*) (no debug info) [/usr/lib/dyld] dlopen (no debug info) [/usr/lib/system/libdyld.dylib] dlopen (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyImport_FindSharedFuncptr (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyImport_LoadDynamicModuleWithSpec (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _imp_create_dynamic (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyCFunction_Call (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalCodeWithName (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyFunction_FastCallDict (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyObject_FastCallDict (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyObject_CallMethodIdObjArgs (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyImport_ImportModuleLevelObject (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalCodeWithName (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyEval_EvalCode (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] builtin_exec (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyCFunction_Call (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalCodeWithName (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyFunction_FastCallDict (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyObject_FastCallDict (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyObject_CallMethodIdObjArgs (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyImport_ImportModuleLevelObject (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalCodeWithName (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyEval_EvalCode (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] builtin_exec (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyCFunction_Call (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalCodeWithName (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] fast_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] call_function (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyFunction_FastCallDict (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyObject_FastCallDict (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyObject_CallMethodIdObjArgs (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyImport_ImportModuleLevelObject (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalFrameDefault (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] _PyEval_EvalCodeWithName (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyEval_EvalCode (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyRun_InteractiveOneObjectEx (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyRun_InteractiveLoopFlags (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] PyRun_AnyFileExFlags (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] Py_Main (no debug info) [/Users/shu/.pyenv/versions/3.6.5/bin/python] main (no debug info) [/usr/lib/system/libdyld.dylib] start (no debug info) [<unknown binary>] (no debug info)
試したこと
ビルドの際に、オプション付きで
$ cmake PYTHON_CONFIGURE_OPTS=--enable-frameworksudo ../root-6.14.06 $ make -j8
や
$ cmake -DPYTHON_EXECUTABLE=/Users/shu/.pyenv/shims/python ../root-6.14.06 $ make -j8
としてみましたが、相変わらずimport時にセグメンテーション違反を起こして落ちます。
補足情報(FW/ツールのバージョンなど)
MacBook Pro (macOS High Sierra 10.13.6)
root_v6.14.06.source.tar.gz
python3.6.5 (/Users/shu/.pyenv/shims/python)
あなたの回答
tips
プレビュー