[lustre-discuss] Trying to only build the lustreapi without sudo - make install error (Permission denied)
Andreas Dilger
adilger at whamcloud.com
Wed Jul 31 19:20:17 PDT 2024
On Jul 29, 2024, at 12:32, Apostolis Stamatis via lustre-discuss <lustre-discuss at lists.lustre.org<mailto:lustre-discuss at lists.lustre.org>> wrote:
Hello all,
I am trying to use the lustreapi in a project and I need to build it without sudo privileges in order to compile code that uses it. I don't need to build the whole client support, my end goal is only to compile code using lustreapi.h
What I am doing is:
```
sh autogen.sh
./configure --disable-server --disable-modules --disable-tests --prefix=/home/user/thirdparty/
make install
```
This fails with the error (output shortened to what I think is relevant)
```
make[3]: Entering directory '/home/user/lustre-release/libcfs/libcfs'
/bin/bash ../../libtool --tag=CC --mode=link gcc -fPIC -g -O2 -Wall -Werror -o libcfs.la<http://libcfs.la> util/libcfs_la-string.lo util/libcfs_la-nidstrings.lo util/libcfs_la-param.lo util/libcfs_la-parser.lo util/libcfs_la-l_ioctl.lo -lkeyutils
libtool: link: rm -fr .libs/libcfs.a .libs/libcfs.la<http://libcfs.la>
rm: cannot remove '.libs/libcfs.a': Permission denied
rm: cannot remove '.libs/libcfs.la<http://libcfs.la>': Permission denied
It looks like these files are not owned by the user running this command. Maybe there was previously a "sudo make" or similar run, and these directories/files are owned by root?
libtool: link: ar cr .libs/libcfs.a util/.libs/libcfs_la-string.o util/.libs/libcfs_la-nidstrings.o util/.libs/libcfs_la-param.o util/.libs/libcfs_la-parser.o util/.libs/libcfs_la-l_ioctl.o
ar: could not create temporary file whilst writing archive: no more archived files
```
When running `sudo make install`, it works
So my questions are:
1) Is it possible to run make install without sudo for my use case
I think yes, though I haven't tested this myself. The errors above indicate a permission error and not something wrong with the build.
2) Is there a better way to only build the support for using lustreapi (assuming that what is required is only the library liblustreapi.a and the include headers)
It would make more sense to build and install the libraries together with the modules so that they are a consistent version.
Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Whamcloud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-discuss-lustre.org/attachments/20240801/766c4459/attachment.htm>
More information about the lustre-discuss
mailing list