[ofa-general] RE: [opensm] bugs in build system

Eitan Zahavi eitan at mellanox.co.il
Tue Sep 4 23:37:14 PDT 2007


Hi Sasha,

Patch tested. Works great.

Thanks

Eitan

> -----Original Message-----
> From: Sasha Khapyorsky [mailto:sashak at voltaire.com] 
> Sent: Tuesday, September 04, 2007 11:36 PM
> To: Eitan Zahavi
> Cc: openib-general at openib.org
> Subject: Re: [opensm] bugs in build system
> 
> Hi again, Eitan,
> 
> On 17:02 Sun 02 Sep     , Eitan Zahavi wrote:
> > Hi Sasha,
> > 
> > For some reason OpenSM (and the required management libs) 
> do not build 
> > correctly when I use manual autogen.sh, configure 
> --prefix=/tmp/ez/usr 
> > ; make; make install mode.
> > 
> > It seems the build system is probably broken as it relies on fixed 
> > paths?
> 
> It is not, but it relies to invalid paths like 
> -I.../include/infiniband when in the code '#include 
> <infiniband/file.h>' is used.
> 
> > OK 3. cd management/libibumad; autogen.sh; FAIL 4. ./configure 
> > --prefix=/tmp/ez/usr checking for sys_read_string in 
> -libcommon... no
> > configure: error: sys_read_string() not found. libibumad requires 
> > libibcommon.
> >
> > To overcome this I manually added the --disable-libcheck 
> ./configure 
> > --prefix=/tmp/ez/usr --disable-libcheck I do not understand 
> why after 
> > installing the common lib I still get this error?
> > Isn't the search path should include the <prefix>/lib ???
> 
> Seems it is AC_CHECK_LIB() feature (ugh - I hate autotools mess :))
> 
> I'm not really sure such checks should be there. libibcommon 
> library is part of our project and not "external" library.
> 
> > FAIL 5. make
> > Make fails as it does not find the infiniband/common.h
> 
> Wrong include path in Makefile.am - it uses include/infiniband.
> 
> > To overcome this I manually added -I<prefix>/include ....
> > make CFLAGS="-I/tmp/ez/usr/include" 
> > 
> > OK 6. make install
> > --------------- OPENSM ------------------ OK 7. cd 
> management/opensm; 
> > autogen.sh; FAIL 8. configure --prefix=/tmp/ez/usr checking for 
> > umad_init in -libumad... no
> > configure: error: umad_init() not found. libosmvendor of 
> type openib 
> > requires libibumad.
> > configure: error: /bin/sh './configure' failed for libvendor
> > 
> > To overcome this I manually added the --disable-libcheck 
> ./configure 
> > --prefix=/tmp/ez/usr --disable-libcheck This problem is same as the 
> > above: lib path for linking should use the <prefix>/lib.
> > 
> > FAIL 9. make
> > Here again the include path is missing the <prefix>/include:
> > 
> > ./../include/vendor/osm_vendor_ibumad.h:44:31: 
> infiniband/common.h: No 
> > such file or directory
> > ./../include/vendor/osm_vendor_ibumad.h:45:29: 
> infiniband/umad.h: No 
> > such file or directory
> 
> Wrong OSMV_INCLUDES definition (it uses paths include/infiniband ).
> 
> > To overcome this I manually added -I<prefix>/include ....
> > make CFLAGS="-I/tmp/ez/usr/include" 
> > 
> > But this is not enough as the linker fail:
> > /usr/bin/ld: cannot find -libumad
> 
> It seems to be buggy opensm_LDADD in Makefile.am
> 
> > To overcome this I had to add -L<prefix>/lib ....
> > make CFLAGS="-I/tmp/ez/usr/include" LDFLAGS="-L/tmp/ez/usr/lib 
> > -libumad -libcommon"
> > 
> > OK 10. make install
> > 
> > I hope the above issues could be fixed such that the installation 
> > would be simpler.
> 
> Could you test the patch please (you still need to use 
> '--disable-libcheck' with ./configure)? Thanks.
> 
> Sasha
> 
> 
> diff --git a/libibumad/Makefile.am b/libibumad/Makefile.am 
> index 48868e7..7e82590 100644
> --- a/libibumad/Makefile.am
> +++ b/libibumad/Makefile.am
> @@ -2,7 +2,7 @@
>  SUBDIRS = .
>  
>  INCLUDES = -I$(srcdir)/include/infiniband \
> -	   -I$(srcdir)/../libibcommon/include/infiniband
> +	   -I$(srcdir)/../libibcommon/include
>  
>  man_MANS = man/umad_debug.3 man/umad_get_ca.3 \
>  	   man/umad_get_ca_portguids.3 man/umad_get_cas_names.3 
> \ diff --git a/opensm/config/osmvsel.m4 
> b/opensm/config/osmvsel.m4 index 47ad36f..97d5a9e 100644
> --- a/opensm/config/osmvsel.m4
> +++ b/opensm/config/osmvsel.m4
> @@ -61,11 +61,11 @@ with_sim="/usr")
>  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_umad_libs" = "x"; then
> -     OSMV_LDADD="-libumad"
> -   else
> -     OSMV_LDADD="-L$with_umad_libs -libumad"
> +   OSMV_INCLUDES="-I\$(srcdir)/../include 
> -I\$(srcdir)/../../libibcommon/include 
> -I\$(srcdir)/../../libibumad/include"
> +   OSMV_LDADD="-L\$(libdir) -libumad -libcommon"
> +
> +   if test "x$with_umad_libs" != "x"; then
> +     OSMV_LDADD="-L$with_umad_libs $OSMV_LDADD"
>     fi
>  
>     if test "x$with_umad_includes" != "x"; then 
> 



More information about the general mailing list