build scipy-0.6.0 on Solaris with SunStudio 12

I finally got some clues about how to build scipy with SunStudio and Sun Performance library from this discussion thread. And here are the steps I sumerized:

1. Download the source tar file of scipy, SciPy 0.6.0 tarball, and extract it to anywhere. Apply the following changes to /usr/lib/python2.4/vendor-packages/numpy/distutils/fcompiler/sun.py, since f77compat library is not available on x86/x64 platform,

--- sun.py.orig	2008-10-31 18:30:17.519425733 +0800
+++ sun.py	2008-10-31 18:30:23.842495794 +0800
@@ -38,7 +38,7 @@
         return ['-xtarget=generic']
     def get_libraries(self):
         opt = []
-        opt.extend(['fsu','sunmath','mvec','f77compat'])
+        opt.extend(['fsu','sunmath','mvec'])
         return opt

 if __name__ == '__main__':

and apply the following patch,


--- scipy/sparse/sparsetools/sparsetools.h    2007-09-22 15:55:25.000000000 +0800
+++ scipy/sparse/sparsetools/sparsetools.h    2008-10-31 17:54:47.317379521 +0800
@@ -22,6 +22,7 @@

 #include <vector>
 #include <algorithm>
+#include <functional>

 /*

2. Set CBE environment (/opt/jdsbld/bin/env.sh), and the following environment variables,

$ export LDFLAGS="-lCrun -lCstd"
$ export LAPACK=/opt/SUNWspro/lib/libsunmath.so
$ export BLAS=/opt/SUNWspro/lib/libsunperf.so

3. Then build, install, and test

$ python setup.py build
$ pfexec setup.py install
$ cd ~ # don't run the test under the source directory
$ python
>>> import scipy
>>> scipy.test()

Though, you would see several errors, most of the tests passed.

One thought on “build scipy-0.6.0 on Solaris with SunStudio 12

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha