I cannot make Armadillo 4.3 work on Windows. The library armadillo/include
is included and I run g++ "-LC:\\Armadillo\\BLAS_Lapack" -o1 -o test.exe test.o -llapack -lblas
, then I get the following error message:
C:/Armadillo/include/armadillo_bits/blas_wrapper.hpp:183: undefined reference to `wrapper_ddot_'
test.o: In function `ZN4arma4blas4gemvIdEEvPKcPKiS5_PKT_S8_S5_S8_S5_S8_PS6_S5_':
C:/Armadillo/include/armadillo_bits/blas_wrapper.hpp:34: undefined reference to `wrapper_dgemv_'
test.o: In function `ZN4arma4blas4gemmIdEEvPKcS3_PKiS5_S5_PKT_S8_S5_S8_S5_S8_PS6_S5_':
C:/Armadillo/include/armadillo_bits/blas_wrapper.hpp:69: undefined reference to `wrapper_dgemm_'
If I run g++ -o1 -o test.exe test.o -llapack -lblas
, I get
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -llapack
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lblas
I did uncomment the configuration file config.hpp
according to the README file.
Does anybody know how to make Armadillo work? (I am using Eclipse CDT.)
It took a while to get this right, but it seems transparent once it works. I will explain step by step. (Make sure you have uncommented the correct lines as directed in the README of the config.hpp file)
The general command for compiling with blas/lapack (using the default provided with armadillo (current version 4.500.0) and does make it faster :)
g++ main.cpp -I C:{ARMADILLO_ROOT}\include -L C:{ARMADILLO_ROOT}\examples\lib_win64 -lblas_win64_MT -llapack_win64_MT
where each of the commands are as follows:
g++: GNU G++ Compiler (using MinGW 4.9.1 C++ from equationsolution.com)
main.cpp: My main file of the C++ program (I have an abstract and concrete class defining the Levenshtein algorithm)
-I C:{ARMADILLO_ROOT}\include: The GCC C++ Compiler Include Path (To include the Armadillo library) where ARMADILLO_ROOT is where you have decompressed and placed your armadillo files
-L C:{ARMADILLO_ROOT}\examples\lib_win64: The MinGW C++ Linker Library Link Path (To link the BLAS and LAPACK libraries) I have used the default libs provided with armadillo, I believe and according to the doc you may and should substitute these linear libraries in a production instance)
-lblas_win64_MT -llapack_win64_MT: Identify the libraries to be used (name must match, so you cannot put -lblas or -llapack UNLESS your files are named that way - by default in this armadillo version they are named blas_win64_MT lapack_win64_MT (win64 since I am using both a MinGW/C++ 64bit and a 64bit armadillo [they should match])
Following this logic, you may configure eclipse (using eclipse Luna R1 4.4.1 -should be the same procedure on other versions) with the following:
--Screenshot1
--Screenshot2