From ripley at stats.ox.ac.uk  Mon Jan 10 16:01:52 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon Jan 10 16:02:00 2005
Subject: [Rd] Problem with compiling - Freebsd on AMD64 (PR#7489)
In-Reply-To: <20050110142203.7E1D81043E@slim.kubism.ku.dk>
References: <20050110142203.7E1D81043E@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.61.0501101435520.17308@gannet.stats>

In what sense is this a bug in R?  If changing your compiler optimization 
leads to a segfault, it looks very like a compiler bug.  So what was the 
compiler?

[R does work using AMD64 on Linux, but only correctly with gcc >= 3.3.3.]

BTW gdb output with "-g -O2" (the R default) ought to be informative, so 
was this with -O?

On Mon, 10 Jan 2005 kjblack@gmail.com wrote:

> Full_Name: Kelly Black
> Version: 2.0.1
> OS: FreeBSD 5.3 on AMD64
> Submission from: (NULL) (149.106.32.93)
>
>
> I downloaded R-2.0.1 from the R website, ran configure then make and got 
> an error. I will paste a copy of the output from the makefile below. The 
> problem was when the makefile tried to run the R binary. When I came 
> across the error I reran configure, but this time with the following 
> arguments:
>
> ./configure FFLAGS="-g" CFLAGS="-g" CXXFLAGS="-g"
>
> This time when I ran make it compiled with no problems. I tried the same thing
> again only with all of the flags set to "-O" and again it compiled with no
> problems. When I ran it with the flags set to "-g -O2" it had the same error. A
> copy of the output from gdb can be found at
> http://blackk.union.edu/~black/freebsd/R-error.txt, but the output isn't very
> helpful.
>
> The system used is a laptop, Compaq Presario (amd64), under FreeBSD 5.3 compiled
> for the amd64 architecture.
>
> Output from make with flags "-O2"
>
> black@compaqlaptop$ pwd
> /tmp/R-2.0.1/src/library/base
> black@compaqlaptop$ make
> echo "building package 'base'"
> building package 'base'
> /usr/local/bin/bash ../../../src/scripts/mkinstalldirs ../../../library/base/R
> (f=${TMPDIR:-/tmp}/R$$;  cat `LC_COLLATE=C ls ./R/*.R ./R/unix/*.R` >> ${f};
> /usr/local/bin/bash ../../../tools/move-if-change ${f} all.R)
> all.R is unchanged
> /usr/local/bin/bash ../../../tools/copy-if-change all.R
> ../../../library/base/R/base ${f}
> ../../../library/base/R/base is unchanged
> for f in COPYRIGHTS INDEX SOURCES; do  if test -f ./${f}; then
> /usr/bin/install -c -m 644 ./${f}  ../../../library/base;  fi;  done
> if test -f DESCRIPTION; then  /usr/bin/install -c -m 644 DESCRIPTION
> ../../../library/base;  (tmp="Built: R 2.0.1; ";  if test -d ./src; then
> tmp="${tmp}x86_64-unknown-freebsd5.3";  fi;  tmp="${tmp}; `date`; unix";  echo
> "${tmp}")  >> ../../../library/base/DESCRIPTION;  fi
> /usr/local/bin/bash ../../../src/scripts/mkinstalldirs
> ../../../library/base/demo
> for f in `ls -d ./demo/* | sed -e '/CVS/d' -e '/00Index/d'`; do
> /usr/bin/install -c -m 644 ${f} ../../../library/base/demo;  done
> /usr/local/bin/bash ../../../src/scripts/mkinstalldirs
> ../../../library/base/man
> (f=${TMPDIR:-/tmp}/R$$;  for rdfile in ./man/*.Rd ./man/unix/*.Rd; do  echo "%
> --- Source file: ${rdfile} ---";  cat ${rdfile}; echo '\eof';  done >> ${f};
> /usr/local/bin/bash ../../../tools/move-if-change ${f}
> ../../../library/base/man/base.Rd)
> rm -f ../../../library/base/man/base.Rd.gz
> /usr/bin/gzip ../../../library/base/man/base.Rd
> /usr/bin/install -c -m 644 ./inst/CITATION ../../../library/base
> /usr/bin/install -c -m 644 all.R ../../../library/base/R/base
> cat ./makebasedb.R |  R_DEFAULT_PACKAGES=NULL LC_COLLATE=C ../../../bin/R
> --vanilla --slave > /dev/null
> Floating point exception (core dumped)
> *** Error code 136
>
> Stop in /tmp/R-2.0.1/src/library/base.
>
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] Problem with compiling - Freebsd on AMD64 (PR#7489)
Prof Brian Ripley