Install python-sao

Python-sao is an interface for communicating with DS9 via Python.

Installing with STSCI_PYTHON is done as follows:

csh
cd /tmp/
svn checkout http://python-sao.googlecode.com/svn/trunk/ python-sao
cd python-sao-read-only/
## Need gcc-4.0 with STSCI_PYTHON Python2.5.4
## Otherwise dies with the error below
setenv CC gcc-4.0

## XPA
python xpa_download.py
tar xf xpa-2.1.12.tar.gz
ln -s xpa-2.1.12 xpalib
cd xpalib
./configure CFLAGS="-arch ppc -arch i386 -arch x86_64"
make
cd ..

python setup.py build
## if build dies, do this last one by hand
gcc-4.0 -I/usr/stsci/pyssg/Python-2.5.4/include -L/usr/stsci/pyssg/Python-2.5.4/lib -O -fPIC -bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.5/xpa.o -L./xpalib -lxpa -o build/lib.macosx-10.3-i386-2.5/pysao/xpa.so

sudo python setup.py install

This is the error you get if you don’t set CC=gcc-4.0:

building 'pysao.xpa' extension
creating build/temp.macosx-10.3-i386-2.5
cc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -I/usr/stsci/pyssg/Python-2.5.4/include -O -fPIC -I./xpalib -I/usr/stsci/pyssg/Python-2.5.4/include/python2.5 -c xpa.c -o build/temp.macosx-10.3-i386-2.5/xpa.o
cc1: error: unrecognized command line option "-Wno-long-double"
error: command 'cc' failed with exit status 1
Advertisements
This entry was posted in install and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s