[Rd] R 2.2.2-1 RPM build problem and solution on RH AS 4 x86_64

2006-01-11 Thread Dan Lipsitt
I have a dual Xeon x86_64 system running Red Hat AS 4. There are no
x86_64 rpms in http://cran.us.r-project.org/bin/linux/redhat/el4/ (the
i386 ones are a point release behind anyway) , and the fc4 rpms have a
whole web of dependencies I don't want to pull in. So I decided to
build http://cran.us.r-project.org/bin/linux/redhat/SRPMS/R-2.2.1-1.fc3.src.rpm
.

When I ran rpmbuild. one of the make-check tests failed.

from /BUILD/R-2.2.1/tests/p-r-random-tests.Rout.fail:
> dkwtest("weibull",shape = 1)
weibull(shape = 1) FAILED
Error in dkwtest("weibull", shape = 1) : dkwtest failed
Execution halted

I was able to build the rpm after removing "--enable-r-shlib" from the
spec file.

http://cran.us.r-project.org/bin/linux/redhat/SRPMS/ReadMe says:
"The new SRPM for R 2.1.1 builds the shared library version of R. This is,
unfortunately, slower than the version without the shared library."

It doesn't say why, if it's slower, it builds it that way. Can anyone
shed some light on the subject?

Dan

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] package compile error on RHEL x86_64

2006-06-14 Thread Dan Lipsitt
I am unable to install the gmp package on an x86_64 (Xeon) machine. I
have had the same problem with other packages (eg. MCMCpack) as well.
I am running Red Hat Enterprise Linux 4.1.
I get the following error:

g++ -shared -L/usr/local/lib64 -o gmp.so biginteger.o
biginteger_operator.o bigintegerR.o bigrational.o
bigrational_operator.o bigrationalR.o factor.o -L/usr/local/lib/ -lgmp
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/3.4.3/libstdc++.a(functexcept.o):
relocation R_X86_64_32 against `std::bad_exception::~bad_exception()'
can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/libstdc++.a: could not read
symbols: Bad value

However, I have found that if I run "R CMD SHLIB" twice in the src/
directory, once to build the .o files, and once to link, I can build
the shared library. If I run it on the .o files instead of the .cc
files it uses gcc instead of g++. This appears to be the change that
allows the lib to build. "-fPIC" seems to have nothing to do with it.

So my question is: How do I get "R CMD INSTALL" to link with gcc
instead of g++? I have tried adding "LINK.cc = $(LINK.c)" to the top
of src/Makevars.in and then running "R CMD check" in the top dir of
the package, but it uses g++ anyway. Any other fix or workaround
suggestions would be appreciated as well.

A commandline transcript follows below.

Thanks,
Dan

$ sudo R CMD INSTALL gmp_0.3-4.tar.gz
* Installing *source* package 'gmp' ...
creating cache ./config.cache
checking for __gmpz_ui_sub in -lgmp... yes
updating cache ./config.cache
creating ./config.status
creating src/Makevars
** libs
g++ -I/usr/lib/R/include -I/usr/local/include/  -Wno-conversion
-I/usr/local/include   -fPIC  -O2 -g -c biginteger.cc -o biginteger.o
g++ -I/usr/lib/R/include -I/usr/local/include/  -Wno-conversion
-I/usr/local/include   -fPIC  -O2 -g -c biginteger_operator.cc -o
biginteger_operator.o
g++ -I/usr/lib/R/include -I/usr/local/include/  -Wno-conversion
-I/usr/local/include   -fPIC  -O2 -g -c bigintegerR.cc -o
bigintegerR.o
g++ -I/usr/lib/R/include -I/usr/local/include/  -Wno-conversion
-I/usr/local/include   -fPIC  -O2 -g -c bigrational.cc -o
bigrational.o
g++ -I/usr/lib/R/include -I/usr/local/include/  -Wno-conversion
-I/usr/local/include   -fPIC  -O2 -g -c bigrational_operator.cc -o
bigrational_operator.o
g++ -I/usr/lib/R/include -I/usr/local/include/  -Wno-conversion
-I/usr/local/include   -fPIC  -O2 -g -c bigrationalR.cc -o
bigrationalR.o
g++ -I/usr/lib/R/include -I/usr/local/include/  -Wno-conversion
-I/usr/local/include   -fPIC  -O2 -g -c factor.cc -o factor.o
g++ -shared -L/usr/local/lib64 -o gmp.so biginteger.o
biginteger_operator.o bigintegerR.o bigrational.o
bigrational_operator.o bigrationalR.o factor.o -L/usr/local/lib/ -lgmp
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/3.4.3/libstdc++.a(functexcept.o):
relocation R_X86_64_32 against `std::bad_exception::~bad_exception()'
can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/libstdc++.a: could not read
symbols: Bad value
collect2: ld returned 1 exit status
make: *** [gmp.so] Error 1
ERROR: compilation failed for package 'gmp'

$ tar xzf gmp_0.3-4.tar.gz
$ cd gmp/src
$ R CMD SHLIB *.cc
g++ -I/usr/lib/R/include  -I/usr/local/include   -fPIC  -O2 -g -c
biginteger.cc -o biginteger.o
g++ -I/usr/lib/R/include  -I/usr/local/include   -fPIC  -O2 -g -c
biginteger_operator.cc -o biginteger_operator.o
g++ -I/usr/lib/R/include  -I/usr/local/include   -fPIC  -O2 -g -c
bigintegerR.cc -o bigintegerR.o
g++ -I/usr/lib/R/include  -I/usr/local/include   -fPIC  -O2 -g -c
bigrational.cc -o bigrational.o
g++ -I/usr/lib/R/include  -I/usr/local/include   -fPIC  -O2 -g -c
bigrational_operator.cc -o bigrational_operator.o
g++ -I/usr/lib/R/include  -I/usr/local/include   -fPIC  -O2 -g -c
bigrationalR.cc -o bigrationalR.o
g++ -I/usr/lib/R/include  -I/usr/local/include   -fPIC  -O2 -g -c
factor.cc -o factor.o
g++ -shared -L/usr/local/lib64 -o biginteger.so biginteger.o
biginteger_operator.o bigintegerR.o bigrational.o
bigrational_operator.o bigrationalR.o factor.o
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/3.4.3/libstdc++.a(functexcept.o):
relocation R_X86_64_32 against `std::bad_exception::~bad_exception()'
can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/libstdc++.a: could not read
symbols: Bad value
collect2: ld returned 1 exit status
make: *** [biginteger.so] Error 1
$ R CMD SHLIB *.o
gcc -shared -L/usr/local/lib64 -o biginteger.so biginteger.o
biginteger_operator.o bigintegerR.o bigrational.o
bigrational_operator.o bigrationalR.o factor.o
$

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] package compile error on RHEL x86_64

2006-06-15 Thread Dan Lipsitt
On 6/15/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> This is a problem with your compiler: it should be linking against a
> shared version of libstdc++.  Please take this up with your OS support.

Okay, will do. In the meantime, do you know of a way I can convince R
CMD INSTALL to use gcc instead of g++ for the link step?

Thanks,
Dan

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] package compile error on RHEL x86_64 - FIXED

2006-06-21 Thread Dan Lipsitt
For the record: The error below has been resolved. As Professor Ripley
said, it was a compiler problem. Upgrading to a more recent gcc rpm
(gcc-3.4.5-2) and its dependencies made the errors go away.

Thanks,
Dan

On 6/14/06, Dan Lipsitt <[EMAIL PROTECTED]> wrote:
> I am unable to install the gmp package on an x86_64 (Xeon) machine. I
> have had the same problem with other packages (eg. MCMCpack) as well.
> I am running Red Hat Enterprise Linux 4.1.
> I get the following error:
>
> g++ -shared -L/usr/local/lib64 -o gmp.so biginteger.o
> biginteger_operator.o bigintegerR.o bigrational.o
> bigrational_operator.o bigrationalR.o factor.o -L/usr/local/lib/ -lgmp
> /usr/bin/ld: 
> /usr/lib/gcc/x86_64-redhat-linux/3.4.3/libstdc++.a(functexcept.o):
> relocation R_X86_64_32 against `std::bad_exception::~bad_exception()'
> can not be used when making a shared object; recompile with -fPIC
> /usr/lib/gcc/x86_64-redhat-linux/3.4.3/libstdc++.a: could not read
> symbols: Bad value
>
> However, I have found that if I run "R CMD SHLIB" twice in the src/
> directory, once to build the .o files, and once to link, I can build
> the shared library. If I run it on the .o files instead of the .cc
> files it uses gcc instead of g++. This appears to be the change that
> allows the lib to build. "-fPIC" seems to have nothing to do with it.
>
> So my question is: How do I get "R CMD INSTALL" to link with gcc
> instead of g++? I have tried adding "LINK.cc = $(LINK.c)" to the top
> of src/Makevars.in and then running "R CMD check" in the top dir of
> the package, but it uses g++ anyway. Any other fix or workaround
> suggestions would be appreciated as well.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel