New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #23856 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

root@5.26.00 does not include python in build process

Reported by: Deil.Christoph@… Owned by: mattiafrancescomoro@…
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc: macsforever2000@…
Port: root

Description (last modified by macsforever2000@…) (diff)

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

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

Change History

comment:1 Changed 5 years ago by jmr@…

  • Owner changed from macports-tickets@… to mattiafrancescomoro@…
  • Keywords pyroot removed
  • Port set to root
  • Summary changed from root@5.26.00 Include python in build process to root@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 5 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 5 years ago by macsforever2000@…

  • Description modified (diff)

comment:4 Changed 5 years ago by macsforever2000@…

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 follow-up: ↓ 6 Changed 5 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 5 years ago by macsforever2000@…

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 5 years ago by mattiafrancescomoro@…

New portfile for python e pythia

Changed 5 years ago by mattiafrancescomoro@…

New portfile for python e pythia

comment:7 follow-up: ↓ 8 Changed 5 years ago by 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?

comment:8 in reply to: ↑ 7 Changed 5 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 5 years ago by mattiafrancescomoro@…

missprint:

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

comment:10 Changed 4 years ago by macsforever2000@…

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 4 years ago by macsforever2000@…

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 4 years ago by macsforever2000@…

  • Cc macsforever2000@… added

Cc Me!

comment:13 Changed 3 years ago by macsforever2000@…

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 3 years ago by Deil.Christoph@…

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 3 years ago by Deil.Christoph@…

root 5.30.00 +python26 install error log

comment:15 follow-up: ↓ 16 Changed 3 years ago by macsforever2000@…

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 ; follow-up: ↓ 17 Changed 3 years ago by Deil.Christoph@…

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 3 years ago by macsforever2000@…

Replying to Deil.Christoph@…:

So you successfully manage to install with +python26?

Yes.

comment:18 Changed 3 years ago by Deil.Christoph@…

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 3 years ago by ryandesign@…

  • Status changed from new to closed
  • Resolution set to fixed

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.