where does macports installs programs?

Mojca Miklavec mojca.miklavec.lists at gmail.com
Wed Jul 9 23:01:33 PDT 2014


On Thu, Jul 10, 2014 at 2:48 AM, Fabrizio Salvatore wrote:
> thanks!
>
> I am having a bit of trouble now... I have two macs on which I think I have installed everything in the same way (python27, root5, root5 +python27); on one mac I can use pyROOT with no problem:
>
> python
> Python 2.7.8 (default, Jul  3 2014, 06:00:18)
> [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>>
>
> it works perfectly.
>
> On the second laptop I have the following:
>
> python
> Python 2.7.8 (default, Jul 2 2014, 10:14:58)
> [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import ROOT
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module> ImportError:
> No module named ROOT >>>
>
> Despite I have used exactly the same commands to install python
> (sudo port install python27)
>
> I see that there are some subtle differences in the output of the 'python' command, but I don't know if they matter....
>
> In any case, I have done (as suggested in this thread)
> sudo port select python python27
> sudo port select root root5
>
> on both macs and I have checked that I have
>
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/libPyROOT.so -> /opt/local/libexec/root5/lib/root/libPyROOT.so
> /opt/local/libexec/root5/lib/root/libPyROOT.so -> libPyROOT.5.34.so
>
> so I really don't understand why pyROOT works on one and not on the other....

Please run "which python", "ls -l /opt/local/bin/python" and "port
select --show python" to verify that you have properly enabled the
default python.

Then also check "port installed root5" to verify that the active
variant of root has python support enabled.

> I have tried to uninstall root5 on the second mac, to see if by re-installing from scratch solves the problem, but I have the following error:
>
> sudo port uninstall root5
> ---> The following versions of root5 are currently installed:
> ---> root5 @5.34.18_0+cocoa+gcc48+graphviz+gsl+minuit2+opengl+python27+roofit+soversion+ssl+tmva+xml (active)
> ---> root5 @5.34.18_0+cocoa+gcc48+graphviz+gsl+minuit2+opengl+roofit+soversion+ssl+tmva+xml
> Error: port uninstall failed: Registry error: Please specify the full version as recorded in the port registry.
>
> If anyone has any idea of what I'm doing wrong (or what could be wrong), I would be really grateful!

When you have multiple variants or versions installed, you need to use
    sudo port uninstall
root5 at 5.34.18_0+cocoa+gcc48+graphviz+gsl+minuit2+opengl+roofit+soversion+ssl+tmva+xml
to specify which version you want to uninstall. But you can just as well use
    sudo port deactivate root5
to just remove all files from path etc. Then you can activate the same
version/variants later.

Mojca

PS: It is or at least was true that ROOT installation notes instructed
users to set LD_LIBRARY_PATH. Or to source a file that would set it
for you. I remember seeing binaries or libraries that pointed to
libraries without full path as is usual on Mac. I think that the
issues improved considerably with time (but I didn't check
documentation) and MacPorts certainly doesn't (or at least shouldn't)
need any of that.

(Sadly Geant4 still needs a bunch of environmental variables for
example, else it crashes.)

PPS: You can also use "sudo port select --set root root5". (I also
find it weird that root-config5 has that name; root5-config would be
"more natural".)


More information about the macports-users mailing list