#1114486 cmake can't detect libarmadillo-dev

Package:
libarmadillo-dev
Source:
libarmadillo-dev
Description:
streamlined C++ linear algebra library - Headers
Submitter:
刘 志鹏
Date:
2025-09-06 02:33:13 UTC
Severity:
normal
#1114486#5
Date:
2025-09-06 02:31:37 UTC
From:
To:
I am using Debian-13 trixie.

here is a minimal sample

CMakeLists.txt

'''
cmake_minimum_required(VERSION 3.15)
set(APP_NAME armatest)
project(${APP_NAME})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

# https://cmake.org/cmake/help/latest/module/FindArmadillo.html
find_package(Armadillo CONFIG REQUIRED)
target_include_directories(armatest PRIVATE ${ARMADILLO_INCLUDE_DIRS})
target_link_libraries(armatest PRIVATE ${ARMADILLO_LIBRARIES} openblas)
add_executable(armatest armatest.cpp)
'''

armatest.cpp
'''
#include <armadillo>
#include <iostream>

int main() {
  arma::Mat<double> mat = arma : Mat<double>(4, 4, arma::randu);
  std::cout << mat;
}
'''

put CMakeLists.txt and armatest.cpp in the same folder, run cmake

then cmake would report Armadillo_CONFIG.cmake not found