Cmake在使用Luarocks安装FBTORCH时无法识别Folly_libraries的缓存条目



我正在尝试在Linux上安装fbtorch。但是,当我尝试运行luarocks install fbtorch时,我会收到以下错误。

cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/user/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/user/torch/install/lib/luarocks/rocks/fbtorch/scm-1"
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.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 Torch7 in /home/user/torch/install
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  REQUIRED_ARGS (missing: FOLLY_INCLUDE_DIR FOLLY_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindFolly.cmake:23 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:12 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_fbtorch-scm-1-4920/fbtorch/build/CMakeFiles/CMakeOutput.log".

现在,要修复REQUIRED_ARGS (missing: FOLLY_INCLUDE_DIR FOLLY_LIBRARIES),我将CMAKE命令更改为:

cmake -E make_directory build && cd build && cmake .. -DFOLLY_LIBRARIES="/home/user/local/lib" -DFOLLY_INCLUDE_DIR="/home/user/local/include" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(LUA_BINDIR)/.." -DCMAKE_INSTALL_PREFIX="$(PREFIX)"

请注意,我已经编译并在适当目录中的/home/user/local/上安装了愚蠢的

这修复了FOLLY_INCLUDE_DIR错误,但仍显示FOLLY_LIBRARIES的错误:

CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  REQUIRED_ARGS (missing: FOLLY_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindFolly.cmake:23 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:12 (FIND_PACKAGE)

我在这里想念什么?为什么cmake识别folly_include_dir的缓存条目,而不是folly_libraries?

find_package()中列出的列表中列出的变量是不需要的 be cache 一个。因此,设置带有同名的缓存变量可能无法解决问题。

如果搜索的软件包实际上安装到 non-nastard位置,而不是盲目设置"缺少"变量,那么最好是提示 the"查找"脚本有关该位置的脚本。

许多"查找"脚本描述了代码开头的参数化方法。除此之外,还有一些通用方法用于暗示有关包装的实际位置的"查找"脚本;这些方式适用于大多数脚本。例如。您可以将软件包的安装位置添加到 cmake_prefix_path actiable(请参阅该问题)。

如果您查看FindFolly.cmake,您可以看到该行 -

SET(FOLLY_LIBRARIES ${FOLLY_LIBRARY})

这意味着正在设置FOLLY_LIBRARIES,但需要FOLLY_LIBRARY

因此,在您的命令行中,将-DFOLLY_LIBRARIES更改为-DFOLLY_LIBRARY

最新更新