gcc gcc - 2 months ago 33
Linux Question

Install OpenBLAS libs in alternative system

I compiled OpenBLAS and istalled it in /usr/lib/libopenblas
Now I want to install the libraries in the alternatives system running

#!/bin/bash

update-alternatives
--install /usr/lib/libblas.so libblas.so /usr/lib/libopenblas
/lib/libopenblas.so 40\
--slave-link /usr/lib/libblas.a libblas.a /usr/lib/libopenblas
/lib/libopenblas.a

update-alternatives
--install/usr/lib/libblas.so.3 libblas.so.3
/usr/lib/libopenblas/lib/libopenblas.so.0 40\
--slave-link /usr/lib/libblas.so.3gf libblas.so.3gf
/usr/lib/libopenblas/lib/libopenblas.so.0


but always get the error

update-alternatives: priority must be an integer


while I believe that I set this priority to the number 40.
What's wrong here?

Answer

OpenBLAS is a Debian / Ubuntu package, so you could

  • install the existing one

  • use the source of the existing ones to build a local one

and in either case it will have the postinst script with

update-alternatives --install /usr/lib/libblas.so.3 libblas.so.3 \                                                                                                                                                  
        /usr/lib/openblas-base/libblas.so.3 40 \                                                                                                                                                                    
    --slave /usr/lib/libblas.so.3gf libblas.so.3gf /usr/lib/openblas-base/libblas.so.3                                                                                                                              

update-alternatives --install /usr/lib/liblapack.so.3 liblapack.so.3 \                                                                                                                                              
        /usr/lib/openblas-base/liblapack.so.3 40 \                                                                                                                                                                  
    --slave /usr/lib/liblapack.so.3gf liblapack.so.3gf /usr/lib/openblas-base/liblapack.so.3