Skip to content

unable to compile mgcv

5 messages · Chuck White, William Dunlap

#
Hello -- I am trying to compile R-2.9.2 on IBM Power5 machine with AIX 5.3.  I have posted three previous posts. Over time I have made significant progress towards getting a successful build. I am now getting the following error:

==========================================================
begin installing recommended package mgcv
* Installing *source* package 'mgcv' ...
** libs
gmake[2]: Entering directory `/tmp/RtmpOtsRnd/R.INSTALL2781446b/mgcv/src'
gcc -maix64 -pthread -std=gnu99 -I/usr/local/builddir/include  -I/usr/local/include      -O2 -g -mcpu=power5 -c gcv.c -o gcv.o
gcc -maix64 -pthread -std=gnu99 -I/usr/local/builddir/include  -I/usr/local/include      -O2 -g -mcpu=power5 -c gdi.c -o gdi.o
gdi.c: In function 'qr_ldet_inv':
gdi.c:294: error: expected identifier or '(' before numeric constant
gdi.c:308: error: lvalue required as unary '&' operand
gdi.c:308: error: lvalue required as unary '&' operand
gdi.c:316: error: 'j' undeclared (first use in this function)
gdi.c:316: error: (Each undeclared identifier is reported only once
gdi.c:316: error: for each function it appears in.)
gdi.c: In function 'get_detS2a':
gdi.c:617: error: expected identifier or '(' before numeric constant
gdi.c:620: error: 'Mf' undeclared (first use in this function)
gdi.c:636: error: 'max_col' undeclared (first use in this function)
.....................................
ERROR: compilation failed for package 'mgcv'
* Removing '/usr/local/builddir/library/mgcv'
gmake[1]: *** [mgcv.ts] Error 1
gmake[1]: Leaving directory `/usr/local/builddir/src/library/Recommended'
gmake: *** [recommended-packages] Error 2
make: The error code from the last command is 2.

Stop.
==========================================================

Initially I had mgcv 1.5-5 and I downloaded mgcv 1.5-6 and tried again. I get the same error.

I would really appreciate any help with this.

Thanks.
#
The first offending line in gdc.c is
    294   int *pivot,i,TRUE=1,j;
and TRUE must be #defined in some AIX
include file.  Change it to true or
add #undef TRUE prior to its use and it
may compile.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
#
Thanks for your response.  Can you please point me to the make file where I would make this change. Thanks.
---- William Dunlap <wdunlap at tibco.com> wrote:
#
If you untar src/library/Recommended/mgcv.tgz (sp?)
this file will be in mgcv/src.  I'm not sure of the
best way to take care of it on AIX.  It may be possible
to #undef TRUE in include/R.h.  The AIX system includes
define it in many places, the most prominent of which
is in types.h.

If you cannot generally #undef TRUE in a global
R include file then you will have to edit the C or h files
in mgcv.
#
Thanks for your response. In the past I have build R for RHEL and it was very simple. I did not have to do anything specific for certain libraries.

I do see the .tgz file (actually it is a link to the original file which has version number too). Questions
[1] do I need to unzip the tgz file, make changes, and zip it back again? Or would the makefile be able to handle the unzipped directory?
[2] is there a way to just compile that library only?
[3] what do I do to resume the compilation of the rest of the libraries. Re-running make would likely try to build the original version of mgcv again.

Thanks -- I would appreciate any document/instructions you can point me to.
---- William Dunlap <wdunlap at tibco.com> wrote: