You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CMake构建VideoNLBayes项目时LAPACK API未找到问题求助

Fixing CMake's "Required LAPACKE API not found" Error on Ubuntu

Hey there! Let's work through this CMake issue step by step, since you're new to Ubuntu. First off, I spotted a typo in your apt-get commands (instal instead of install)—that might have prevented some dependencies from installing properly. Let's start with fixing that.

1. Reinstall Complete LAPACK/LAPACKE Dependencies

First, clean up any partially installed packages, then install the full set of development libraries (including the critical LAPACKE C interface package you missed):

sudo apt-get remove liblapack-dev libcblas-dev libatlas-dev
sudo apt-get update
sudo apt-get install liblapack-dev liblapacke-dev libcblas-dev libatlas-base-dev

Note: liblapacke-dev is the key package here—it includes the LAPACKE header files and libraries that CMake is looking for.

2. Verify LAPACKE Installation

Let's confirm the files are in place. Run these commands to find where LAPACKE's header and library live:

# Find the lapacke.h header file
find /usr -name lapacke.h
# Find the liblapacke.so library file
find /usr -name liblapacke.so

You should see output like this (the exact path might vary slightly based on your Ubuntu version):

/usr/include/lapacke.h
/usr/lib/x86_64-linux-gnu/liblapacke.so

3. Manually Specify Paths to CMake

If CMake still can't locate LAPACKE, pass the paths directly when running cmake:

cmake .. -DLAPACK_INCLUDE_DIR=/usr/include -DLAPACKE_LIBRARY=/usr/lib/x86_64-linux-gnu/liblapacke.so

Make sure to replace the paths with the ones you found in step 2 if they're different.

4. If You Compiled LAPACK from Source

If you tried building LAPACK manually earlier, ensure you installed it to a standard location that CMake checks. Here's the correct way to compile and install:

# Navigate to your LAPACK source directory
cd lapack-[version-number]
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
make
sudo make install

Installing to /usr/local lets CMake automatically detect the libraries without extra configuration.

Bonus: Tweak the Project's CMakeLists.txt (Optional)

If you're comfortable editing the project's CMakeLists.txt, you can hardcode the paths before the find_package(LAPACKE REQUIRED) line:

# Add these lines near the top of CMakeLists.txt
set(LAPACKE_INCLUDE_DIR "/usr/include")
set(LAPACKE_LIBRARY "/usr/lib/x86_64-linux-gnu/liblapacke.so")

Save the file, then rerun cmake .. as usual.

内容的提问来源于stack exchange,提问作者salim terai

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 09:32:41