det() calls throw "Non-BLAS compatible type detected" exception

Issue #136 wontfix
Parsa Amini created an issue
  • Minimal code to reproduce the issue
#include <iostream>
#include <blaze/Math.h>

int main() {
    blaze::DynamicMatrix<double> a { {1, 2}, {3, 4} };

    std::cout << "a" << std::endl << a << std::endl;

    double d = blaze::det(a);
    std::cout << "det(a) = " << d << std::endl;

    std::cin.get();
}
  • Blaze 3.2
  • Machine A: MacOS 10.13, Apple LLVM
  • Blaze installed via cmake, SMP_THREADS set to C++11
  • Output
[ 50%] Linking CXX executable blaze_h_test
Undefined symbols for architecture x86_64:
  "_dgetrf_", referenced from:
      blaze::getrf(int, int, double*, int, int*, int*) in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [blaze_h_test] Error 1
make[1]: *** [CMakeFiles/blaze_h_test.dir/all] Error 2
make: *** [all] Error 2
  • Machine B: MSVC 15.0, VS 17,Windows 10 x64
  • Blaze installed via Vcpkg (x64)
  • Output
1>------ Build started: Project: blzapp1, Configuration: Debug x64 ------
1>blaze_dem.obj : error LNK2019: unresolved external symbol dgetrf_ referenced in function "void __cdecl blaze::getrf(int,int,double *,int,int *,int *)" (?getrf@blaze@@YAXHHPEANHPEAH1@Z)
1>C:\Users\Parsa\Documents\Visual Studio 2017\Projects\blzapp1\x64\Debug\blzapp1.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "blzapp1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  • Machine C: Linux - Solus
  • Blaze installed via cmake, BLAS backend (OpenBLAS 0.2.2, LAPACK 3.7.1)
  • Output
/tmp/ccsl3nLf.o: In function `blaze::DynamicMatrix<double, false>::ElementType blaze::detNxN<blaze::DynamicMatrix<double, false>, false>(blaze::DenseMatrix<blaze::DynamicMatrix<double, false>, false> const&)':
ok.cpp:(.text._ZN5blaze6detNxNINS_13DynamicMatrixIdLb0EEELb0EEENT_11ElementTypeERKNS_11DenseMatrixIS3_XT0_EEE[_ZN5blaze6detNxNINS_13DynamicMatrixIdLb0EEELb0EEENT_11ElementTypeERKNS_11DenseMatrixIS3_XT0_EEE]+0x144): undefined reference to `dgetrf_'
collect2: error: ld returned 1 exit status

Comments (3)

  1. Klaus Iglberger

    Hi Parsa!

    Thanks for providing the detailed error reports for three different platforms. From all three error reports it becomes apparent that the dgetrf() LAPACK function is not linked to the final executable. As stated in the wiki, the det() function requires LAPACK functionality:

    ... Also note that the function is depending on LAPACK kernels. Thus the function can only be used if a fitting LAPACK library is available and linked to the executable. Otherwise a linker error will be created. ...

    Please link your LAPACK library to the final executable and the linker error will go away. For OpenBLAS this for instance requires to add -lopenblas on the command line, for ATLAS it is the combination of -lf77blas -lcblas -latlas. I hope this helps to resolve the issue.

    Best regards,

    Klaus!

  2. Log in to comment