Thanks for the help Andreas, indeed installing the lustre-dev and lustre-client-utils packages solved the issue with the lustreapi library.

However I am still getting an error:

```

/usr/bin/ld: /tmp/cceAX1ZW.o: in function `main':
test_file.c:(.text+0x37): undefined reference to `llapi_file_create'
collect2: error: ld returned 1 exit status

```

This leads me to believe I am doing something else wrong (potentially with the includes?).

Anyone with any input on what the issue might be or alternatively the steps they have followed to use the C lustre api?

Cheers, Apostolis


On 8/6/24 21:19, Andreas Dilger wrote:
On Jun 8, 2024, at 08:14, Apostolis Stamatis via lustre-discuss <[email protected]> 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
_______________________________________________
lustre-discuss mailing list
[email protected]
http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org

Reply via email to