Hi,

One needs to apply patches from LU-7042 and LU-8241. Here is untested patch for the b2_5 branch.

BR,
Tommi

On 09/20/2016 07:49 PM, Lydia Heck wrote:

Dear list members,

I am trying to configure lustre 2.5.41 to build. My OS is CentOS 6.8
with Kernel level 2.6.32-642 and I am trying to build for with Mellanox
(OFED) support.

the configuration fails with

configure: error: can't compile with kernel OpenIB gen2 headers

The actual problem is

In file included from /usr/src/ofa_kernel/default/include/linux/kernel.h:4,
                 from
/root/lustre-2.5.41.ddn12.g116c1ce/build/conftest.c:74:
include/linux/kernel.h:441:1: warning: "printk_once" redefined
In file included from include/linux/kernel.h:18,
                 from /usr/src/ofa_kernel/default/include/linux/kernel.h:4,
                 from
/root/lustre-2.5.41.ddn12.g116c1ce/build/conftest.c:74:
/usr/src/ofa_kernel/default/include/linux/printk.h:58:1: warning: this
is the location of the previous definition
In file included from /usr/src/ofa_kernel/default/include/linux/kernel.h:4,
                 from
/root/lustre-2.5.41.ddn12.g116c1ce/build/conftest.c:74:
include/linux/kernel.h:670:1: warning: "printk_ratelimited" redefined
In file included from include/linux/kernel.h:18,
                 from /usr/src/ofa_kernel/default/include/linux/kernel.h:4,
                 from
/root/lustre-2.5.41.ddn12.g116c1ce/build/conftest.c:74:
/usr/src/ofa_kernel/default/include/linux/printk.h:42:1: warning: this
is the location of the previous definition
In file included from
/lib/modules/2.6.32-642.el6.x86_64/source/arch/x86/include/asm/local.h:4,
                 from include/linux/module.h:20,
                 from /usr/src/ofa_kernel/default/include/linux/module.h:4,
                 from
/usr/src/ofa_kernel/default/include/linux/compat-2.6.h:22,
                 from
/root/lustre-2.5.41.ddn12.g116c1ce/build/conftest.c:83:
include/linux/percpu.h:713: error: ‘printk_func_t’ undeclared here (not
in a function)
include/linux/percpu.h:713: warning: type defaults to ‘int’ in
declaration of ‘per_cpu__printk_func’
make[1]: *** [/root/lustre-2.5.41.ddn12.g116c1ce/build/conftest.o] Error 1
make: *** [_module_/root/lustre-2.5.41.ddn12.g116c1ce/build] Error

I drawled the web and found that there seems to be a difference from
kernel level 2.6.32-642 (CentOS 6.8) and level  2.6.32-573 which
prevents the config part to complete. However what I have not found is a
solution for this problem.

Any idea?

Best wishes,
Lydia



_______________________________________________
lustre-discuss mailing list
lustre-discuss@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org


diff --git a/.gitignore b/.gitignore
index 93046e9..fea4154 100644
--- a/.gitignore
+++ b/.gitignore
@@ -69,6 +69,7 @@ TAGS
 /config.cache
 /config.h
 /config.h.in
+/undef.h
 /INSTALL
 /libtool
 /lustre.spec
diff --git a/autoMakefile.am b/autoMakefile.am
index d3ae280..9c03b11 100644
--- a/autoMakefile.am
+++ b/autoMakefile.am
@@ -69,7 +69,7 @@ all-sources: module-symvers
 if LINUX
 all-am: modules
 
-modules: $(DEP) all-sources
+modules: undef.h $(DEP) all-sources
 	$(MAKE) CC="$(CC)" $(CROSS_VARS) -C $(LINUX_OBJ)	     \
 	-f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
 	LINUXINCLUDE='-I$$(srctree)/arch/$$(SRCARCH)/include -I$$(srctree)/arch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -I$$(srctree)/arch/$$(SRCARCH)/include/uapi -Iarch/$$(SRCARCH)/include/generated/uapi -I$$(srctree)/include/uapi -Iinclude/generated/uapi -include $(CONFIG_INCLUDE)' \
@@ -79,7 +79,10 @@ endif # LINUX
 
 endif # MODULES
 
-dist-hook:
+undef.h: config.h.in
+	grep -v config.h.in config.h.in > $@
+
+dist-hook: undef.h
 	find $(distdir) -name .deps -o \
 			-name CVS -o \
 			-name .svn -o \
@@ -92,7 +95,9 @@ dist-hook:
 EXTRA_DIST = @PACKAGE_TARNAME@.spec	\
 	build/Makefile 			\
 	build/Rules.in			\
-	build/gen_filelist.sh
+	build/gen_filelist.sh		\
+	config.h.in			\
+	undef.h
 
 rpms: @PACKAGE_TARNAME@.spec dist Makefile
 	@CONFIGURE_ARGS=""; \
@@ -172,7 +177,7 @@ srpm: @PACKAGE_TARNAME@.spec dist Makefile
 # However, one cannot really run "make debs" without having done a
 # configure first, so we could use the easier method of digging the
 # version out of the config.h file.
-debs:
+debs: undef.h
 	lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
 	cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
 	if [ "$$lversion" != "$$cversion" ]; then \
@@ -205,7 +210,7 @@ debs:
 	mkdir -p debs && \
 	mv ../liblustre_$${VER}_*.deb ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes ../lustre_$${VER%-[0-9]*}.orig.tar.gz ../lustre_$${VER}.diff.gz ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
 
-EXTRA_DIST += config.h.in
+# EXTRA_DIST += config.h.in
 
 if USES_DPKG
 EXTRA_DIST += debian/*
diff --git a/config/.gitignore b/config/.gitignore
index 01131af..e9653c4 100644
--- a/config/.gitignore
+++ b/config/.gitignore
@@ -1,4 +1,5 @@
 /Makefile.in
+/compile
 /config.guess
 /config.sub
 /depcomp
diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4
index f12ca8a..e27a7ae 100644
--- a/config/lustre-build-linux.m4
+++ b/config/lustre-build-linux.m4
@@ -381,7 +381,7 @@ AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
 rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
 SUBARCH=$(echo $target_cpu | sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/' -e 's/k1om/x86/')
-AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_OFED_INCLUDE -I$LINUX/arch/$SUBARCH/include -I$LINUX/arch/$SUBARCH/include/generated -Iinclude -I$LINUX/include -Iinclude2 -I$LINUX/include/uapi -I$LINUX/include/generated -I$LINUX/arch/$SUBARCH/include/uapi -Iarch/$SUBARCH/include/generated/uapi -I$LINUX/include/uapi -Iinclude/generated/uapi ${SPL_OBJ:+-include $SPL_OBJ/spl_config.h} ${ZFS_OBJ:+-include $ZFS_OBJ/zfs_config.h} ${SPL:+-I$SPL -I$SPL/include } ${ZFS:+-I$ZFS -I$ZFS/include} -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $CROSS_VARS $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
+AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_CHECK_INCLUDE -I$LINUX/arch/$SUBARCH/include -I$LINUX/arch/$SUBARCH/include/generated -Iinclude -I$LINUX/include -Iinclude2 -I$LINUX/include/uapi -I$LINUX/include/generated -I$LINUX/arch/$SUBARCH/include/uapi -Iarch/$SUBARCH/include/generated/uapi -I$LINUX/include/uapi -Iinclude/generated/uapi ${SPL_OBJ:+-include $SPL_OBJ/spl_config.h} ${ZFS_OBJ:+-include $ZFS_OBJ/zfs_config.h} ${SPL:+-I$SPL -I$SPL/include } ${ZFS:+-I$ZFS -I$ZFS/include} -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $CROSS_VARS $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
 	[$4],
 	[_AC_MSG_LOG_CONFTEST
 m4_ifvaln([$5],[$5])dnl])
diff --git a/config/lustre-build.m4 b/config/lustre-build.m4
index 83395e1..63572e1 100644
--- a/config/lustre-build.m4
+++ b/config/lustre-build.m4
@@ -425,8 +425,8 @@ AC_SUBST(ENABLE_INIT_SCRIPTS)
 #
 AC_DEFUN([LB_CONFIG_HEADERS],[
 	AC_CONFIG_HEADERS([config.h])
-	CPPFLAGS="-include $PWD/config.h $CPPFLAGS"
-	EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
+	CPPFLAGS="-include $PWD/undef.h -include $PWD/config.h $CPPFLAGS"
+	EXTRA_KCFLAGS="-include $PWD/undef.h -include $PWD/config.h $EXTRA_KCFLAGS"
 	AC_SUBST(EXTRA_KCFLAGS)
 ])
 
diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
index a7f0935..bfe92e4 100644
--- a/lnet/autoconf/lustre-lnet.m4
+++ b/lnet/autoconf/lustre-lnet.m4
@@ -411,6 +411,7 @@ else
 			compatrdma_found=true
 			AC_MSG_RESULT([yes])
 			AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
+			EXTRA_OFED_CONFIG="$EXTRA_OFED_CONFIG -include ${O2IBPATH}/include/linux/compat-2.6.h"
 		else
 			AC_MSG_RESULT([no])
 		fi
@@ -448,12 +449,18 @@ else
 		AC_MSG_CHECKING([whether to enable OpenIB gen2 support])
 		O2IBPATH=$(readlink --canonicalize $O2IBPATH)
 		EXTRA_OFED_INCLUDE="$EXTRA_OFED_INCLUDE -I$O2IBPATH/include"
+		EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
 
 		LB_LINUX_TRY_COMPILE([
 		        #include <linux/version.h>
 		        #include <linux/pci.h>
 			#include <linux/gfp.h>
 			#ifdef HAVE_COMPAT_RDMA
+			#undef PACKAGE_NAME
+			#undef PACKAGE_TARNAME
+			#undef PACKAGE_VERSION
+			#undef PACKAGE_STRING
+			#undef PACKAGE_BUGREPORT
 			#include <linux/compat-2.6.h>
 			#endif
 		        #include <rdma/rdma_cm.h>
@@ -508,17 +515,25 @@ else
 		fi
 
 		LN_CONFIG_OFED_SPEC
+	EXTRA_CHECK_INCLUDE=""
 	fi
 fi
 
+AC_SUBST(EXTRA_OFED_CONFIG)
 AC_SUBST(EXTRA_OFED_INCLUDE)
 AC_SUBST(O2IBLND)
 
 # In RHEL 6.2, rdma_create_id() takes the queue-pair type as a fourth argument
 if test $ENABLEO2IB -ne 0; then
+	EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
 	AC_MSG_CHECKING([if rdma_create_id wants four args])
 	LB_LINUX_TRY_COMPILE([
 		#ifdef HAVE_COMPAT_RDMA
+                #undef PACKAGE_NAME
+                #undef PACKAGE_TARNAME
+                #undef PACKAGE_VERSION
+                #undef PACKAGE_STRING
+                #undef PACKAGE_BUGREPORT
 		#include <linux/compat-2.6.h>
 		#endif
 		#include <rdma/rdma_cm.h>
@@ -531,6 +546,7 @@ if test $ENABLEO2IB -ne 0; then
 	],[
 		AC_MSG_RESULT([no])
 	])
+	EXTRA_CHECK_INCLUDE=""
 fi
 ])
 
@@ -714,6 +730,7 @@ LN_FUNC_DEV_GET_BY_NAME_2ARG
 LN_CONFIG_AFFINITY
 LN_CONFIG_BACKOFF
 LN_CONFIG_QUADRICS
+EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE"
 LN_CONFIG_O2IB
 LN_CONFIG_RALND
 LN_CONFIG_GNILND
@@ -723,6 +740,7 @@ LN_CONFIG_MX
 LN_5ARGS_SYSCTL_PROC_HANDLER
 # 2.6.36
 LN_CONFIG_TCP_SENDPAGE
+EXTRA_CHECK_INCLUDE=""
 ])
 
 #
diff --git a/lnet/klnds/o2iblnd/Makefile.in b/lnet/klnds/o2iblnd/Makefile.in
index 31c3821..34b82fe 100644
--- a/lnet/klnds/o2iblnd/Makefile.in
+++ b/lnet/klnds/o2iblnd/Makefile.in
@@ -3,6 +3,6 @@ ko2iblnd-objs := o2iblnd.o o2iblnd_cb.o o2iblnd_modparams.o
 
 # Need to make sure that an external OFED source pool overrides
 # any in-kernel OFED sources
-NOSTDINC_FLAGS += @EXTRA_OFED_INCLUDE@
+NOSTDINC_FLAGS += @EXTRA_OFED_CONFIG@ @EXTRA_OFED_INCLUDE@
 
 @INCLUDE_RULES@
diff --git a/lnet/lnet/Makefile.in b/lnet/lnet/Makefile.in
index 8187b17..3ec02df 100644
--- a/lnet/lnet/Makefile.in
+++ b/lnet/lnet/Makefile.in
@@ -6,5 +6,6 @@ lnet-objs += lib-move.o module.o lo.o
 lnet-objs += router.o router_proc.o acceptor.o peer.o
 
 default: all
+STDINC_FLAGS += @EXTRA_OFED_CONFIG@ @EXTRA_OFED_INCLUDE@
 
 @INCLUDE_RULES@
_______________________________________________
lustre-discuss mailing list
lustre-discuss@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org

Reply via email to