David Vasil
2006-May-19 07:36 UTC
[Lustre-discuss] l_getgroups.c missing liblustre.h include
Under RHEL4 using the latest lustre kernel source RPM kernel-source-2.6.9-5.0.5.EL_lustre.1.4.5.x86_64.rpm, I recompiled the kernel and was able to boot from it. However, when compiling the lustre modules and utilities for version 1.4.5, the compile fails with l_getgroups.c. Symlinking /usr/src/linux to the kernel source directory, I used --with-linux=/usr/src/linux as my only configure option. After that, I attempted a make which fails at the above-mentioned l_getgroups.c with the following error: In file included from ../../lustre/include/lustre/lustre_user.h:19, from l_getgroups.c:35: /usr/include/linux/quota.h:4:2: warning: #warning Including kernel-private quota.h instead of <sys/quota.h> l_getgroups.c: In function `get_groups_local'': l_getgroups.c:82: warning: implicit declaration of function `offsetof'' l_getgroups.c:82: error: syntax error before "struct" make[5]: *** [l_getgroups.o] Error 1 make[4]: *** [all-recursive] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all] Error 2 From looking at l_getgroups.c, it does not know where to get offsetof from, however wiretest.c compiles correctly and uses offsetof quite a bit. Adding in an #include <liblustre.h> to the top of l_getgroups.c allows the compile to complete successfully. Am I the only one who has run into this? Am I missing some header files somewhere else? According to the wiki I have the prerequisite devel packages installed. Thanks! -- | David Vasil <dmvasil@ornl.gov> | Oak Ridge National Laboratory NCCS Division | High Performance Computing Systems Administrator | Bldg: 5600-A115 Phone: (865)241-5562
Andreas Dilger
2006-May-19 07:36 UTC
[Lustre-discuss] l_getgroups.c missing liblustre.h include
On Jan 05, 2006 11:04 -0500, David Vasil wrote:> Under RHEL4 using the latest lustre kernel source RPM > kernel-source-2.6.9-5.0.5.EL_lustre.1.4.5.x86_64.rpm, I recompiled the > kernel and was able to boot from it. However, when compiling the lustre > modules and utilities for version 1.4.5, the compile fails with > l_getgroups.c. > > Symlinking /usr/src/linux to the kernel source directory, I used > --with-linux=/usr/src/linux as my only configure option. After that, I > attempted a make which fails at the above-mentioned l_getgroups.c with > the following error: > > In file included from ../../lustre/include/lustre/lustre_user.h:19, > from l_getgroups.c:35: > /usr/include/linux/quota.h:4:2: warning: #warning Including > kernel-private quota.h instead of <sys/quota.h> > l_getgroups.c: In function `get_groups_local'': > l_getgroups.c:82: warning: implicit declaration of function `offsetof'' > l_getgroups.c:82: error: syntax error before "struct" > make[5]: *** [l_getgroups.o] Error 1 > make[4]: *** [all-recursive] Error 1 > make[3]: *** [all-recursive] Error 1 > make[2]: *** [all-recursive] Error 1 > make[1]: *** [all] Error 2I''m not sure why we didn''t hit this problem in our release testing (where we have compiled that code hundreds of times). It may relate to the system headers or something, I''m not sure. The easy fix is to define offsetof() conditionally (which is what will be in the next release): diff -u -p -r1.1.8.5.10.14 -r1.1.8.5.10.16.6.4 --- lustre/include/lustre/lustre_user.h 10 Aug 2005 19:35:28 -0000 1.1.8.5.10.14 +++ lustre/include/lustre/lustre_user.h 13 Dec 2005 10:31:54 -0000 1.1.8.5.10.16.6.4 @@ -254,5 +296,9 @@ struct if_quotactl { # define LPSSZ "%ld" #endif #endif /* !LPU64 */ + +#ifndef offsetof +# define offsetof(typ,memb) ((unsigned long)((char *)&(((typ *)0)->memb))) +#endif #endif /* _LUSTRE_USER_H */ Cheers, Andreas -- Andreas Dilger Principal Software Engineer Cluster File Systems, Inc.