[R] Compilation failures: mgcv, spatstat, Matrix, cluster

Paul Roebuck
Sun, 14 Aug 2005 00:25:24 -0000

On Sat, 13 Aug 2005, Michael Kubovy wrote:

> With Version 2.1.1  (2005-06-20) on Power Mac G5 running Mac OS X
> 10.4.2 (8C46):
>
> Some compilations work (e.g., MatchIt, RGraphics, Zelig), and some
> don't, e.g., mgcv, spatstat,  and the following (Matrix, cluster):
>
> trying URL 'http://www.ibiblio.org/pub/languages/R/CRAN/src/contrib/
> Matrix_0.98-3.tar.gz'
> Content type 'application/x-tar' length 626712 bytes
> opened URL
> =================================================> downloaded 612Kb
>
> * Installing *source* package 'Matrix' ...
> ** libs
>
> The downloaded packages are in
>      /private/tmp/RtmpPddsAE/downloaded_packages
> gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/
> include  -I/usr/local/include  -I./Metis -fno-common  -g -O2 -c
> HBMM.c -o HBMM.o
> In file included from HBMM.c:2:
> iohb.h:6:19: malloc.h: No such file or directory
> make: *** [HBMM.o] Error 1
> ERROR: compilation failed for package 'Matrix'

Didn't check package for actually functioning correctly,
but the following changes will allow compilation on OS X
10.3. In ANSI C, the standard memory allocation routines
are declared in <stdlib.h>; <malloc.h> is obsolete for that
purpose and isn't guaranteed to exist.


Matrix/src/mmio.c:
    Add #include <stdlib.h>
    Remove #include <malloc.h>

Matrix/src/iohb.h:
    Remove #include <malloc.h>

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)