Error linking lapack and blas to armadillo
Hi
I am using ROS2 Foxy for my development project. I am trying to use armadillo library in my code primarily to calculate pseudo inverse of a non-square matrix. I declare the library at the beginning of the code:
include <armadillo>
and also in the Cmakelists of the package for compiling:
find_package(Armadillo REQUIRED)
function(custom_executable subfolder target)
add_executable(${target} src/${subfolder}/${target}.cpp)
ament_target_dependencies(${target}
rclcpp
px4_msgs
geometry_msgs
Armadillo
)
install(TARGETS ${target}
DESTINATION lib/${PROJECT_NAME})
endfunction()
However, when I try to run the pinv function to calculate the pseudo inverse, the following linking errors pops up highlighting that lapack and blas are not linked to Armadillo:
undefined reference to 'wrapper2_dgetrs_'
undefined reference to 'wrapper2_dgecon_' etc.
These are just a few errors I have listed. There are more errors which indicate that lapack and blas library are not linked to Armadillo. Please help me solve this error. There should be a way to link the libraries to Armadillo in the Cmakelists...