[Rd] Problems with autoconf example from r-ext.

nwew W.E.Wolski at newcastle.ac.uk
Wed Oct 5 14:46:34 CEST 2005


Dear R-developers,

I am trying to reproduce the autoconf.ac example from R-ext and fail.

My autoconf file looks like this

[autoconf.ac]
# original by Friedrich Leisch, much changed by BDR

AC_INIT([SBMLodeSolveR])

dnl Select an optional include path, from a configure option
dnl or from an environment variable.
AC_ARG_WITH([sbmlode-include],
            AC_HELP_STRING([--with-sbmlode-include=INCLUDE_PATH],
                           [the location of SBMLODE header files]),
            [sbmlode_include_path=$withval])
if test [ -n "$sbmlode_include_path" ] ; then
   AC_SUBST([CPPFLAGS],["-I${sbmlode_include_path} ${CPPFLAGS}"])
else
  if test [ -n "${SBMLODE_INCLUDE}" ] ; then
     AC_SUBST([CPPFLAGS],["-I${SBMLODE_INCLUDE} ${CPPFLAGS}"])
  fi
fi


dnl ditto for a library path
AC_ARG_WITH([sbmlode-lib],AC_HELP_STRING([--with-sbmlode-lib=LIB_PATH],[the 
location of libsbmlode libraries]),[sbmlode_lib_path=$withval])

          if test [ -n "$sbmlode_lib_path" ] ; then
             AC_SUBST([LIBS],[" -L${sbmlode_lib_path} ${LIBS}"])
          else
            if test [ -n "${SBMLODE_LIBS}" ] ; then
               AC_SUBST([LIBS],["-I${SBMLODE_LIBS} ${LIBS}"])
            fi
          fi

dnl Now find the compiler and compiler flags to use
          : ${R_HOME=`R RHOME`}
          if test -z "${R_HOME}"; then
            echo "could not determine R_HOME"
            exit 1
          fi
          CC=`"${R_HOME}/bin/R" CMD config CC`
          CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`

          
dnl substitute CPPFLAGS and LIBS
          AC_SUBST(CPPFLAGS)
          AC_SUBST(LIBS)
dnl and do subsitution in the src/Makevars.in
          AC_OUTPUT(src/Makevars)

[end autoconf.ac]

I rund autoconf..

[Makevars.in]
PKG_CFLAGS=@CPPFLAGS@
PKG_LIBS=@LIBS@
[end-Makevars.in]

I rund R CMD with

R CMD INSTALL 
--configure-args='--with-sbmlode-lib=/data/opt/sbmlodesolve/include \
--with-sbmlode-include=/data/opt/sbmlodesolve/lib' \
 SBMLodeSolveR


What I am getting is a

[Makvars]
PKG_CFLAGS=
PKG_LIBS= -L/data/opt/sbmlodesolve/include
[end-Makevars]


and the following warnings

[warnings]
* Installing *source* package 'SBMLodeSolveR' ...
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /data/opt/sbmlodesolve/lib
configure: creating ./config.status
config.status: creating src/Makevars
*
[end-warnings]

Any suggestions?

Eryk



More information about the R-devel mailing list