From JHZhang at mdanderson.org  Thu Dec  2 21:41:00 2010
From: JHZhang at mdanderson.org (Zhang,Jun)
Date: Thu, 2 Dec 2010 14:41:00 -0600
Subject: [Rd] Install package 'Matrix' problem
In-Reply-To: <alpine.LFD.2.00.1012020612240.13083@gannet.stats.ox.ac.uk>
References: <5685E4FBA752A441B1975A77A77CD64824E371F8D9@DCPWVMBXC1VS2.mdanderson.edu>
	<alpine.LFD.2.00.1012020612240.13083@gannet.stats.ox.ac.uk>
Message-ID: <5685E4FBA752A441B1975A77A77CD64824E371FA3B@DCPWVMBXC1VS2.mdanderson.edu>

Prof. Ripley,
     I've just done the installation of the R package 'Matrix' to my 64-bit R 2.12.0, and it is loaded fine. Seems adding -m64 to the CXX line solved the problem.

I had,
CC="cc -xc99 -m64 -xarch=sparcvis2"
CXX="CC -library=stlport4"

And now I have (the working version),
CC="cc -xc99 -m64 -xarch=sparcvis2"
CXX="CC -m64 -library=stlport4"

Thank you!

Jun Zhang
System Analyst III
Division of Quantitative Science
FCT4.6109
713-792-2606



-----Original Message-----
From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
Sent: Thursday, December 02, 2010 12:30 AM
To: Zhang,Jun
Cc: 'r-devel at r-project.org'
Subject: Re: [Rd] Install package 'Matrix' problem

We need more information, at the minimum the line which compiled 
CHMfactor.o.  Can you make the install log (you may need to run this 
again) and your etc/Makeconf available on-line?

At first sight your C++ compiler is missing -m64: the R-admin manual 
says

'For a 64-bit target add -m64 to the compiler macros and use something 
like LDFLAGS=-L/opt/csw/lib/sparcv9 or LDFLAGS=-L/usr/local/lib/amd64 
as appropriate.'

I see I used

CC="cc -xc99 -m64"
CFLAGS="-O -xlibmieee"
F77="f95 -m64"
FFLAGS=-O4
CXX="CC -m64 -library=stlport4"
CXXFLAGS=-O
FC=$F77
FCFLAGS=$FFLAGS
LDFLAGS=-L/usr/local/lib/sparcv9
FCLIBS="-lfai -lfsu -lfai2"

in config.site.  And BTW, it is always worth checking the manuals of 
current R-patched: your compiler postdates the pre-release period for 
R 2.12.0.

On Wed, 1 Dec 2010, Zhang,Jun wrote:

> 64-bit R-2.12.0 was installed on Sun SPARC Solaris 10. Compiler used is solstudio12.2. Attached is the configure script.
> I then tried to install a recommended package called Matrix. The compilation failed with the following messages,
> .......

> CC -library=stlport4 -G -L/opt/csw/lib/sparcv9 
> -L/opt/solstudio12.2/prod/lib/v9 -o Matrix.so CHMfactor.o Csparse.o 
> TMatrix_as.o Tsparse.o init.o Mutils.o chm_common.o cs.o cs_utils.o 
> dense.o dgCMatrix.o dgTMatrix.o dgeMatrix.o dpoMatrix.o dppMatrix.o 
> dsCMatrix.o dsyMatrix.o dspMatrix.o dtCMatrix.o dtTMatrix.o 
> dtrMatrix.o dtpMatrix.o factorizations.o ldense.o lgCMatrix.o 
> sparseQR.o abIndex.o CHOLMOD.a COLAMD.a AMD.a 
> -L/apps/sparcv9/R-2.12.0/lib/R/lib -lRlapack 
> -L/apps/sparcv9/R-2.12.0/lib/R/lib -lRblas -lifai -lsunimath -lfai 
> -lfai2 -lfsumai -lfprodai -lfminlai -lfmaxlai -lfminvai -lfmaxvai 
> -lfui -lfsu -lsunmath -lmtsk -lm

> ld: fatal: file CHMfactor.o: wrong ELF class: ELFCLASS64
> ld: fatal: File processing errors. No output written to Matrix.so
> make: *** [Matrix.so] Error 2
> ERROR: compilation failed for package 'Matrix'
> * removing '/apps/sparcv9/R-2.12.0/lib/R/library/Matrix'
>
> Some article suggests theorectically that ld or compiler driver

You need to give references for what you are quoting here (there is 
much misinformation on the Internet).  I suspect it is simply that you 
didn't specify the C++ compiler correctly.

> first sees a component .o file which is 32-bit (don't know which one 
> here), and decides that other components should be 32-bit, too, 
> hence the error message, since CHMfactor.o must be a 64-bit object. 
> I just don't know what is the practical way to avoid this situation. 
> I guess I'm posting in the right list, can somebody help?

Maybe, but really your local IT support is there to help your use of 
your OS: this is a Solaris issue, not an R one.

-- 
Brian D. Ripley,                  ripley at 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] Install package 'Matrix' problem
Zhang,Jun