简体   繁体   中英

how to link armadillo under linux ubuntu giving linking error

I have compiled the library armadillo installed it with sudo make install. Then I linked it with the following options

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-long-long -std=c++14 -fext-numeric-literals -Wno-cast-function-type -ffast-math -larmadillo -lblas -lm -llapack")

I get the following linking error bayesian_estimation.cpp:(.text+0x4ad5): undefined reference to `dgemm_'

I also installed lapack and blas with sudo apt-get install

CMAKE_CXX_FLAGS 用于编译选项(即使如此......)您应该以不同的方式放置这些链接器标志:

target_link_libraries(my-target armadillo blas m lapack)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM