compiling Suitesparse 4.4.4 with Openblas on linux

1.8k Views Asked by At

I downloaded and compiled Openblas, and now I am trying to compile and link openblas to Suitesparse 4.4.4. After compiling all lib files, I get the following error when the compiler tries to compile umfpack_di_demo.c:


    ../Lib/libumfpack.a(umf_di_local_search.o): In function  `umfdi_local_search':
    umf_local_search.c:(.text+0x4c0): undefined reference to `dtrsv_'
    umf_local_search.c:(.text+0x634): undefined reference to `dgemv_'
    ../Lib/libumfpack.a(umf_di_blas3_update.o): In function    `umfdi_blas3_update':
    umf_blas3_update.c:(.text+0x11d): undefined reference to `dtrsm_'
    umf_blas3_update.c:(.text+0x1de): undefined reference to `dgemm_'
    umf_blas3_update.c:(.text+0x2ae): undefined reference to `dger_'

which I took to mean that the linking is not proper. But, as directed in SuiteSparse_config.mk, I gave the absolute location of libopenblas.a on my system. Also, I also gcc-nm to see if the symbol dtrsv_ is defined in libopenblas.a, and I got the following output which shows that the symbol is defined in the library:


    0000000000000000 T dtrsv_
                     U dtrsv_NLN
                     U dtrsv_NLU
                     U dtrsv_NUN
                     U dtrsv_NUU
                     U dtrsv_TLN
                     U dtrsv_TLU
                     U dtrsv_TUN
                     U dtrsv_TUU
                     U dtrsv_NLN
                     U dtrsv_NLU
                     U dtrsv_NUN
                     U dtrsv_NUU
                     U dtrsv_TLN
                     U dtrsv_TLU
                     U dtrsv_TUN
                     U dtrsv_TUU
    dtrsv_NUU.o:
    0000000000000000 T dtrsv_NUU
    dtrsv_NUN.o:
    0000000000000000 T dtrsv_NUN
    dtrsv_NLU.o:
    0000000000000000 T dtrsv_NLU
    dtrsv_NLN.o:
    0000000000000000 T dtrsv_NLN
    dtrsv_TUU.o:
    0000000000000000 T dtrsv_TUU
    dtrsv_TUN.o:
    0000000000000000 T dtrsv_TUN
    dtrsv_TLU.o:
    0000000000000000 T dtrsv_TLU
    dtrsv_TLN.o:
    0000000000000000 T dtrsv_TLN
                     U dtrsv_NLU
                     U dtrsv_NUN
                     U dtrsv_TLU
                     U dtrsv_TUN
                     U dtrsv_NLU
                     U dtrsv_NUN
                     U dtrsv_TLU
                     U dtrsv_TUN
                     U dtrsv_
                     U dtrsv_
                     U dtrsv_

I am not sure whats going wrong here. Should I include lapack with openblas in the suitesparse_config.mk file? Any help is appreciated. Thanks.

Note: if it helps, I used gcc 4.4.7 for all compilation and my system details are:


    Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux

== EDIT 1: the steps i followed ==

For Openblas:

  1. Downloaded openblas from http://github.com/xianyi/OpenBLAS/zipball/v0.2.14.
  2. Unzipped and compiled it on my system using gcc-4.4.7 and the following command make FC=/usr/bin/lgfortran-4.4 I had to provide 'FC' as my system is not having libgfortran.* present in /usr/lib/.
  3. After compilation is done, I type make install to install to a custom directory in my home folder.

For suitesparse:

  1. Downloaded suitesparse from http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.4.4.tar.gz
  2. Unzipped it, and edited the suitsparse_config.mk file to do the following modifications: A) enabled GPU configuration for CHOLMOD and SPQR, B) Not using metis, so commented "METIS_PATH = ../../metis-4.0" and "METIS = ../../metis-4.0/libmetis.a". Also, uncommitted "CHOLMOD_CONFIG = -DNPARTITION". C) gave path to custom installation of openblas: BLAS = -L//OpenBLAS/local/lib/libopenblas.a -lpthread -L/usr/lib/gcc/x86_64-linux-gnu/4.4.7/libgfortran.so
  3. type make in srcdir.
0

There are 0 best solutions below