5.3.0 CMake Error at cmake_install.cmake:68 (file): fails: file failed to open for writing (Permission denied): /usr/local/lib/moab.make

Issue #148 new
yurivict created an issue

CMake Error at cmake_install.cmake:68 (file):
file failed to open for writing (Permission denied):

/usr/local/lib/moab.make

Comments (7)

  1. yurivict reporter

    It looks like it attempts to install this file into $PREFIX instead of into the stage directory.

  2. Vijay M

    I dont quite understand. If you tried installing it, it would go into the CMAKE_INSTALL_PREFIX path. The default on your system may be /usr/local which generally requires sudo priveleges. I suggest specifying a prefix path during CMake configuration using something like this:

    cmake -DCMAKE_INSTALL_PREFIX:PATH=”MY_INSTALL_DIR_PATH” OTHER_OPTIONS $MOAB_SRCDIR_PATH
    

    Let us know if this is what you need. Else, please clarify.

  3. yurivict reporter

    I dont quite understand. If you tried installing it, it would go into the CMAKE_INSTALL_PREFIX path. The default on your system may be /usr/local which generally requires sudo priveleges.

    This is incorrect. Files are installed into $(DESTDIR)$(PREFIX).

    The project ignores the first part which is a stagedir.

  4. yurivict reporter

    As said above, the project has a bug that it doesn’t install into a stage directory.

    I couldn’t find any variable that contains stage dir during the cmake run.

    make uses the DESTDIR environment variable.

    I suggest that you move APPEND lines to the build phase to solve this problem.

    Appending to the installed files during the install phase doesn’t seem to work with stagedir in cmake.

  5. StefanBruens

    I had a look at the generated moab.make, and I think the best thing to do is to drop it completely.

    1. It contains a lot of stuff not useful after installation, i.e. lots of absolute path references to the source directory/build tree. In best case, these are just annoying (polluting the compiler command line with no longer existing include directories), but can also negatively affect reproducibility of binary packages (some build systems use a random directory name for building).
    2. All actually useful stuff is also contained in the pkgconfig and CMake files.

    In case dropping is not wanted, a different template file should be used, containing only the install paths, but no reference to the build tree.

  6. Vijay M

    Thanks for the comment @StefanBruens We will be moving to CMake fully before the next release and deprecate autotools. The moab.make file is a useful include file for GNU make-based downstream software. We will probably continue to include this but fix the issues going forward.

  7. Log in to comment