Skip to content

Instantly share code, notes, and snippets.

@tcooper
Created April 18, 2014 21:53
Show Gist options
  • Save tcooper/11066088 to your computer and use it in GitHub Desktop.
Save tcooper/11066088 to your computer and use it in GitHub Desktop.
Lustre Client RPM Build Process

Lustre 2.4.2 Client Build

Basic sequence to download/build Lustre client rpms...

  1. clone
  2. checkout
  3. autogen
  4. configure
  5. make
  6. make rpms

Clone Whamcloud Lustre repository

[mockbuild@buildhost ~]$ git clone git://git.whamcloud.com/fs/lustre-release.git
Initialized empty Git repository in /home/mockbuild/lustre-release/.git/
remote: Counting objects: 265377, done.
remote: Compressing objects: 100% (76076/76076), done.
remote: Total 265377 (delta 187459), reused 247611 (delta 170486)
Receiving objects: 100% (265377/265377), 81.00 MiB | 1.60 MiB/s, done.
Resolving deltas: 100% (187459/187459), done.

Checkout tagged version

[mockbuild@buildhost ~]$ cd lustre-release/
[mockbuild@buildhost lustre-release]$ git checkout v2_4_2_RC2
Note: checking out 'v2_4_2_RC2'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 30aa3ca... New tag 2.4.2-rc2

[mockbuild@buildhost lustre-release]$ git log
commit 30aa3cadaab6d58cd37d8e33e1ab8e8f98b4859d
Author: Oleg Drokin <[email protected]>
Date:   Fri Dec 20 12:10:16 2013 +0900

	New tag 2.4.2-rc2

	Change-Id: Ie8a11ab58c0e77b7cb5d4c479ceb6fdaa7987c2d

Autogen

[mockbuild@buildhost lustre-release]$ sh ./autogen.sh 
Checking for a complete tree...
Running aclocal -I /home/mockbuild/lustre-release/config  -I /home/mockbuild/lustre-release/libcfs/autoconf -I /home/mockbuild/lustre-release/lnet/autoconf -I /home/mockbuild/lustre-release/lustre/autoconf -I /home/mockbuild/lustre-release/snmp/autoconfconfigure.ac:27: warning: AC_CONFIG_SUBDIRS: you should use literals
../../lib/autoconf/status.m4:1097: AC_CONFIG_SUBDIRS is expanded from...
/home/mockbuild/lustre-release/config/lustre-build-ldiskfs.m4:31: LB_PATH_LDISKFS is expanded from...
/home/mockbuild/lustre-release/config/lustre-build.m4:596: LB_CONFIGURE is expanded from...
configure.ac:27: the top level
...
Makefile.am: installing './INSTALL'
Makefile.am: installing './COPYING' using GNU General Public License v3 file
Makefile.am:     Consider adding the COPYING file to the version control system
Makefile.am:     for your code, to avoid questions about which license your project uses
Running autoconf...
Finished.  Ready for ./configure ...

Running autogen for ldiskfs...
Running sh autogen.sh+ aclocal -I /home/mockbuild/lustre-release/ldiskfs/config
+ autoheader
+ automake -a -c -W no-portability
configure.ac:17: installing 'config/compile'
configure.ac:12: installing 'config/config.guess'
configure.ac:12: installing 'config/config.sub'
configure.ac:14: installing 'config/install-sh'
configure.ac:14: installing 'config/missing'
+ autoconf

Configure

[mockbuild@buildhost lustre-release]$ ./configure --disable-server --disable-tests
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '507569' is supported by ustar format... yes
checking whether GID '50' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for gcc... gcc
...
configure: creating ./config.status
config.status: creating lustre-iokit.spec
config.status: creating Makefile
config.status: creating sgpdd-survey/Makefile
config.status: creating obdfilter-survey/Makefile
config.status: creating ost-survey/Makefile
config.status: creating ior-survey/Makefile
config.status: creating mds-survey/Makefile
config.status: creating stats-collect/Makefile

CC:            gcc
LD:            ld
CPPFLAGS:      -include /home/mockbuild/lustre-release/config.h -I/home/mockbuild/lustre-release/libcfs/include -I/home/mockbuild/lustre-release/lnet/include -I/home/mockbuild/lustre-release/lustre/include 
LLCPPFLAGS:    -D__arch_lib__ -D_LARGEFILE64_SOURCE=1
CFLAGS:        -g -O2 -Werror
EXTRA_KCFLAGS: -include /home/mockbuild/lustre-release/config.h  -g -I/home/mockbuild/lustre-release/libcfs/include -I/home/mockbuild/lustre-release/lnet/include -I/home/mockbuild/lustre-release/lustre/include
LLCFLAGS:      -g -Wall -fPIC -D_GNU_SOURCE

Type 'make' to build Lustre.

Make

[mockbuild@buildhost lustre-release]$  make
make  all-recursive
make[1]: Entering directory `/home/mockbuild/lustre-release'
Making all in .
make[2]: Entering directory `/home/mockbuild/lustre-release'
for dir in libcfs lnet lustre ; do \
		make sources -C $dir || exit $? ; \
	done
make[3]: Entering directory `/home/mockbuild/lustre-release/libcfs'
make sources -C libcfs
make[4]: Entering directory `/home/mockbuild/lustre-release/libcfs/libcfs'
make[4]: Nothing to be done for `sources'.
make[4]: Leaving directory `/home/mockbuild/lustre-release/libcfs/libcfs'
make[3]: Leaving directory `/home/mockbuild/lustre-release/libcfs'
make[3]: Entering directory `/home/mockbuild/lustre-release/lnet'
make[3]: Nothing to be done for `sources'.
make[3]: Leaving directory `/home/mockbuild/lustre-release/lnet'
make[3]: Entering directory `/home/mockbuild/lustre-release/lustre'
make sources -C lvfs
make[4]: Entering directory `/home/mockbuild/lustre-release/lustre/lvfs'
make[4]: Nothing to be done for `sources'.
make[4]: Leaving directory `/home/mockbuild/lustre-release/lustre/lvfs'
make sources -C obdclass
make[4]: Entering directory `/home/mockbuild/lustre-release/lustre/obdclass'
make[4]: Nothing to be done for `sources'.
make[4]: Leaving directory `/home/mockbuild/lustre-release/lustre/obdclass'
perl ../lustre/scripts/version_tag.pl .. .. > tmpver
echo "#define LUSTRE_RELEASE 2.6.32_358.6.2.el6.x86_64_" >> tmpver
cmp -s ../lustre/include/lustre/lustre_build_version.h tmpver > tmpdiff 2> /dev/null &&		\
				rm -f tmpver tmpdiff ||					\
		mv -f tmpver ../lustre/include/lustre/lustre_build_version.h
make[3]: Leaving directory `/home/mockbuild/lustre-release/lustre'
make CC="gcc"  -C /lib/modules/2.6.32-358.6.2.el6.x86_64/build	     \
...
Making all in tests
make[4]: Entering directory `/home/mockbuild/lustre-release/lustre/liblustre/tests'
make[5]: Entering directory `/home/mockbuild/lustre-release/lustre/liblustre/tests'
gcc -DHAVE_CONFIG_H -I. -I../../..  -I/home/mockbuild/lustre-release/libsysio/include -I/opt/lam/include -D__arch_lib__ -D_LARGEFILE64_SOURCE=1 -I../../../lnet/ulnds -include /home/mockbuild/lustre-release/config.h -I/home/mockbuild/lustre-release/libcfs/include -I/home/mockbuild/lustre-release/lnet/include -I/home/mockbuild/lustre-release/lustre/include  -g -Wall -fPIC -D_GNU_SOURCE -g -O2 -Werror -MT test_common.o -MD -MP -MF .deps/test_common.Tpo -c -o test_common.o test_common.c
mv -f .deps/test_common.Tpo .deps/test_common.Po
rm -f libtestcommon.a
ar cru libtestcommon.a test_common.o 
ranlib libtestcommon.a
make[5]: Leaving directory `/home/mockbuild/lustre-release/lustre/liblustre/tests'
make[4]: Leaving directory `/home/mockbuild/lustre-release/lustre/liblustre/tests'
make[3]: Leaving directory `/home/mockbuild/lustre-release/lustre/liblustre'
make[3]: Entering directory `/home/mockbuild/lustre-release/lustre'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/home/mockbuild/lustre-release/lustre'
make[2]: Leaving directory `/home/mockbuild/lustre-release/lustre'
make[1]: Leaving directory `/home/mockbuild/lustre-release'

Make RPM's

[mockbuild@buildhost lustre-release]$ make rpms
Making rpms in lustre-iokit
make[1]: Entering directory `/home/mockbuild/lustre-release/lustre-iokit'
make  dist-gzip am__post_remove_distdir='@:'
make[2]: Entering directory `/home/mockbuild/lustre-release/lustre-iokit'
if test -d "lustre-iokit-1.4.0"; then find "lustre-iokit-1.4.0" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "lustre-iokit-1.4.0" || { sleep 5 && rm -rf "lustre-iokit-1.4.0"; }; else :; fi
test -d "lustre-iokit-1.4.0" || mkdir "lustre-iokit-1.4.0"
 (cd obdfilter-survey && make  top_distdir=../lustre-iokit-1.4.0 distdir=../lustre-iokit-1.4.0/obdfilter-survey \
	 am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
...
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/mockbuild/rpmbuild/BUILDROOT/lustre-client-2.4.2-2.6.32_358.6.2.el6.x86_64.x86_64
Wrote: /home/mockbuild/rpmbuild/SRPMS/lustre-client-2.4.2-2.6.32_358.6.2.el6.x86_64.src.rpm
Wrote: /home/mockbuild/rpmbuild/RPMS/x86_64/lustre-client-2.4.2-2.6.32_358.6.2.el6.x86_64.x86_64.rpm
Wrote: /home/mockbuild/rpmbuild/RPMS/x86_64/lustre-client-modules-2.4.2-2.6.32_358.6.2.el6.x86_64.x86_64.rpm
Wrote: /home/mockbuild/rpmbuild/RPMS/x86_64/lustre-client-source-2.4.2-2.6.32_358.6.2.el6.x86_64.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.W8YGiN
+ umask 022
+ cd /home/mockbuild/rpmbuild/BUILD
+ cd lustre-2.4.2
+ rm -rf /home/mockbuild/rpmbuild/BUILDROOT/lustre-client-2.4.2-2.6.32_358.6.2.el6.x86_64.x86_64
+ exit 0
make[1]: Leaving directory `/home/mockbuild/lustre-release'

Repeat for each cluster/node with different kernel

@saswat108
Copy link

lustre-2.7.59
git head: 65ca59d34d152accc9740481b70f8b636f766a8d

make rpms fails when "--disable-tests" flag is passed.
Probably due to this commit: b77a954c48a3f1357255f9273a27db777ed7f91f

Without this flag, the compilation passes.

@romesh-17
Copy link

Configure could fail with error "YAML development libraries not not installed". Recommended to install libyaml-devel package using "yum install libyaml-devel"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment