I have tried finding a recipe that works for using my anaconda python installation with ROOT 6.12/06 but without luck. Has anyone succeeded in doing so? My OS is OSX 10.13.3. The ROOT compiles and works without a problem, but when I start python and type:
import ROOT
it crashes with a nasty message:
*** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[] (no debug info)
[/Users/hits/anaconda3/lib/libpython3.6m.dylib] PyUnicode_InternFromString (no debug info)
[/Users/hits/Applications/root/build_dir2/lib/libPyROOT.so] PyROOT::CreatePyStrings() /Users/hits/Applications/root/bindings/pyroot/src/PyStrings.cxx:64
[/Users/hits/Applications/root/build_dir2/lib/libPyROOT.so] PyInit_libPyROOT /Users/hits/Applications/root/bindings/pyroot/src/RootModule.cxx:848
[/Users/hits/anaconda3/bin/python] _PyImport_LoadDynamicModuleWithSpec (no debug info)
[/Users/hits/anaconda3/bin/python] _imp_create_dynamic (no debug info)
[/Users/hits/anaconda3/bin/python] PyCFunction_Call (no debug info)
I only pasted part of it here, because I do not see anything I can use there to figure out the problem. If someone else thinks that it may help to figure out the problem I will gladly paste the rest.
is that you need to compile ROOT with the same compiler that anaconda provides, if that is an option for you (that is, if the compiler is not too old).
Thank you! I will see if it works for me. Do you know by chance how to force cmake to choose the anaconda compiler? I have tried:
$source activate root
but cmake still picked the Xcode compiler.
After a week of trying different installation methods, I now think that it is impossible to install pyROOT with ROOT6 and with python3 on Mac OSX. And that it does not matter if it is the anaconda python or the python you get directly from python.org. I would be very interested if anyone can claim otherwise?
I also don’t think that the theory of the different compilers is correct:
My default compiler is 4.2.1
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
which is exactly the same as the compiler for anaconda python:
$python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
What is exactly the issue you have with Python3 (non-anaconda) on MacOSX? That combination is certainly possible. Could it be that there is some interference with the anaconda Python?
The crash was exactly the same as for the anaconda python (as you see in my first post). For that experiment, I removed the anaconda python completely. I can try it again and report here all the steps. Maybe you’ll see something wrong with them.
By the way, my crash is somewhat different from what you had. I get failure similar to yours when I also put python libs in DYLD_LIBRARY_PATH.
Yes please post your steps and the final stack trace. Also please attach the CMakeCache.txt file that is created in your build directory so that we can check the Python-related variables.