[openib-general] [PATCH] Opensm - support arbitrary paths for driver installation

Yael Kalka yael at mellanox.co.il
Wed Dec 14 02:41:42 PST 2005


Hi Hal,

Currently, if the user level driver installation is not in /usr/local/
dir - configure of opensm failes.
The following patch enables support for arbitrary paths of user level
driver installation. Path can be given using --with-uldrv flag.

Thanks,
Yael

Signed-off-by:  Yael Kalka <yael at mellanox.co.il>

Index: osmtest/Makefile.am
===================================================================
--- osmtest/Makefile.am	(revision 4412)
+++ osmtest/Makefile.am	(working copy)
@@ -5,10 +5,7 @@ else
 DBGFLAGS = -g -O2
 endif
 
-INCLUDES = -I$(srcdir)/include \
-	   -I$(srcdir)/../include \
-	   -I$(srcdir)/../../libibcommon/include/infiniband \
-	   -I$(srcdir)/../../libibumad/include/infiniband
+INCLUDES = -I$(srcdir)/include $(OSMV_INCLUDES)
 
 bin_PROGRAMS = osmtest 
 osmtest_SOURCES = main.c osmtest.c osmt_service.c osmt_slvl_vl_arb.c \
Index: opensm/Makefile.am
===================================================================
--- opensm/Makefile.am	(revision 4412)
+++ opensm/Makefile.am	(working copy)
@@ -1,7 +1,5 @@
 
-INCLUDES = -I$(srcdir)/../include \
-	   -I$(srcdir)/../../libibcommon/include/infiniband \
-	   -I$(srcdir)/../../libibumad/include/infiniband
+INCLUDES = $(OSMV_INCLUDES)
 
 lib_LTLIBRARIES = libopensm.la
 
Index: config/osmvsel.m4
===================================================================
--- config/osmvsel.m4	(revision 4412)
+++ config/osmvsel.m4	(working copy)
@@ -13,21 +13,39 @@ AC_DEFUN([OPENIB_APP_OSMV_SEL], [
 
 dnl Define a way for the user to provide the osm vendor type
 AC_ARG_WITH(osmv,
-[  --with-osmv=<dir> define the osm vendor type],
+[  --with-osmv=<type> define the osm vendor type to build],
 AC_MSG_NOTICE(Using OSM Vendor Type:$with_osmv),
 with_osmv="openib")
 
+dnl Define a way for the user to provide the path to the driver installation
+AC_ARG_WITH(uldrv,
+[  --with-uldrv=<dir> define the dir where the user level driver is installed],
+AC_MSG_NOTICE(Using user level installation prefix:$with_uldrv),
+with_uldrv="")
+
 dnl Define a way for the user to provide the path to the simulator installation
 AC_ARG_WITH(sim,
 [  --with-sim=<dir> define the simulator prefix for building sim vendor (/usr)],
 AC_MSG_NOTICE(Using Simulator from:$with_sim),
 with_sim="/usr")
 
+dnl Should we use lib64 or lib
+if test "$(uname -m)" = "x86_64"; then
+   osmv_lib_type="lib64"
+else
+   osmv_lib_type="lib"	
+fi
+
 dnl based on the with_osmv we can try the vendor flag
 if test $with_osmv = "openib"; then
    OSMV_CFLAGS="-DOSM_VENDOR_INTF_OPENIB"
    OSMV_INCLUDES="-I\$(srcdir)/../include -I\$(srcdir)/../../libibcommon/include/infiniband -I\$(srcdir)/../../libibumad/include/infiniband"
+   if test "x$with_uldrv" = "x"; then
    OSMV_LDADD="-libumad"
+   else
+     OSMV_INCLUDES="-I$with_uldrv/include $OSMV_INCLUDES"
+     OSMV_LDADD="-L$with_uldrv/$osmv_lib_type -libumad"
+   fi
 elif test $with_osmv = "sim" ; then
    OSMV_CFLAGS="-DOSM_VENDOR_INTF_SIM"
    OSMV_INCLUDES="-I$with_sim/include -I\$(srcdir)/../include"
@@ -90,8 +108,11 @@ if test "$disable_libcheck" != "yes"; th
 
  dnl based on the with_osmv we can try the vendor flag
  if test $with_osmv = "openib"; then
+   osmv_save_ldflags=$LDFALGS
+   LDFLAGS="$LDFLAGS $OSMV_LDADD"
    AC_CHECK_LIB(ibumad, umad_init, [],
 	 AC_MSG_ERROR([umad_init() not found. libosmvendor of type openib requires libibumad.]))
+   LD_FLAGS=$osmv_save_ldflags
  elif test $with_osmv = "sim" ; then
    LDFLAGS="$LDFLAGS -L$with_sim/lib"
    AC_CHECK_FILE([$with_sim/lib/libibmscli.a], [], 




More information about the general mailing list