CMake 错误:找不到 GSL(缺少:GSL_INCLUDE_DIR)

CMake 错误:找不到 GSL(缺少:GSL_INCLUDE_DIR)

我在 Ubuntu 18.04 中安装模拟器,在执行“cmake ..”命令时出现以下错误。

The C compiler identification is GNU 7.5.0

-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc

-- Check for working C compiler: /usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find GSL (missing: GSL_INCLUDE_DIR GSL_LIBRARY GSL_CBLAS_LIBRARY)
  (found version "")

Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)

  /usr/share/cmake-3.10/Modules/FindGSL.cmake:148 (find_package_handle_standard_args)

  CMakeLists.txt:6 (find_package)

-- Configuring incomplete, errors occurred!

我检查了 GSL 的包含目录、库和 cblas 库。它们都存在。为什么 cmake 不会自动读取目录路径?我希望有一个解决方案。

答案1

您需要安装有关的开发包:

sudo apt-get install libgsl-dev

然后重试 CMake。

相关内容