Ask Your Question

Revision history [back]

From what I understand, the question is "how do I completely replace BLAS with GOTOBLAS"? The first place to start would be to take a look at $SAGE_ROOT/devel/sage/module_list.py. This is sort of a master file describing how Sage's various Cython code links with the various libraries included with Sage. For example, dense general matrices use BLAS to handle multiplication whereas integer matrices uses Flint. (Or something like that.)

Near the top of the file module_list.py is a section called "BLAS setup". You can add a line like

...
elif os.path.exists('%s/lib/libgotoblas.so'%os.environ['SAGE_LOCAL']):
    BLAS='gotoblas'
    BLAS2='atlas'
elif ...

replacing "gotoblas" with whatever the library is actually named. (I took an educated guess. :) ) There's a note at the top of this section about possibly having to modify sage/misc/cython.py as well. It looks like you'd have to add something similar there in the function cblas() such that it returns the name of the library.

Finally, you should probably rebuild Sage with the -a flag a la

$ sage -ba

Anyway, the end result should be that all of Sage's Cython-based objects (like matrices) will use GOTOBLAS for the appropriate computations instead of BLAS. I haven't tried this myself but it looks like this is the way to go. I'm just curious if there's a less "invasive" way to do it. (Like your suggestion of symblinking to libcblas.so or whatever the standard "BLAS" library is called.)