0

When using some functions in the Armadillo Algebra package I get the following errors:

armadillo_bits/atlas_wrapper.hpp:188: undefined reference to `clapack_dgetrf'

I have linked like this:

arm-linux-gnueabihf-g++  -march=armv7-a     -mthumb-interwork -mfloat-abi=hard  
-mfpu=neon    
-mtune=cortex-a9 --sysroot=/home/mg/yocto/build/tmp/sysroots/socfpga_cyclone5  
-DHAVE_CONFIG_H -I. -I..   --sysroot=/home/mg/yocto/build/tmp/sysroots 
/socfpga_cyclone5  -g -O2 -L/opt/altera-linux/linaro/gcc-linaro-arm-linux-gnueabihf- 
4.7-2012.11-20121123_linux/arm-linux-gnueabihf/lib -I/opt/altera-linux/linaro 
/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/arm-linux-gnueabihf 
/include  -llapack -lf2c  -lblas -lm --sysroot=/home/mg/yocto/build/tmp/sysroots 
/socfpga_cyclone5 -MT AlgoLibTests.o -MD -MP -MF .deps/AlgoLibTests.Tpo -c -o  
AlgoLibTests.o AlgoLibTests.cpp

I followed the instructions here and everything went fine:

Cross-Compiling Armadillo Linear Algebra Library

Any Ideas?

Community
  • 1
  • 1
user1876942
  • 1,411
  • 2
  • 20
  • 32
  • Looks like you configured Armadillo to use ATLAS. This was probably done by the cmake based installer. I suggest to edit `include/armadillo_bits/config.hpp` and disable the use of ATLAS. However, make sure use of LAPACK is still enabled. – mtall Apr 11 '14 at 15:23
  • I made sure it was disabled from that file. So, you think that the CLAPACK library has been built OK? I saw no errors when building that. – user1876942 Apr 11 '14 at 20:05
  • CLAPACK and LAPACK are related, but two separate libraries. They implement the same functionality, but have different APIs. – mtall Apr 12 '14 at 11:35
  • Well, in that link I provided he used CLAPACK 3.2.1, so did I. I will try and build from clean and make sure that ATALS flag is disabled. – user1876942 Apr 12 '14 at 15:41
  • Still no luck on this, any ideas anyone? When I cake . I am sure it is looking at my Red Hat computer for the details and making its mind up then. I need to cross compile that cake I guess. – user1876942 Apr 15 '14 at 18:26

1 Answers1

0

It also took me some days to be able to install armadillo for my Android development. So I want to shared with you the experience to solve your problem.

The error undefined reference to `clapack_dgetrf' is a linking error. This function should be contained in one of these libraries -llapack -lf2c -lblas. Of course it is clapack, so it should be in the lapack library. Use the command nm to check if the lapack library (liblapack.a or liblapack.so) contains this symbol. I am sure you will find out the solution then. Hope it helps.

alibaba
  • 45
  • 4