DrTimothyAldenDavis / SuiteSparse

The official SuiteSparse library: a suite of sparse matrix algorithms authored or co-authored by Tim Davis, Texas A&M University.
https://people.engr.tamu.edu/davis/suitesparse.html
Other
1.19k stars 266 forks source link

Build fail when cross compile to ARMV8 #870

Open rachot opened 2 months ago

rachot commented 2 months ago

BLAS version : 0.3.28

Error result:

/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/chotros2/krs_ws/install-kr260-ubuntu/lib/liblapack64.so.3: undefined reference to `daxpy_64_'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/chotros2/krs_ws/install-kr260-ubuntu/lib/liblapack64.so.3: undefined reference to `dspr2_64_'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/chotros2/krs_ws/install-kr260-ubuntu/lib/liblapack64.so.3: undefined reference to `dsyr2_64_'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/chotros2/krs_ws/install-kr260-ubuntu/lib/liblapack64.so.3: undefined reference to `zscal_64_'

image

I found daxpy64 but cannot build

this is myconfig

cmake ~/SuiteSparse-stable \
  -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
  -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
  -DCMAKE_TOOLCHAIN_FILE=~/SuiteSparse-stable/toolchain_aarch64.cmake \
  -DCMAKE_INSTALL_PREFIX=/home/chotros2/krs_ws/install-kr260-ubuntu \
  -DMPFR_LIBRARIES=/home/chotros2/krs_ws/install-kr260-ubuntu/lib/libmpfr.so \
  -DMPFR_INCLUDE_DIR=/home/chotros2/krs_ws/install-kr260-ubuntu/include \
  -DGMP_LIBRARY=/home/chotros2/krs_ws/install-kr260-ubuntu/lib/libgmp.so \
  -DGMP_INCLUDE_DIR=/home/chotros2/krs_ws/install-kr260-ubuntu/include \
  -DBLAS_LIBRARIES=/home/chotros2/krs_ws/install-kr260-ubuntu/lib/libopenblas.so \
  -DLAPACK_LIBRARIES=/home/chotros2/krs_ws/install-kr260-ubuntu/lib/liblapack64.so \
  -DGRAPHBLAS_USE_JIT=OFF \
  -DGRAPHBLAS_USE_CUDA=OFF \
  -DGMP_STATIC=OFF \
  -DMPFR_STATIC=OFF \
  -DCMAKE_C_FLAGS="-DBLAS_UNDERSCORE" \
  -DSUITESPARSE_USE_64BIT_BLAS=ON \
  -DCMAKE_CXX_FLAGS="-DBLAS_UNDERSCORE"
mmuetzel commented 2 months ago

The U in the output of nm means that the symbol is undefined in that library. Maybe, you'll need to additionally link to another library that defines that symbol?

Which LAPACK vendor is that?

DrTimothyAldenDavis commented 2 months ago

Those missing symbols are all from the BLAS, but with added suffixes (64). The suffix indicates that the LAPACK library you're using (lapack64) is looking for a specific 64-bit BLAS library.

You're using libopenblas.so, and I'm guessing that it's a 32-bit library. You probably need to use a different BLAS library, with 64-bit integers as their parameters.

By "64-bit" and "32-bit", I mean the expected integer sizes for the input/output parameters of the BLAS and LAPACK routines.