On Solaris (any architecture) or FreeBSD, when installing STAF via the tar.gz install file and STAFInst, -option USE_PYTHON_SYSTEM_PATH=1 does not work correctly.
For example, on staf3b (Solaris-x86):
bash-3.2# pwd /tmp bash-3.2# gunzip STAF3420-solaris-x86.tar.gz bash-3.2# tar xf STAF3420-solaris-x86.tar bash-3.2# cd staf bash-3.2# PATH=/opt/Python-3.1/bin:$PATH bash-3.2# export PATH bash-3.2# python -V Python 3.1.2 bash-3.2# ./STAFInst -acceptlicense -target /tmp/staf3420 -option USE_PYTHON_SYSTEM_PATH=1 Installation successful bash-3.2# cd ../staf34 bash-3.2# cd /tmp/staf3420/lib bash-3.2# ls -l PYSTAF.so lrwxrwxrwx 1 root root 36 Mar 24 15:53 PYSTAF.so -> /tmp/staf3420/lib/python22/PYSTAF.so bash-3.2#
The above shows that the system path contains the python command for Python 3.1 when STAFInst was run on this Solaris x86 system specifying option USE_PYTHON_SYSTEM_PATH=1. However, note that PYSTAF.so is incorrectly linked to STAF's Python 2.2 PYSTAF.so (Python 2.2 is the default Python version for Solaris x86) when it should have been linked to STAF's Python 3.1 PYSTAF.so (in /tmp/staf3420/lib/python31).
Similarly, on staf1c (FreeBSD):
# pwd /tmp # tar xfz STAF3420-freebsd.tar.gz # cd staf # pwd /tmp/staf # echo $PATH # export PATH=/opt/Python-3.1/bin:$PATH # python -V Python 3.1.2 # ./STAFInst -acceptlicense -target /tmp/staf3420 -option USE_PYTHON_SYSTEM_PATH=1 Installation successful # cd ../staf3420/lib # ls -l PYSTAF.so lrwxr-xr-x 1 root wheel 36 Mar 24 16:45 PYSTAF.so -> /tmp/staf3420/lib/python24/PYSTAF.so #
The above shows that the system path contains the python command for Python 3.1 when STAFInst was run on the FreeBSD system specifying option USE_PYTHON_SYSTEM_PATH=1. However, note that PYSTAF.so is incorrectly linked to STAF's Python 2.4 PYSTAF.so (Python 2.4 is the default Python version for FreeBSD) when it shoudl have been linked to STAF's Python 3.1 PYSTAF.so (in /tmp/staf3420/lib/python31).
Also, note that option USE_PYTHON_SYSTEM_PATH=1 is working correctly on Linux and Linux-amd64.
Diff:
The problem was caused by how STAFInst was using sed on the output from a "python -V" (or "python3 -V" command) to remove the leading "Python " and the trailing end of the version (e.g. "Python 3.1.2" --> "3.1"). This worked fine on Linux versions but not on Solaris or FreeBSD.
This fix will be in STAF V3.4.21 which is planned to be released at the end of March 2015.
Here's a cvs diff of the changes: