【问题标题】:configure_file error on make install while compiling nfs-ganesha编译 nfs-ganesha 时 make install 出现 configure_file 错误
【发布时间】:2022-01-13 01:50:59
【问题描述】:

我的目标

我想在 Oracle Linux 机器上从源代码编译和安装 nfs-ganesha。

重现步骤

  • 使用 Oracle Linux Server 7.4 版
  1. 从 github 下载 nfs-ganesha:https://github.com/nfs-ganesha/nfs-ganesha
  2. 按照本指南第 56 到 61 行的步骤进行操作(只是正常的编译和安装):https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/COMPILING_HOWTO.txt
  3. 在某些时候,您可能会收到一条错误消息,指出您缺少 userspace-rcu。请sudo yum install userspace-rcu userspace-rcu-devel 修复它。
  4. 当我运行最后一个命令 (make install) 时,出现以下错误:

错误

bash-4.2$ make install
[  3%] Built target MainServices
normal build output...
[100%] Built target fsalmem
Install the project...
-- Install configuration: "Debug"
-- Installing: /etc/ganesha/ganesha.conf
CMake Error at cmake_install.cmake:54 (configure_file):
  configure_file Problem configuring file


make: *** [install] Error 1

一些见解

我打开cmake_install.cmake查看失败的地方,这里是代码片段:

我用箭头标记了故障线

IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
  
        set(_destfile "/etc/ganesha/ganesha.conf")
        if (NOT "$ENV{DESTDIR}" STREQUAL "")
            # prepend install root prefix with install-time DESTDIR
            set(_destfile "$ENV{DESTDIR}//etc/ganesha/ganesha.conf")
        endif ()
        if (EXISTS ${_destfile})
            message(STATUS "Skipping: ${_destfile} (already exists)")
            execute_process(COMMAND "/usr/bin/cmake" -E compare_files
                /home/carlhida/Documents/ganesha/src/config_samples/ganesha.conf.example ${_destfile} RESULT_VARIABLE _diff)
            if (NOT "${_diff}" STREQUAL "0")
                message(STATUS "Installing: ${_destfile}.example")
                configure_file(/home/carlhida/Documents/ganesha/src/config_samples/ganesha.conf.example ${_destfile}.example COPYONLY)
            endif ()
        else ()
            message(STATUS "Installing: ${_destfile}")
            # install() is not scriptable within install(), and
            # configure_file() is the next best thing
-------->>> configure_file(/home/carlhida/Documents/ganesha/src/config_samples/ganesha.conf.example ${_destfile} COPYONLY)
            # TODO: create additional install_manifest files?
        endif ()
    
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")

我在此函数中发现它会将一个文件复制到另一个文件,但我不确定如何从错误中获取更多信息。我主要担心的是它可能与权限有关,但是当我使用 sudo 时,我得到了:

bash-4.2$ sudo make install
CMake Error: The source directory "/home/carlhida/Documents/ganesha/src" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** [cmake_check_build_system] Error 1

所以我认为这与此无关。

关键问题

有没有办法知道这些文件到底有什么问题?如果有人知道如何获得这些错误的详细输出,我将不胜感激。

感谢您的帮助!

【问题讨论】:

  • 您应该删除 Oracle 标记。该标签指的是 Oracle RDBMS。它没有与源自 RedHat Enterprise Linux 的 Oracl Linux 有任何关系。
  • 我猜你的位置是错误的目录,当做'make install'时。 ....请查看我的结果drive.google.com/drive/folders/…
  • 错误“配置文件问题”与权限有关。错误“源目录...不存在”是关于您运行sudo make install 的错误目录,如前一位评论者所述。
  • 我删除了 oracle 标签,并尝试执行sudo make install -C /home/carlhida/Documents/buildganesha/。我收到以下错误:make: *** /home/carlhida/Documents/buildganesha/: Permission denied. Stop. 似乎它实际上与权限有关。 (我也不能使用su,因为我认为我的虚拟机没有完全的管理员权限。)

标签: c linux cmake nfs


【解决方案1】:

我通过将 repo 的文件夹和 build 文件夹移动到名为 /scratch 的目录来解决了这个问题。然后我再次以root身份发出命令。这次安装正确。

【讨论】:

    猜你喜欢
    • 2016-06-07
    • 2016-09-02
    • 1970-01-01
    • 2018-04-18
    • 1970-01-01
    • 1970-01-01
    • 2021-01-15
    • 2020-10-30
    • 1970-01-01
    相关资源
    最近更新 更多