Skip to content

R-2.3.1 does not install on FreeBSD 4.11-RELEASE (PR#8971)

5 messages · kenji.rikitake at acm.org, Brian Ripley, Kenji Rikitake

#
Full_Name: Kenji Rikitake
Version: 2.3.1
OS: FreeBSD 4.11-RELEASE-p18
Submission from: (NULL) (220.157.163.221)


After doing
./configure --disable-mbcs
(as default in FreeBSD 4.x)
and
make
the compilation stops at src/main/printutils.c as:
printutils.c: In function `Rvprintf':
printutils.c:582: `va_start' used in function with fixed args
printutils.c:591: syntax error before `}'

the following patch includes two fixes:

1) removing unnecessary va_start() and va_end() macro for Rvprintf() in
   src/main/printutils.c
2) fixing error by adding {} around calling error() in src/main/printutils.c

--- src/main/printutils.c.FCS   Mon Apr 10 07:19:28 2006
+++ src/main/printutils.c       Tue Jun 13 12:07:05 2006
@@ -579,14 +579,15 @@
       (con->vfprintf)(con, format, argcopy);
       va_end(argcopy);
 #else /* don't support sink(,split=TRUE) */
-      va_start(arg, format);
+      /* va_start(arg, format); */ /* not for FREEBSD_4 */
       (con->vfprintf)(con, format, arg);
-      va_end(arg);
+      /* va_end(arg); */
+      /* not for FREEBSD_4 */
 #endif
       con->fflush(con);
       con_num = getActiveSink(i++);
 #ifndef HAVE_VA_COPY
-      if (con_num>0) error("Internal error: this platform does not support
split output")
+      if (con_num>0) {error("Internal error: this platform does not support
split output");}
 #endif
     } while(con_num>0);
 
Also, I needed to fix the permission after doing
make install
using the following set of commands:

cd /usr/local/lib/R/exec
chmod 0755 R
cd /usr/local/lib/R/lib
chmod 0755 libRlapack.so
cd /usr/local/lib/R/base
chmod 755 Meta R R-ex demo help html latex man po
find . -type d -not -perm -001 | xargs chmod go+rx
find . -type f -and -not -perm -444 | xargs chmod go+r
cd /usr/local/lib/R/modules
chmod 755 *.so

[End of bug report]
#
The first point is already changed in R-patched: please try it and 
confirm.  The NEWS file says:

     o   There were problems in src/main/printutils.c on platforms
         that did not have va_copy.

What architecture and compiler is this (and is FreeBSD 4.11-RELEASE not 
rather old)?  va_copy is a C99 feature, and was introduced as __va_copy 
well before 1999.  (__va_copy was in gcc 2.95.3 for example, and 2.3.1 
builds on platforms with __va_copy and not va_copy.)


Your second point seems to be covered by the instructions to set umask 
appropriately: people who have are not having to change permissions after 
installation.
On Tue, 13 Jun 2006, kenji.rikitake at acm.org wrote:

            
Why do you claim that is `default in FreeBSD 4.x'?

  
    
#
Prof. Ripley:

In the message <Pine.LNX.4.64.0606130640470.23931 at gannet.stats.ox.ac.uk>
dated Tue, Jun 13, 2006 at 06:53:20AM +0100,
Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
I'm compiling the kit R-patched_2006-06-12.tar.gz right now.  The buggy
code is surely removed and it's keep on building well.
gcc 2.95.4 on FreeBSD 4.11-RELEASE-p18; note that stdarg(3) says

STANDARDS
     The va_start(), va_arg(), and va_end() macros conform to ISO/IEC
     9899:1990 (``ISO C90'').

And va_copy() does not exist.  I think this is a common FreeBSD-related
problem, fixed in a later release, on 5.x or 6.x.
I set umask to 0022 manually and did "make install" from tcsh, but
didn't get the permission flags straighten out.  I'll check this out
again, though I think I need to investigate a bit.
All I know is that in FreeBSD ports math/R and on 4.x, --disable-mbcs
had been required to get around with the broken MBCS library handling of
FreeBSD.  So I followed the convention.

Many thanks for your help.

// Kenji Rikitake
#
On Tue, 13 Jun 2006, Kenji Rikitake wrote:

            
__va_copy is supposed to exist on that compiler, and the R code maps 
__va_copy to va_copy when the first exists and the second does not.
You need to set umask when you unpack and build, not just when you 
install.
Ah, `convention' rather than default (R's configure does not set it).

  
    
#
In the message <Pine.LNX.4.64.0606130719520.24883 at gannet.stats.ox.ac.uk>
dated Tue, Jun 13, 2006 at 07:25:01AM +0100,
Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
Unfortunately configure did not find the __va_copy either.
It says in the config.log:

configure:31136: checking whether __va_copy exists and is declared
configure:31169: gcc -o conftest -g -O2 -D__NO_MATH_INLINES -I/usr/local/include
  -L/usr/local/lib conftest.c -lm  >&5
conftest.c: In function `main':
conftest.c:115: `__va_copy' undeclared (first use in this function)
conftest.c:115: (Each undeclared identifier is reported only once
conftest.c:115: for each function it appears in.)
configure:31175: $? = 1
configure: failed program was:
[rest deleted]

This seems to be well-known, regarding the Google search results of "FreeBSD va_copy".
OK I will do that.
Sorry for being ambiguous on this.

Many thanks again,

// Kenji Rikitake