Skip to content

query on kinship

2 messages · jing hua zhao, Jan de Leeuw

#
Dear list members,

I was suggested to contact this list for information concerning the kinship 
package that I ported a while ago. It is said that the package won't compile 
properly but I have no means to check for it, although it appears there is 
no problem with the checking from CRAN. However, that was for a version I 
posted almost a year ago. It works with no problem on Sun Solaris, Red Het 
Linux and Windows that I usually use.

Any indication and suggestions for fixing the problems, if any, would be 
greatly appreciated. I can also be contacted via my e-mail account from work 
jinghua.zhao at mrc-epid.cam.ac.uk.

Many thanks in advance,


Jing Hua Zhao
#
/usr/local/bin/gcc -bundle -flat_namespace -undefined suppress -L/usr/ 
local/lib -o kinship.so agfit6b.o bdsmatrix_index1.o  
bdsmatrix_index2.o bdsmatrix_index3.o bdsmatrix_prod.o  
bdsmatrix_prod2.o bdsmatrix_prod3.o chinv4.o chinv5.o cholesky4.o  
cholesky5.o chsolve4.o chsolve5.o coxfit6a.o coxfit6b.o coxfit6c.o  
gchol.o gchol_bds.o   -F/Library/Frameworks/R.framework/.. -framework R
/usr/bin/ld: multiple definitions of symbol _c6
agfit6b.o definition of _c6 in section (__DATA,__common)
coxfit6a.o definition of _c6 in section (__DATA,__common)
coxfit6b.o definition of _c6 in section (__DATA,__common)
coxfit6c.o definition of _c6 in section (__DATA,__common)
/usr/bin/ld: warning multiple definitions of symbol _signgam
/Library/Frameworks/R.framework/../R.framework/R(lgamma.o) definition  
of _signgam
/usr/lib/libSystem.dylib(gamma9.o) definition of _signgam
collect2: ld returned 1 exit status
make: *** [kinship.so] Error 1
ERROR: compilation failed for package 'kinship'


The usual problem: to link bundles (plug-ins) OS X uses flat  
namespaces, and by
default you cannot have multiple symbol definitions if you use flat  
namespaces,
because the dynamic linker would have no way of knowing which  
definition to
use at run time.

The proper way to fix this is to define your symbols only once and  
declare
them extern in the other files.

Those of you who want to use the package without waiting for the fix  
can use
R CMD INSTALL in the terminal, which will break at the same place.  
Then copy the link statement
to the clipboard, go to the src directory, and paste

/usr/local/bin/gcc -bundle -flat_namespace -undefined suppress - 
Xlinker -m -L/usr/local/lib -o kinship.so agfit6b.o  
bdsmatrix_index1.o bdsmatrix_index2.o bdsmatrix_index3.o  
bdsmatrix_prod.o bdsmatrix_prod2.o bdsmatrix_prod3.o chinv4.o  
chinv5.o cholesky4.o cholesky5.o chsolve4.o chsolve5.o coxfit6a.o  
coxfit6b.o coxfit6c.o gchol.o gchol_bds.o   -F/Library/Frameworks/ 
R.framework/.. -framework R

INserting -Xlinker -m  forces the link. Apple frowns on this, for  
obvious reasons. Then run R CMD INSTALL again.
On Jan 21, 2006, at 12:18 , jing hua zhao wrote:

            
===
Jan de Leeuw; Distinguished Professor and Chair, UCLA Department of  
Statistics;
Editor: Journal of Multivariate Analysis, Journal of Statistical  
Software
US mail: 8125 Math Sciences Bldg, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw at stat.ucla.edu
.mac: jdeleeuw ++++++  aim: deleeuwjan ++++++ skype: j_deleeuw
homepages: http://gifi.stat.ucla.edu ++++++ http://www.cuddyvalley.org
   
------------------------------------------------------------------------ 
-------------------------
           No matter where you go, there you are. --- Buckaroo Banzai
                    http://gifi.stat.ucla.edu/sounds/nomatter.au