[LU-5541] improve liblustreapi build Created: 25/Aug/14  Updated: 31/Jan/22  Resolved: 25/Jan/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.11.0

Type: Improvement Priority: Minor
Reporter: Frank Zago (Inactive) Assignee: Nathaniel Clark
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Related
is related to LU-10514 all metadata operations take 1+ minut... Resolved
is related to LU-6243 version liblustreapi.so Resolved
is related to LU-3074 liblustreapi.so and liblustre.so lack... Resolved
is related to LU-7356 configure --disable-shared broken for... Resolved
is related to LU-9897 Tracking of lustre library improvements. Open
Rank (Obsolete): 15425

 Description   

Currently liblustreapi export all its symbols to the application, some of which are undesirable, such as do_ioctl, dump, ... Use the linker to clean that up.

Use libtool to build the shared library.



 Comments   
Comment by Frank Zago (Inactive) [ 25/Aug/14 ]

(abandonned) http://review.whamcloud.com/11581
(abandonned) http://review.whamcloud.com/11582
(abandonned) http://review.whamcloud.com/11583
(abandonned) http://review.whamcloud.com/11584

Comment by Frank Zago (Inactive) [ 25/Aug/14 ]

Somewhat related to these patches, there are several archives that are installed by the rpms that look unnecessary:

/usr/lib64/libcfsutil.a
/usr/lib64/libiam.a
/usr/lib64/liblustreapi.a
/usr/lib64/libptlctl.a

If used, these should probably be replaced by a shared library.

Comment by Frank Zago (Inactive) [ 28/Aug/14 ]

http://review.whamcloud.com/11625
http://review.whamcloud.com/11643

Comment by James A Simmons [ 04/Nov/14 ]

With the base patch worked out we should discuss what functions to export. I'm in agreement with Henri that all functions to exports should began with llapi_* for liblustreapi. Anyone disagree?

Comment by Frank Zago (Inactive) [ 04/Nov/14 ]

There is some functions that start with llapi_* that shouldn't be exported (like llapi_printf, llapi_chomp_string, all the json functions, ...)

Comment by James A Simmons [ 26/Jan/16 ]

Frank do you have a list of llapi_* functions not to export.

Comment by Frank Zago (Inactive) [ 26/Jan/16 ]

No, but you can modify the linker script to not export anything, then add the missing functions as the linker fails to link the various programs.

You can then compare that list with the list of all llapi functions obtained previously with

nm liblustreapi.so | grep " T llapi_"

However I believe that the function names should be whitelisted instead of blacklisting some names.

Comment by James A Simmons [ 26/Jan/16 ]

I'm seeing this when building on Ubuntu and only on Ubuntu.

gcc -DHAVE_CONFIG_H -I. -I../.. -include /tmp/jsimmons-ppc/rpmbuild/usr/src/lustre-2.7.65/debian/tmp/modules-deb/usr
_src/modules/lustre/undef.h -include /tmp/jsimmons-ppc/rpmbuild/usr/src/lustre-2.7.65/debian/tmp/modules-deb/usr_src/m
odules/lustre/config.h -I/tmp/jsimmons-ppc/rpmbuild/usr/src/lustre-2.7.65/debian/tmp/modules-deb/usr_src/modules/lustr
e/libcfs/include -I/tmp/jsimmons-ppc/rpmbuild/usr/src/lustre-2.7.65/debian/tmp/modules-deb/usr_src/modules/lustre/lnet/include -I/tmp/jsimmons-ppc/rpmbuild/usr/src/lustre-2.7.65/debian/tmp/modules-deb/usr_src/modules/lustre/lustre/include -fPIC -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1 -I/opt/lam/include -g -O2 -c -o multiop.o multiop.c
make[7]: *** No rule to make target `../../lustre/utils/liblustreapi.la', needed by `multiop'. Stop.
make[7]: *** Waiting for unfinished jobs....

It only happens there. Frank have any ideas why?

Comment by Frank Zago (Inactive) [ 26/Jan/16 ]

I guess it's because it's a more recent version of autoconf than elsewhere.

Comment by Frank Zago (Inactive) [ 28/Jan/16 ]

James, I have built lustre on Ubuntu 15.10 with the 2 patches above plus http://review.whamcloud.com/#/c/17581, with no problem.

Comment by James A Simmons [ 28/Jan/16 ]

Did you do a make deb as well? Doing make does work but it fails for make debs. I do suspect it is a setup issue.

Comment by Frank Zago (Inactive) [ 28/Jan/16 ]

No, I didn't do that. It's possible that some files are missing in automake. For instance, if you do a "make dist", can you build from the generated tar file?

Comment by James A Simmons [ 03/Feb/16 ]

I have attempted to build on my Ubuntu 15 home box but now it will no longer build due to missing keys. As for our Ubuntu14 platform on Power8 I just think it is totally messed up with the dpkg system. It can't find the liblustreapi.la so it failed to build. This might be specific to our Power8 platform but in any case our admins are working hard to get as far away from Ubuntu as possible to using RHEL7. So by the time this patch lands it will be a non-issue. With all the problems we should declare Ubuntu support dead.

Comment by Gerrit Updater [ 24/Aug/17 ]

James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/28701
Subject: LU-5541 test: add proper libtool setup for test application
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 5ec4a652ea139d2c4960588e4282a6c655e777ef

Comment by Gerrit Updater [ 28/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/11625/
Subject: LU-5541 build: build static and dynamic liblustreapi
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: ab1df50e73ff838053fff62302c3b884e4e19552

Comment by Gerrit Updater [ 28/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/11643/
Subject: LU-5541 lustreapi: only export the API symbols
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: b36c377ff25c20417c481eab3798e67d042ec3a3

Comment by Alex Zhuravlev [ 28/Aug/17 ]

with this patch landed I can't run from the build tree (as host and VM has different paths):

  1. /work/head2/lustre/utils/lctl
    /work/head2/lustre/utils/lctl: line 202: cd: /home/alexey/head2/lustre/utils: No such file or directory
    gcc: lustre_lfsck.o: No such file or directory
    gcc: obd.o: No such file or directory
    gcc: lustre_cfg.o: No such file or directory
    gcc: lctl.o: No such file or directory
    gcc: lsnapshot.o: No such file or directory
    gcc: ./.libs/liblustreapi.so: No such file or directory
Comment by James A Simmons [ 28/Aug/17 ]

You need to run autogen.sh; ./configure .... Oleg works like this as well and I made sure he could continue his work flow.

Comment by Alex Zhuravlev [ 28/Aug/17 ]

hmm, that didn't work for me. just tried.

Comment by James A Simmons [ 28/Aug/17 ]

Does it work with a fresh checkout? What is your environment you are working in?

Comment by Alex Zhuravlev [ 28/Aug/17 ]

got the same with a fresh checkout.

Comment by Alex Zhuravlev [ 28/Aug/17 ]

--disable-shared worked for me, thanks.

Comment by James A Simmons [ 28/Aug/17 ]

AH so you are doing the same environment as Oleg. As a note to people spawning VMs that are read only like Oleg does. You will need to build lustre with ./configure --disable-shared. Since it looks like it is working for Alex we can close this ticket. Future work will be done under LU-9897

Comment by Gerrit Updater [ 29/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) uploaded a new patch: https://review.whamcloud.com/28782
Subject: Revert "LU-5541 lustreapi: only export the API symbols"
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: cb8908f7bfa6a4ed662646111553769a2aeff764

Comment by Gerrit Updater [ 29/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) uploaded a new patch: https://review.whamcloud.com/28783
Subject: Revert "LU-5541 build: build static and dynamic liblustreapi"
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 422457d0bdc180709ecf734de85fd36adc229c77

Comment by James A Simmons [ 29/Aug/17 ]

So does anyone understand how the debian/ubuntu version of libtool works. Its totally different than other systems.

Comment by Gerrit Updater [ 31/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/28782/
Subject: Revert "LU-5541 lustreapi: only export the API symbols"
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: fe4b7e75c0b65d6e1099e6043c7d21637f87403e

Comment by Gerrit Updater [ 31/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/28783/
Subject: Revert "LU-5541 build: build static and dynamic liblustreapi"
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: e1679d0348856bc68589493e7ea86f1aaf21e1af

Comment by James A Simmons [ 31/Aug/17 ]

BTW just to let people know building Ubuntu 16 is very broken in general for lustre

Comment by Gerrit Updater [ 15/Dec/17 ]

James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/30562
Subject: LU-5541 build: move libcfs and liblustreapi over to libtool
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c672448588f55f6dbce5351c2f3033ecf57835e2

Comment by James A Simmons [ 15/Dec/17 ]

Okay I managed to get everything to build on Ubuntu17 but now it fails on Ubuntu16. I'm going to need help from debian people here to get that working.

Comment by James A Simmons [ 09/Jan/18 ]

Thanks to Thomas Stibor the Ubuntu/Debian build issues have been resolved.

Comment by Gerrit Updater [ 14/Jan/18 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30562/
Subject: LU-5541 build: move libcfs and liblustreapi over to libtool
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 7b659a1e68174212c443761be1880774b440a901

Comment by Peter Jones [ 14/Jan/18 ]

So is that patch just landed to master the last part of this work? Can the ticket be marked as resolved?

Comment by James A Simmons [ 14/Jan/18 ]

One patch left

Comment by Gerrit Updater [ 14/Jan/18 ]

James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/30865
Subject: LU-5541 lustreapi: only export the API symbols
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 22ea21137a936e906171bbc073dfee9767fd24d2

Comment by Gerrit Updater [ 25/Jan/18 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30865/
Subject: LU-5541 lustreapi: only export the API symbols
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: e954d93f264d8ae559cbd41ed6d7b977674dd42b

Comment by Peter Jones [ 25/Jan/18 ]

The end of an era

Comment by James A Simmons [ 26/Jan/18 ]

Yes. Libraries are sane now!!!

Generated at Sat Feb 10 01:52:22 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.