Re: Python on Mac OSX

From: Nathaniel Tagg <tagg_at_minos.phy.tufts.edu>
Date: Mon, 16 Jul 2007 11:07:13 -0400


Hi,

Sorry, a typo.

        import ROOT
works but

        import PyCintex
does not.

No; there should be no Cint mismatch - everything was built consistently, from source.

I also have problems building the python libraries in the first place. If I build ROOT 5.16 from source on a standard OS install of Python 2.3.5, this works out of the box.

If, however, I use a more modern version of MacPython (2.4.4), then the ROOT build doesn't work. However, I can get a working PyROOT library by following the instructions in https://savannah.cern.ch/bugs/?22003, namely building a custom library with:

cd pyroot/src
g++ -flat_namespace -bundle *.o -bundle_loader /Library/Frameworks/ Python.framework/Versions/Current/bin/python2.4 -L$ROOTSYS/lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lMatrix -lReflex - framework Python -o $ROOTSYS/lib/libPyROOT.so

Here's the (slightly more detailed) dump when I do the latter: (ROOT 5.14.00f with PYTHON 2.4.4, which I'm doing in a vain attempt to compile GAUDI).

The line that is failing is:
Cintex = libPyROOT.MakeRootClass( 'Cintex' )

I have no idea what this does; I'm new to the whole Python interface thing.

---Nathaniel

#9 0x057f5a24 in G__incsetup_memfunc (tagnum=1713) at cint/src/
v6_newlink.cxx:8373
#10 0x0570ab2c in Cint::G__MethodInfo::Init (this=0xbfffb414,
a=@0xb1628e0) at cint/src/Method.cxx:47
#11 0x03014c00 in Cint::G__MethodInfo::G__MethodInfo
(this=0xbfffb414, a=@0xb1628e0) at include/BaseCls.h:42
#12 0x02a632d0 in TCint::CreateListOfMethods (this=0x61dc70,
cl=0xb162a10) at meta/src/TCint.cxx:713
#13 0x02a6b108 in TClass::GetListOfMethods (this=0xb162a10) at meta/
src/TClass.cxx:1921
#14 0x0200b9bc in PyROOT::TScopeAdapter::FunctionMemberSize
(this=0xbfffb5e0) at pyroot/src/Adapters.cxx:288
#15 0x02072cc4 in

PyROOT::MakeRootClassFromString<PyROOT::TScopeAdapter, PyROOT::TBaseAdapter, PyROOT::TMemberAdapter> (fullname=@0xbfffb6ac, scope=0x0) at pyroot/src/RootWrapper.cxx:460
#16 0x02038050 in PyROOT::MakeRootClass (args=0x718fb0) at pyroot/src/
RootWrapper.cxx:408
#17 0x00297e8c in PyEval_EvalFrame (f=0x6084d0) at /Users/ronald/
Python/r244/Python/ceval.c:3568
#18 0x0029a204 in PyEval_EvalCodeEx (co=0x71a120, globals=0xb1628e0,
locals=0xb162720, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at /Users/ronald/Python/r244/Python/ceval.c: 2741
#19 0x0029a3b0 in PyEval_EvalCode (co=0x6b1, globals=0xb1628e0,
locals=0x30) at /Users/ronald/Python/r244/Python/ceval.c:484
#20 0x002b9030 in PyImport_ExecCodeModuleEx (name=0xbfffc2a0
"PyCintex", co=0x71a120, pathname=0xbfffb938 "/Users/tagg/dayabay/ external/root/5.14.00f/osx104_ppc_gcc401/root/lib/PyCintex.pyc") at / Users/ronald/Python/r244/Python/import.c:636
#21 0x002b9530 in load_source_module (name=0xbfffc2a0 "PyCintex",
pathname=0xbfffb938 "/Users/tagg/dayabay/external/root/5.14.00f/ osx104_ppc_gcc401/root/lib/PyCintex.pyc", fp=0x71a120) at /Users/ ronald/Python/r244/Python/import.c:915
#22 0x002ba608 in import_submodule (mod=0x30bd48, subname=0xbfffc2a0
"PyCintex", fullname=0xbfffc2a0 "PyCintex") at /Users/ronald/Python/ r244/Python/import.c:2276
#23 0x002ba880 in load_next (mod=0x30bd48, altmod=0x30bd48,
p_name=0xbfffc2a0, buf=0xbfffc2a0 "PyCintex", p_buflen=0xbfffc29c) at /Users/ronald/Python/r244/Python/import.c:2096
#24 0x002baf24 in PyImport_ImportModuleEx (name=0x1d8d4 "__main__",
globals=0xbfffc29c, locals=0x30, fromlist=0x30bd48) at /Users/ronald/ Python/r244/Python/import.c:1931
#25 0x00288df8 in builtin___import__ (self=0x6b1, args=0xb1628e0) at /
Users/ronald/Python/r244/Python/bltinmodule.c:45
#26 0x0020ea14 in PyObject_Call (func=0x6b1, arg=0xb1628e0, kw=0x30)
at /Users/ronald/Python/r244/Objects/abstract.c:1795
#27 0x002928a0 in PyEval_CallObjectWithKeywords (func=0x10260,
arg=0x1fae0, kw=0x0) at /Users/ronald/Python/r244/Python/ceval.c:3435
#28 0x002972cc in PyEval_EvalFrame (f=0x608c90) at /Users/ronald/
Python/r244/Python/ceval.c:2020
#29 0x0029a204 in PyEval_EvalCodeEx (co=0x4f920, globals=0xb1628e0,
locals=0xb162720, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at /Users/ronald/Python/r244/Python/ceval.c: 2741
#30 0x0029a3b0 in PyEval_EvalCode (co=0x6b1, globals=0xb1628e0,
locals=0x30) at /Users/ronald/Python/r244/Python/ceval.c:484
#31 0x002c49c8 in PyRun_InteractiveOneFlags (fp=0xf428,
filename=0x2fd138 "<stdin>", flags=0xbfffcb2c) at /Users/ronald/ Python/r244/Python/pythonrun.c:1285
#32 0x002c4bc0 in PyRun_InteractiveLoopFlags (fp=0xa0001b9c,
filename=0x2fd138 "<stdin>", flags=0xbfffcb2c) at /Users/ronald/ Python/r244/Python/pythonrun.c:704
#33 0x002c59b0 in PyRun_AnyFileExFlags (fp=0xa0001b9c,
filename=0x2fd138 "<stdin>", closeit=0, flags=0xbfffcb2c) at /Users/ ronald/Python/r244/Python/pythonrun.c:667
#34 0x002d0b88 in Py_Main (argc=-1073755348, argv=0x20000000) at /
Users/ronald/Python/r244/Modules/main.c:493
#35 0x000024a4 in ?? ()
#36 0x0000234c in ?? ()

On Jul 14, 2007, at 2:03 PM, WLavrijsen_at_lbl.gov wrote:

> Nathaniel,
>
>> $ python
>>>>> import ROOT
>>
>> succeeds, but if I do:
>>
>> $ python
>>>>> import PyCint
>
> what is PyCint? Further, this:
>
>> # 9  0x0454d4dc in G__incsetup_memfunc (tagnum=815) at cint/src/ 
>> v6_newlink.cxx:8472
>> #10 0x04461618 in Cint::G__MethodInfo::Init (this=0xbfffc1d4,  
>> a=@0x9fe2c20) at cint/src/Method.cxx:47
>
> suggests that you're trying to load a dictionary that is produced  
> with a
> different version of CINT. Can you verify?
>
> Best regards,
>            Wim
> --
> Wim.Lavrijsen_at_cern.ch   --   WLavrijsen_at_lbl.gov   --    
> www.lavrijsen.net
>
> "Stop making excuses for your software."    --first step towards  
> quality
>    "GIGO is not a valid design pattern."         --corollary
Received on Mon Jul 16 2007 - 17:09:49 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 16 2007 - 23:50:02 CEST