Hello Atro,

* Atro Tossavainen <atoss...@cc.helsinki.fi> [2006-05-05 11:10] wrote:
> 
> I've built pymol 0.99 manually according to the INSTALLATION VIA COMPILATION
> instructions.  I don't want to have a second copy of all the dependencies
> which I already have anyway, and I want to have pymol for multiple flavours
> of UNIX in the same directory on a shared network file system if possible.
> Now I'm hitting that famous bit:
> 
> $ ./pymol 
> Traceback (most recent call last):
>   File "/{my PYMOL_PATH}/modules/pymol/__init__.py", line 109, in ?
>     import pymol
>   File "/{my PYMOL_PATH}/modules/pymol/__init__.py", line 353, in ?
>     import _cmd
> ImportError: No module named _cmd
> 
> Am I trying something that can't be accomplished?

I have PyMOL installed for IRIX, Linux and Linux_x86_64. They all exist
on one NFS-shared disk, but each is in its own tree. So everything is
duplicated -- C-code and python code alike. I compile each from the SVN
(was CVS) source but use the system's own python and other libaries
where possible (i.e. the png, tcl, tk etc libraries).  So I have

    /software/pymol/Linux/pymol
    /software/pymol/Linux_x86_64/pymol
    /software/pymol/IRIX/pymol

I have a setup script, actually two -- one for bash and its ilk and one
for tcsh, for all the software we have installed here.  Its a big
script, but it has lines in it like (bash/zsh version):

case $program in
  pymol)
    if [[ $OS == "IRIX" || $OS == "IRIX64" || $OS == "Linux" ]]; then
      if [[ $OS == "Linux" ]]; then
        if [[ $OSm == "x86_64" ]]; then
          OS=${OS}_${OSm}
        fi
      fi
      export PATH=`${PROG_SCRIPTS}/remove_path -sh -re ${PROGDIR}/pymol`
      export PYTHONPATH=`${PROG_SCRIPTS}/remove_pythonpath -sh -re 
${PROGDIR}/pymol`
      export PATH=`${PROG_SCRIPTS}/add_path -sh ${PROGDIR}/pymol/${OS}/pymol`
      if [[ $OS == "IRIX" || $OS == "IRIX64" ]]; then
        if [[ -z $PYTHONPATH ]]; then
          export PYTHONPATH=${PROGDIR}/${OS}/lib/python2.3/site-packages
        else
          export 
PYTHONPATH=${PYTHONPATH}:${PROGDIR}/${OS}/lib/python2.3/site-packages
        fi
      elif [[ $OS == "Linux" ]]; then
        if [[ -z $PYTHONPATH ]]; then
          export PYTHONPATH=${PROGDIR}/${OS}/lib/python2.3/site-packages
        else
          export PYTHONPATH=`${PROG_SCRIPTS}/remove_pythonpath -sh 
${PROGDIR}/${OS}/lib/python2.3/site-packages/`
          export 
PYTHONPATH=${PYTHONPATH}:${PROGDIR}/${OS}/lib/python2.3/site-packages
        fi
      fi
      echo "   Type ${BOLD}pymol${NORMAL} to run."
      source ${PROGDIR}/setup cctbx
      source ${PROGDIR}/setup stride
    else
      echo "\nNo version of ${BOLD}${program}${NORMAL} is available for the 
${OS} operating system."
    fi
  ;;

where PROGDIR is the top location for all the software and PROG_SCRIPTS
is a location for some utility scripts. "add_path" is just a script for
adding to the PATH environment variable but only if the desired location
is not already in there. It prevents the problem of the PATH growing
unreasonably large if someone keeps re-sourcing this script.

The complete scripts are available on my web site:
  
  http://adelie.biochem.queensu.ca/~rlc/work/scripts

Given the size of the scripts, I've been thinking of breaking it down
into a much simpler script that calls a specialized script for each
program, but I haven't done it yet.

Cheers,
Rob
-- 
Robert L. Campbell, Ph.D.                         <r...@post.queensu.ca>
Senior Research Associate                            phone: 613-533-6821
Dept. of Biochemistry, Queen's University,             fax: 613-533-2497
Kingston, ON K7L 3N6  Canada       http://adelie.biochem.queensu.ca/~rlc
    PGP Fingerprint: 9B49 3D3F A489 05DC B35C  8E33 F238 A8F5 F635 C0E2

Reply via email to