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
CMake Error at cmake_install.cmake:68 (file):
file failed to open for writing (Permission denied):
/usr/local/lib/moab.make
Comments (7)
-
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. 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.
-
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.
-
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.
-
I had a look at the generated moab.make, and I think the best thing to do is to drop it completely.
- 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).
- 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.
-
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.
-
Can you verify that the fix in Issue
#165resolves this issue as well? - Log in to comment
It looks like it attempts to install this file into $PREFIX instead of into the stage directory.