Thank you again for your responses.
I installed Armadillo, BLAS, and LAPACK. Armadillo seems to be working, since I can do basic operations with matrices using it
Whenever I try to use the pinv function inside my OOT block, I get the error : AttributeError: 'module' object has no attribute 'cca_update'
I just comment the line about the pinv, and no error appears.
I have added the packages in the CMakelist, and I made sure that the libraries were added in the armadillo file arma_config.hpp.
See details below.
Thank you!
cca_update_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
.......
.............
arma::mat mat_GT;
arma::mat mat_NS;
arma::mat Cx;
arma::mat Cy;
arma::mat Cxy;
arma::sp_mat A;
Cx = mat_NS*mat_NS.t();
Cy = mat_GT*mat_GT.t();
Cxy = mat_NS*mat_GT.t();
A = pinv(Cx)*Cxy*pinv(Cy)*Cxy.t()
}
CMakeLists.txt file in my OOT Module
########################################################################
# Find gnuradio build dependencies
########################################################################
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
message(STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}")
message(STATUS "BLAS libraries: ${BLAS_LIBRARIES}")
find_package(Armadillo)
output of cmake ../
- A library with BLAS API found.
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- LAPACK libraries: /usr/lib/x86_64-linux-gnu/liblapack.so;/usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so
-- BLAS libraries: /usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so
-- Found Armadillo, building MUSIC
arma_config.hpp file
CMakeLists.txt file in my OOT Module
#if !defined(ARMA_USE_LAPACK)
#define ARMA_USE_LAPACK
//// Comment out the above line if you don't have LAPACK or a high-speed replacement for LAPACK,
//// such as Intel MKL, AMD ACML, or the Accelerate framework.
//// LAPACK is required for matrix decompositions (eg. SVD) and matrix inverse.
#endif
#if !defined(ARMA_USE_BLAS)
#define ARMA_USE_BLAS
//// Comment out the above line if you don't have BLAS or a high-speed replacement for BLAS,
//// such as OpenBLAS, GotoBLAS, Intel MKL, AMD ACML, or the Accelerate framework.
//// BLAS is used for matrix multiplication.
//// Without BLAS, matrix multiplication will still work, but might be slower.
#endif