Search code examples
clinuxcmakenfs

configure_file error on make install while compiling nfs-ganesha


My objective

I want to compile and install nfs-ganesha from source on a Oracle Linux machine.

Steps to reproduce

  • Using Oracle Linux Server release 7.4
  1. Download nfs-ganesha from github: https://github.com/nfs-ganesha/nfs-ganesha
  2. Follow steps from line 56 to 61 on this guide (just a normal compilation and installation): https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/COMPILING_HOWTO.txt
  3. At some point, you might receive an error that you're missing userspace-rcu. Do sudo yum install userspace-rcu userspace-rcu-devel to fix it.
  4. When I run the last command (make install) I get the following error:

Error

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

Some insights

I opened cmake_install.cmake to see what is failing, here is a fragment of the code:

I marked the faulty line with an arrow

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")

What I found on this function is that it copies one file to another, but I'm not sure how to get more information from the error. My main concern is that it might have to do with permissions but when I use sudo, I just get:

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

So I think it is not related to that.

Pivoting questions

Is there a way to know what exactly is the problem with those files? I would really appreciate if anyone knows how to get a verbose output on those errors.

Thank you for your help!


Solution

  • I solved this problem by moving the repo's folder and the build folder to a directory called /scratch. Then I issued the command again by being root. It installed correctly this time.