[lustre-discuss] Fwd: lustreapi not found when compiling sample C program

Andreas Dilger adilger at ddn.com
Sat Jun 8 23:34:57 PDT 2024


On Jun 8, 2024, at 08:14, Apostolis Stamatis via lustre-discuss <lustre-discuss at lists.lustre.org> wrote:

Hello everyone,

I am trying to use the C api for lustre, using Ubuntu 22.04, kernel version 5.15.0-107 and lustre client modules version 2.15.4
I am building lustre from source with the following steps (removed some junk like git clone and cd) (mainly from the guide https://metebalci.com/blog/lustre-2.15.4-on-rhel-8.9-and-ubuntu-22.04/)

It would be great to copy this page to wiki.lustre.org. It is a bit ironic that this page is mentioning that the wiki is outdated, but then proceeds to not update the wiki with new content...

```
sudo apt install build-essential libtool pkg-config flex bison libpython3-dev libmount-dev libaio-dev libssl-dev libnl-genl-3-dev libkeyutils-dev libyaml-dev libreadline-dev module-assistant debhelper dpatch libsnmp-dev mpi-default-dev quilt swig
sh autogen.sh
./configure --disable-server
make dkms-debs
sudo dpkg -i debs/lustre-client-modules-dkms_2.15.4-1_amd64.deb
sudo apt --fix-broken install
sudo dpkg -i debs/lustre-client-utils_2.15.4-1_amd64.deb
```

The client works as expected and can mount and modify the filesystem.
However when I try to compile the sample program using gcc v 11.4.0 with the command
`gcc -I/usr/src/lustre-client-modules-2.15.4/lustre/include -I/usr/src/lustre-client-modules-2.15.4/lustre/include/uapi/ -I/usr/src/lustre-client-modules-2.15.4/lustre/include/lustre -llustreapi test_file.c -o test`
I get the error `/usr/bin/ld: cannot find -llustreapi: No such file or directory`

After trying to find the lustreapi library manually, indeed I can't seem to find it anywhere

According to the most recent build on the b2_15 branch on Ununtu 22.04  https://build.whamcloud.com/job/lustre-b2_15/87/arch=x86_64,build_type=client,distro=ubuntu2204,ib_stack=inkernel/

There is a "lustre-dev" package built, and it looks like that this would contain the library files, "This package provides development libraries for the Lustre filesystem."

Cheers, Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-discuss-lustre.org/attachments/20240609/bc4f6f03/attachment.htm>


More information about the lustre-discuss mailing list