[R] lpSolve doesn't compile because of a malloc.h error

vittorio vdemart1 at tin.it
Tue Oct 2 19:13:13 CEST 2007


Yes, it was very clear but being an absolute beginner as a programmer I was 
misled by the presence of both stdlib.h and malloc.h in lpslink55.c (in a 
nutshell, I thought "Why s it complaining if stdlib.h is there, in the 
code??").

Anyway, thanks to your help I made it in the end.

Ciao
Vittorio

Monday 01 October 2007 20:47:36 Prof Brian Ripley wrote:
> Isn't the message rather clear?  You need to edit the package sources 
> replace malloc.h by stdlib.h (or remove the former if the latter is
> already there, as in this case).
>
> And BTW, 'gcc-4.2.2' is unreleased, but imminent (as R 2.6.0 is).
>
> On Mon, 1 Oct 2007, vittorio wrote:
> > Under freebsd 6.2-p7 i386, R 2.5.1,gcc-4.2.2 I'm unable to compile
> > package lpSolve because:
> >
> > hpbsd# R CMD INSTALL lpSolve_5.5.8.tar.gz
> > * Installing to library '/usr/local/lib/R/library'
> > * Installing *source* package 'lpSolve' ...
> > ** libs
> > cc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include -I .
> > -DINTEGERTIME -DPARSER_LP -DBUILDING_FOR_R -DYY_NEVER_INTERACTIVE
> > -DUSRDLL -DCLOCKTIME -DRoleIsExternalInvEngine
> > -DINVERSE_ACTIVE=INVERSE_LUSOL -DINLINE=static -DParanoia
> > -I/usr/local/include  -D__NO_MATH_INLINES  -fpic  -O2
> > -fno-strict-aliasing -pipe -march=prescott -c colamd.c -o colamd.o
> > cc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include -I .
> > -DINTEGERTIME -DPARSER_LP -DBUILDING_FOR_R -DYY_NEVER_INTERACTIVE
> > -DUSRDLL -DCLOCKTIME -DRoleIsExternalInvEngine
> > -DINVERSE_ACTIVE=INVERSE_LUSOL -DINLINE=static -DParanoia
> > -I/usr/local/include  -D__NO_MATH_INLINES  -fpic  -O2
> > -fno-strict-aliasing -pipe -march=prescott -c commonlib.c -o commonlib.o
> > ................................................................
> > cc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include -I .
> > -DINTEGERTIME -DPARSER_LP -DBUILDING_FOR_R -DYY_NEVER_INTERACTIVE
> > -DUSRDLL -DCLOCKTIME -DRoleIsExternalInvEngine
> > -DINVERSE_ACTIVE=INVERSE_LUSOL -DINLINE=static -DParanoia
> > -I/usr/local/include  -D__NO_MATH_INLINES  -fpic  -O2
> > -fno-strict-aliasing -pipe -march=prescott -c lp_wlp.c -o lp_wlp.o
> > cc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include -I .
> > -DINTEGERTIME -DPARSER_LP -DBUILDING_FOR_R -DYY_NEVER_INTERACTIVE
> > -DUSRDLL -DCLOCKTIME -DRoleIsExternalInvEngine
> > -DINVERSE_ACTIVE=INVERSE_LUSOL -DINLINE=static -DParanoia
> > -I/usr/local/include  -D__NO_MATH_INLINES  -fpic  -O2
> > -fno-strict-aliasing -pipe -march=prescott -c lpslink55.c -o lpslink55.o
> > In file included from lpslink55.c:11:
> > /usr/include/malloc.h:3:2: #error "<malloc.h> has been replaced by
> > <stdlib.h>" *** Error code 1
> >
> > Stop in /tmp/R.INSTALL.zVvtvK/lpSolve/src.
> > ERROR: compilation failed for package 'lpSolve'
> > ** Removing '/usr/local/lib/R/library/lpSolve'
> > =======================================
> >
> > Now, both malloc.h and stdlib.h are under /usr/include.
> >
> > What's wrong with it?
> >
> > Ciao
> > Vittorio
> >



More information about the R-help mailing list