1. Set the CBE environment (/opt/jdsbld/bin/env.sh), and export CC=$CXX, so that /usr/lib/python2.4/pycc would eventually use the C++ compiler in SunStudio.
2. Download the source code from http://matplotlib.sourceforge.net, then apply the following patch,
--- setupext.py 2008-08-04 02:15:22.000000000 +0800 +++ setupext.py 2008-11-03 17:08:41.387138200 +0800 @@ -218,6 +218,8 @@ def get_win32_compiler(): win32_compiler = get_win32_compiler() if sys.platform == 'win32' and win32_compiler == 'msvc': std_libs = [] +elif sys.platform == 'sunos5': + std_libs = ['Crun', 'Cstd'] else: std_libs = ['stdc++', 'm'] @@ -298,6 +300,7 @@ def check_for_freetype(): for d in basedirs: module.include_dirs.append(os.path.join(d, 'freetype2')) + module.include_dirs.append('/usr/include') print_status("freetype2", get_pkgconfig_version('freetype2')) if not find_include_file(module.include_dirs, 'ft2build.h'): print_message( --- src/_backend_gdk.c 2008-08-04 02:14:18.000000000 +0800 +++ src/_backend_gdk.c 2008-11-03 17:31:32.896210699 +0800 @@ -62,6 +62,7 @@ static PyMethodDef _backend_gdk_function { NULL, NULL, 0 } }; +extern "C" DL_EXPORT(void) init_backend_gdk(void) {
3. Then build and install,
$ python setup.py build $ pfexec python setup.py install
Note: this version of matplotlib requires numpy-1.1 or higher version, you need build and install a newer one since solaris only has 1.0.4.