0

I am trying to compile the Armadillo C++ Library under Windows 32 using MinGW32 and OpenBLAS.

I've tried every tutorial and stackoverflow.com question on the topic, but still can't seem to disable the compilation of the wrapper.obj which produces link errors "undefined reference to `sdot_'" and so on. These are BLAS symbols that cannot be found by the wrapper.

I have no other BLAS/LAPACK libraries installed, and in the cmake output it confirms that libopenblas.dll has been found.

How can I disable the compilation and linking of the wrapper.obj? Editing config.hpp has no effect.

lsdavies
  • 317
  • 2
  • 13

1 Answers1

2

You don't have to use the cmake-based installer to use Armadillo. The installer simply creates the wrapper library which links with BLAS and LAPACK. You can instead directly link Armadillo-based programs with BLAS and LAPACK:

g++ prog.cpp -o prog -O2 -I armadillo-4.500.0/include -DARMA_DONT_USE_WRAPPER -DARMA_USE_BLAS -DARMA_USE_LAPACK -lblas -llapack

Change armadillo-4.500.0/include to point where the Armadillo include folder resides.

mtall
  • 3,574
  • 15
  • 23
  • Wouldn't I need to compile/link Armadillo first? I'm not sure I understand, sorry. I can't actually compile/link Armadillo at this stage, it does not accept the symbols of any BLAS/LAPACK library I can supply. I have tried OpenBLAS as well with no success. – lsdavies Sep 24 '14 at 00:13
  • Armadillo is firstly a template library (ie. only C++ headers). A template library doesn't require compilation in the traditional sense. The second and optional part of Armadillo is the run-time library, which is simply a combined wrapper for BLAS and LAPACK. You can use Armadillo headers without the run-time library. Just link with LAPACK and BLAS directly, as explained above. – mtall Sep 24 '14 at 10:33