Opened 14 years ago

Closed 13 years ago

#23856 closed defect (fixed)

root@5.26.00 does not include python in build process

Reported by: cdeil (Christoph Deil) Owned by: mattiafrancescomoro@…
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc: mf2k (Frank Schima)
Port: root

Description (last modified by mf2k (Frank Schima))

Hi,

I have installed the following versions of ROOT and python:

root                           @5.26.00
python26                       @2.6.4

When macport builds ROOT it doesn't include python in the build process, so the ROOT--python interface doesn't work.

This problem has been discussed and solved in a ROOT forum at http://root.cern.ch/phpBB2/viewtopic.php?p=42528&sid=fbcc66d406ab75c34f708229d42a6a04

The solution is to configure ROOT to include python before building:

./configure --prefix=/opt/local --with-python-incdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 --with-python-libdir=/opt/local/lib

How can I tell macport to do this? If possible it would be nice if someone could make this the default behaviour when installing ROOT with macports and python is already installed.

Thanks! --Christoph

python26 @2.6.4

Attachments (3)

Portfile.2 (7.0 KB) - added by mattiafrancescomoro@… 14 years ago.
New portfile for python e pythia
Portfile (7.0 KB) - added by mattiafrancescomoro@… 14 years ago.
New portfile for python e pythia
log (1.8 MB) - added by cdeil (Christoph Deil) 13 years ago.
root 5.30.00 +python26 install error log

Download all attachments as: .zip

Change History (22)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Keywords: pyroot removed
Owner: changed from macports-tickets@… to mattiafrancescomoro@…
Port: root added
Summary: root@5.26.00 Include python in build processroot@5.26.00 does not include python in build process

Please remember to fill in the Port field and cc the maintainer.

comment:2 Changed 14 years ago by andre.david@…

One way you have is to edit the Portfile:

sudo emacs -nw `port file root`

and add the incdir and libdir yourself. You can figure out how to do it from all other lines.

comment:3 Changed 14 years ago by mf2k (Frank Schima)

Description: modified (diff)

comment:4 Changed 14 years ago by mf2k (Frank Schima)

I tried your version with python26 and it does not appear to work for me.

In [1]: import ROOT
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

/Users/frank/<ipython console> in <module>()

ImportError: No module named ROOT

comment:5 Changed 14 years ago by mattiafrancescomoro@…

I have a problem to pass root the correct location of python (line 124) i made a new trac request but none replay me... #24318

comment:6 in reply to:  5 Changed 14 years ago by mf2k (Frank Schima)

Replying to mattiafrancescomoro@…:

I have a problem to pass root the correct location of python (line 124) i made a new trac request but none replay me... #24318

You should probably just ask such a question on the macports-developers list.

I'm not sure what you're trying to do exactly there, but my suggestion is not to try so hard to generalize a solution. Can you just make it work for only python 2.6 more simply? Then we can just call the variant "python26".

Changed 14 years ago by mattiafrancescomoro@…

Attachment: Portfile.2 added

New portfile for python e pythia

Changed 14 years ago by mattiafrancescomoro@…

Attachment: Portfile added

New portfile for python e pythia

comment:7 Changed 14 years ago by mf2k (Frank Schima)

In the future, please use a unified diff. This patch still does not work for me, I see the same error as above. Does it work for you?

comment:8 in reply to:  7 Changed 14 years ago by mattiafrancescomoro@…

Replying to macsforever2000@…:

In the future, please use a unified diff. This patch still does not work for me, I see the same error as above. Does it work for you?

you need to change the pythonpath to ${prefix}/lib/root:

export PYTHONPATH = $PYTHONPATH/${prefix}/lib/root

but it's a user preference, i can't apply it to portfile.

I'm thinking a modification for copying the python-root files to the correct path in python distrofile but i think it's not so simple.

comment:9 Changed 14 years ago by mattiafrancescomoro@…

missprint:

export PYTHONPATH = $PYTHONPATH:${prefix}/lib/root

comment:10 Changed 14 years ago by mf2k (Frank Schima)

Sorry for the delay. I did this and now i see the following error in ipython:

In [1]: import ROOT
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

/Users/frank/<ipython console> in <module>()

/opt/local/lib/root/ROOT.py in <module>()
     84    sys.setdlopenflags( 0x100 | 0x2 )    # RTLD_GLOBAL | RTLD_NOW
     85 
---> 86 import libPyROOT as _root
     87 
     88 # reset dl flags if needed


ImportError: dlopen(/opt/local/lib/root/libPyROOT.so, 2): Symbol not found: __ZTI10TSQLResult
  Referenced from: /opt/local/lib/root/libTree.so
  Expected in: flat namespace
 in /opt/local/lib/root/libTree.so

comment:11 Changed 13 years ago by mf2k (Frank Schima)

Partially fixed in r78935. Currently this only works by manually setting the following in your .bash_profile:

export LD_LIBRARY_PATH=/opt/local/lib:/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib:$LD_LIBRARY_PATH

I'm looking into a better solution.

comment:12 Changed 13 years ago by mf2k (Frank Schima)

Cc: macsforever2000@… added

Cc Me!

comment:13 Changed 13 years ago by mf2k (Frank Schima)

My current workaround is to add the following to each script. This assumes the python26 variant is used.

import sys
sys.path.append('/opt/local/lib/root')
import ROOT

comment:14 Changed 13 years ago by cdeil (Christoph Deil)

Now that the new root 5.30.00 port is out, I took another shot at building the +python26 variant, which fails as shown in the attached build log.

Note that I have two previous root installs with macports, I don't know if that affects the +python26 variant build in any way:

$ port installed root
The following ports are currently installed:
  root @5.28.00d_0+builtin_ftgl+opengl+roofit+ssl+xml
  root @5.30.00_0+builtin_ftgl+opengl+roofit+ssl+xml (active)

Also I would like to add a feature request: +python27 variant

Changed 13 years ago by cdeil (Christoph Deil)

Attachment: log added

root 5.30.00 +python26 install error log

comment:15 Changed 13 years ago by mf2k (Frank Schima)

Weird. It cannot find ROOT.py in staging.

  • What version of Mac OS X are you running?
  • What version of Xcode?
  • Do you have any special circumstances like case sensitive file system or non-standard macports install location?

comment:16 in reply to:  15 ; Changed 13 years ago by cdeil (Christoph Deil)

Replying to macsforever2000@…:

What version of Mac OS X are you running?

10.6.8

What version of Xcode?

3.2.6 (64 bit)

Do you have any special circumstances like case sensitive file system

or non-standard macports install location?

No.

Here is the location it was expecting to find ROOT.py:

$ cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_root/work/destroot/opt/local/lib/root
$ ls -lh *.py
-rw-r--r--  1 root  admin   4.2K Jul  8 14:24 PyCintex.py
-rw-r--r--  1 root  admin    21K Jun 28 11:49 ROOTwriter.py
-rw-r--r--  1 root  admin    11K Jun 28 11:49 writer.py

One non-standard thing I think I did myself was adding the following symlink:

$ ls -l `which python`
lrwxr-xr-x  1 root  admin  24 Jan 22 09:43 /opt/local/bin/python -> /opt/local/bin/python2.7

Other than that I think my installation should be standard. So you successfully manage to install with +python26?

comment:17 in reply to:  16 Changed 13 years ago by mf2k (Frank Schima)

Replying to Deil.Christoph@…:

So you successfully manage to install with +python26?

Yes.

comment:18 Changed 13 years ago by cdeil (Christoph Deil)

In the meantime I have updated to Lion and use SVN instead of rsync to get my Portfiles. The problem that ROOT.py is not found in the destroot stage is still the same.

The command

sudo port install root +gcc44 +python26

fails like this

:notice:destroot --->  Staging root into destroot
:debug:destroot Can't run destroot under sudo without elevated privileges (due to mtree).
:debug:destroot Run destroot without sudo to avoid root privileges.
:debug:destroot Going to escalate privileges back to root.
:debug:destroot euid changed to: 0. egid changed to: 0.
:info:destroot . changed
:info:destroot 	gid expected 0 found 80 modified
:info:destroot ./usr missing (created)
:info:destroot . missing (directory not created: File exists)
:info:destroot ./Applications missing (created)
:info:destroot ./Developer missing (created)
:info:destroot ./Library missing (created)
:info:destroot . changed
:info:destroot 	gid expected 80 found 0 modified
:info:destroot ./bin missing (created)
:info:destroot ./etc missing (created)
:info:destroot ./include missing (created)
:info:destroot ./lib missing (created)
:info:destroot ./lib/pkgconfig missing (created)
:info:destroot ./libexec missing (created)
:info:destroot ./sbin missing (created)
:info:destroot ./share missing (created)
:info:destroot ./share/info missing (created)
:info:destroot ./share/man missing (created)
:info:destroot ./share/man/cat1 missing (created)
:info:destroot ./share/man/cat2 missing (created)
:info:destroot ./share/man/cat3 missing (created)
:info:destroot ./share/man/cat4 missing (created)
:info:destroot ./share/man/cat5 missing (created)
:info:destroot ./share/man/cat6 missing (created)
:info:destroot ./share/man/cat7 missing (created)
:info:destroot ./share/man/cat8 missing (created)
:info:destroot ./share/man/cat9 missing (created)
:info:destroot ./share/man/catl missing (created)
:info:destroot ./share/man/catn missing (created)
:info:destroot ./share/man/man1 missing (created)
:info:destroot ./share/man/man2 missing (created)
:info:destroot ./share/man/man3 missing (created)
:info:destroot ./share/man/man4 missing (created)
:info:destroot ./share/man/man5 missing (created)
:info:destroot ./share/man/man6 missing (created)
:info:destroot ./share/man/man7 missing (created)
:info:destroot ./share/man/man8 missing (created)
:info:destroot ./share/man/man9 missing (created)
:info:destroot ./share/man/manl missing (created)
:info:destroot ./share/man/mann missing (created)
:info:destroot ./share/nls missing (created)
:info:destroot ./share/nls/C missing (created)
:info:destroot ./share/nls/af_ZA.ISO8859-1 missing (created)
:info:destroot ./share/nls/af_ZA.ISO8859-15 missing (created)
:info:destroot ./share/nls/bg_BG.CP1251 missing (created)
:info:destroot ./share/nls/cs_CZ.ISO8859-2 missing (created)
:info:destroot ./share/nls/da_DK.ISO8859-1 missing (created)
:info:destroot ./share/nls/da_DK.ISO8859-15 missing (created)
:info:destroot ./share/nls/de_AT.ISO8859-1 missing (created)
:info:destroot ./share/nls/de_AT.ISO8859-15 missing (created)
:info:destroot ./share/nls/de_CH.ISO8859-1 missing (created)
:info:destroot ./share/nls/de_CH.ISO8859-15 missing (created)
:info:destroot ./share/nls/de_DE.ISO8859-1 missing (created)
:info:destroot ./share/nls/de_DE.ISO8859-15 missing (created)
:info:destroot ./share/nls/el_GR.ISO8859-7 missing (created)
:info:destroot ./share/nls/en_AU.ISO8859-1 missing (created)
:info:destroot ./share/nls/en_AU.ISO8859-15 missing (created)
:info:destroot ./share/nls/en_AU.US-ASCII missing (created)
:info:destroot ./share/nls/en_CA.ISO8859-1 missing (created)
:info:destroot ./share/nls/en_CA.ISO8859-15 missing (created)
:info:destroot ./share/nls/en_CA.US-ASCII missing (created)
:info:destroot ./share/nls/en_GB.ISO8859-1 missing (created)
:info:destroot ./share/nls/en_GB.ISO8859-15 missing (created)
:info:destroot ./share/nls/en_GB.US-ASCII missing (created)
:info:destroot ./share/nls/en_NZ.ISO8859-1 missing (created)
:info:destroot ./share/nls/en_NZ.ISO8859-15 missing (created)
:info:destroot ./share/nls/en_NZ.US-ASCII missing (created)
:info:destroot ./share/nls/en_US.ISO8859-1 missing (created)
:info:destroot ./share/nls/en_US.ISO8859-15 missing (created)
:info:destroot ./share/nls/es_ES.ISO8859-1 missing (created)
:info:destroot ./share/nls/es_ES.ISO8859-15 missing (created)
:info:destroot ./share/nls/et_EE.ISO8859-15 missing (created)
:info:destroot ./share/nls/fi_FI.ISO8859-1 missing (created)
:info:destroot ./share/nls/fi_FI.ISO8859-15 missing (created)
:info:destroot ./share/nls/fr_BE.ISO8859-1 missing (created)
:info:destroot ./share/nls/fr_BE.ISO8859-15 missing (created)
:info:destroot ./share/nls/fr_CA.ISO8859-1 missing (created)
:info:destroot ./share/nls/fr_CA.ISO8859-15 missing (created)
:info:destroot ./share/nls/fr_CH.ISO8859-1 missing (created)
:info:destroot ./share/nls/fr_CH.ISO8859-15 missing (created)
:info:destroot ./share/nls/fr_FR.ISO8859-1 missing (created)
:info:destroot ./share/nls/fr_FR.ISO8859-15 missing (created)
:info:destroot ./share/nls/hi_IN.ISCII-DEV missing (created)
:info:destroot ./share/nls/hr_HR.ISO8859-2 missing (created)
:info:destroot ./share/nls/hu_HU.ISO8859-2 missing (created)
:info:destroot ./share/nls/is_IS.ISO8859-1 missing (created)
:info:destroot ./share/nls/is_IS.ISO8859-15 missing (created)
:info:destroot ./share/nls/it_CH.ISO8859-1 missing (created)
:info:destroot ./share/nls/it_CH.ISO8859-15 missing (created)
:info:destroot ./share/nls/it_IT.ISO8859-1 missing (created)
:info:destroot ./share/nls/it_IT.ISO8859-15 missing (created)
:info:destroot ./share/nls/ja_JP.SJIS missing (created)
:info:destroot ./share/nls/ja_JP.eucJP missing (created)
:info:destroot ./share/nls/ko_KR.eucKR missing (created)
:info:destroot ./share/nls/la_LN.ISO8859-1 missing (created)
:info:destroot ./share/nls/la_LN.ISO8859-15 missing (created)
:info:destroot ./share/nls/la_LN.ISO8859-2 missing (created)
:info:destroot ./share/nls/la_LN.ISO8859-4 missing (created)
:info:destroot ./share/nls/la_LN.US-ASCII missing (created)
:info:destroot ./share/nls/lt_LT.ISO8859-4 missing (created)
:info:destroot ./share/nls/nl_BE.ISO8859-1 missing (created)
:info:destroot ./share/nls/nl_BE.ISO8859-15 missing (created)
:info:destroot ./share/nls/nl_NL.ISO8859-1 missing (created)
:info:destroot ./share/nls/nl_NL.ISO8859-15 missing (created)
:info:destroot ./share/nls/no_NO.ISO8859-1 missing (created)
:info:destroot ./share/nls/no_NO.ISO8859-15 missing (created)
:info:destroot ./share/nls/pl_PL.ISO8859-2 missing (created)
:info:destroot ./share/nls/pt_BR.ISO8859-1 missing (created)
:info:destroot ./share/nls/pt_PT.ISO8859-1 missing (created)
:info:destroot ./share/nls/pt_PT.ISO8859-15 missing (created)
:info:destroot ./share/nls/ro_RO.ISO8859-2 missing (created)
:info:destroot ./share/nls/ru_RU.CP866 missing (created)
:info:destroot ./share/nls/ru_RU.ISO8859-5 missing (created)
:info:destroot ./share/nls/ru_RU.KOI8-R missing (created)
:info:destroot ./share/nls/sk_SK.ISO8859-2 missing (created)
:info:destroot ./share/nls/sl_SI.ISO8859-2 missing (created)
:info:destroot ./share/nls/sv_SE.ISO8859-1 missing (created)
:info:destroot ./share/nls/sv_SE.ISO8859-15 missing (created)
:info:destroot ./share/nls/tr_TR.ISO8859-9 missing (created)
:info:destroot ./share/nls/uk_UA.ISO8859-5 missing (created)
:info:destroot ./share/nls/uk_UA.KOI8-U missing (created)
:info:destroot ./share/nls/zh_CN.eucCN missing (created)
:info:destroot ./share/nls/zh_TW.Big5 missing (created)
:info:destroot ./share/skel missing (created)
:info:destroot ./src missing (created)
:info:destroot ./var missing (created)
:info:destroot ./www missing (created)
:debug:destroot Executing org.macports.destroot (root)
:debug:destroot Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.7'
:debug:destroot Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/root" && /usr/bin/make -w install DESTDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot'
:debug:destroot Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/root" && /usr/bin/make -w install DESTDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot 
:info:destroot make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/root'
:info:destroot Installing binaries in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/bin
:info:destroot Installing libraries in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/lib/root
:info:destroot Installing headers in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/include/root
:info:destroot Installing /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/root/main/src/rmain.cxx in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/include/root
:info:destroot Installing cint/cint/include cint/cint/lib and cint/cint/stl in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/lib/root/cint
:info:destroot Installing icons in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/share/root/icons
:info:destroot Installing fonts in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/share/root/fonts
:info:destroot Installing misc docs in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/share/doc/root
:info:destroot Installing tutorials in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/share/root/tutorials
:info:destroot Installing tests in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/share/root/test
:info:destroot Installing macros in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/share/root/macros
:info:destroot Installing man(1) pages in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/share/man/man1
:info:destroot Installing config files in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/etc/root
:info:destroot Installing Autoconf macro in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/share/aclocal
:info:destroot Installing Emacs Lisp library in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/share/emacs/site-lisp
:info:destroot Installing GDML conversion scripts in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/lib/root
:info:destroot make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/root'
:debug:destroot Executing proc-post-org.macports.destroot-destroot-0
:error:destroot Target org.macports.destroot returned: error renaming "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/lib/root/ROOT.py": no such file or directory
:debug:destroot Backtrace: error renaming "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/destroot/opt/local/lib/root/ROOT.py": no such file or directory
    while executing
"$post $targetname"
:info:destroot Warning: the following items did not execute (for root): org.macports.activate org.macports.destroot org.macports.install
:notice:destroot Log for root is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/main.log

This is the correct location of ROOT.py:

$ find /opt/local -name ROOT.py
         /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_root/root/work/root/bindings/pyroot/ROOT.py

comment:19 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

root does have python variants now so I'm closing this ticket.

The missing ROOT.py issue is being tracked in #31119.

Note: See TracTickets for help on using tickets.