[BuildTools-tickets] [BuildTools] #64: improve capability to use precompiled MUMPS library

BuildTools coin-trac at coin-or.org
Tue Apr 29 11:37:37 EDT 2008


#64: improve capability to use precompiled MUMPS library
------------------------+---------------------------------------------------
Reporter:  stefan       |        Owner:  andreasw           
    Type:  enhancement  |       Status:  assigned           
Priority:  major        |    Component:  configuration tests
 Version:  0.5          |   Resolution:                     
Keywords:               |  
------------------------+---------------------------------------------------
Comment (by stefan):

 OK,

 here is a modified {{{AC_COIN_HAS_MUMPS}}} function. It should define the
 same symbols,variables,conditionals,... as before, so there is no change
 in a configure.ac required.

 For the user, the difference is that instead of {{{--mumps-dir}}}, he now
 has to specify the exact linking flags. Further, only one include dir is
 allowed, so the user will need to copy the mpi and mumps/pord header files
 in the same directory. The gain is a higher flexibility on the linking
 flags, e.g., I was now able to build Ipopt with gcc on machine without
 Fortran90 compiler using a MUMPS library that was build with an Intel
 compiler on a different machine.

 {{{
 AC_DEFUN([AC_COIN_HAS_MUMPS],
 [
 if test "$PACKAGE_NAME" = ThirdPartyMumps; then
   coin_mumpsobjdir=../Mumps
 else
   coin_mumpsobjdir=../ThirdParty/Mumps
 fi
 coin_mumpssrcdir=$abs_source_dir/$coin_mumpsobjdir/MUMPS

 MAKEOKFILE=.MakeOk

 #check if user provides a MUMPS library (that works)
 AC_LANG_PUSH(C)
 AC_COIN_HAS_USER_LIBRARY(mumps, MUMPS, dmumps_c.h, dmumps_c)
 AC_LANG_POP(C)

 if test "$coin_has_mumps" = "true"; then  # user provided mumps library
   use_mumps=yes
   coin_has_mumps=yes

   MUMPS_INCFLAGS="-I\`\$(CYGPATH_W) $MUMPSINCDIR\`"
   ADDLIBS="$MUMPSLIB $ADDLIBS"

 else # no user provided library, so we try to build our own
   use_mumps=BUILD

   # Check if the MUMPS' ThirdParty project has been configured
   if test "$PACKAGE_NAME" != ThirdPartyMumps; then
     if test -r $coin_mumpsobjdir/.MakeOk; then
       use_mumps=BUILD
       # Mumps needs pthreads
       AC_LANG_PUSH(C)
       save_LIBS="$LIBS"
       LIBS="$LIBS $FLIBS"
       AC_CHECK_LIB([pthread],[pthread_create],[LIBS="-lpthread
 $save_LIBS"; ADDLIBS="-lpthread $ADDLIBS"],[LIBS="save_LIBS"])
       AC_LANG_POP(C)

       MUMPS_INCFLAGS="-I\`\$(CYGPATH_W) $coin_mumpssrcdir/libseq\`
 -I\`\$(CYGPATH_W) $coin_mumpssrcdir/include\`"
     else
       use_mumps=
     fi
   fi

   # if a user provided library is used, then COIN_HAS_USER_LIBRARY takes
 care of the COIN_HAS_MUMPS conditional and preprocessor symbol
   AM_CONDITIONAL([COIN_HAS_MUMPS],[test x"$use_mumps" != x])
   if test x"$use_mumps" != x; then
     AC_DEFINE([COIN_HAS_MUMPS],[1],[If defined, the MUMPS Library is
 available.])
     coin_has_mumps=yes
   else
     coin_has_mumps=no
   fi
   AC_MSG_CHECKING([whether MUMPS is available])
   AC_MSG_RESULT([$coin_has_mumps])
 fi

 if test x"$use_mumps" != x; then
   # we need the Fortran runtime libraries if we want to link with C/C++
   coin_need_flibs=yes

   AC_SUBST(MUMPS_INCFLAGS)
 fi

 AM_CONDITIONAL([COIN_BUILD_MUMPS],[test "$use_mumps" = BUILD])

 ]) # AC_COIN_HAS_MUMPS
 }}}

 Best,
 Stefan

-- 
Ticket URL: <https://projects.coin-or.org/BuildTools/ticket/64#comment:2>
BuildTools <http://projects.coin-or.org/BuildTools>
Tools for configuring and compiling COIN-OR codes



More information about the BuildTools-tickets mailing list