From jagat.k.sheth at citigroup.com  Fri May 12 14:44:02 2006
From: jagat.k.sheth at citigroup.com (Sheth, Jagat K)
Date: Fri, 12 May 2006 08:44:02 -0400
Subject: [Rd] X11 and vfonts modules on AIX 5.2
Message-ID: <FD2342224DDA68419F21B64CA7A47E7B44E288@EXNJMB30.nam.nsroot.net>


I am trying to get R-2.2.1 to pass make check on an AIX 5.2 at work (I know R-2.2.1 is not the latest release, but I encountered make errors in my attempts to install either R-2.3.0 or the R-patched_2006-05-10 on the version of AIX I am on. I will post those errors in a separate posting from this.)   

So far, configure and make finish without error for R-2.2.1 using gnu make, gcc-4.1.0, and 

CC=/usr/local/bin/gcc 
F77=/usr/local/bin/gfortran
CXX=/usr/local/bin/g++ 
MAIN_LDFLAGS=-Wl,-brtl 
SHLIB_LDFLAGS=-Wl,-G
CFLAGS='-g -O'
FFLAGS='-O'
CXXFLAGS='-g -O'

bash-3.00$ ./configure --disable-nls

...

R is now configured for powerpc-ibm-aix5.2.0.0

  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                /usr/local/bin/gcc -mno-fp-in-toc -g -O
  C++ compiler:              /usr/local/bin/g++  -g -O
  Fortran compiler:          /usr/local/bin/gfortran  -O

  Interfaces supported:      X11
  External libraries:        readline
  Additional capabilities:   MBCS
  Options enabled:           R profiling

  Recommended packages:      yes


After make, I can run R-2.2.1 from its build directory but I get the following X11 module loading error when trying to plot
 

> plot(1:10)
  
Error in X11() : X11 module cannot be loaded
In addition: Warning message:
unable to load shared library '/home/js36954/src/R-2.2.1/modules/R_X11.so':
  rtld: 0712-001 Symbol log10 was referenced
      from module /home/js36954/src/R-2.2.1/modules/R_X11.so(), but a runtime definition of the symbol was not found.
rtld: 0712-001 Symbol floor was referenced
      from module /home/js36954/src/R-2.2.1/modules/R_X11.so(), but a runtime definition of the symbol was not found.
rtld: 0712-001 Symbol pow was referenced
      from module /home/js36954/src/R-2.2.1/modules/R_X11.so(), but a runtime definition of the symbol was not found.
rtld: 0712-001 Symbol sin was referenced
      from module /home/js36954/src/R-2.2.1/modules/R_X11.so(), but a runtime definition of the symbol was not found.
rtld: 0712-001 Symbol cos was referenced
      from module /home/js36954/src/R-2.2.1/modules/R_X11.so(), but a runtime definition of the symbol was not found.
rtld: 0712-001 Symbol tan was referenced
      from module /home/js36954/src/R-2.2.1/modules 

This error didn't occur for R-2.0.1 which passes make check using the above config.site settings on the same AIX 5.2. 

Searching the archives on R-devel for similar AIX problems, I tried a diff between the X11 makefiles for R-2.0.1 and R-2.2.1 

diff ~/src/R-2.0.1/src/modules/X11/Makefile ~/src/R-2.2.1/src/modules/X11/Makefile
54c54
<       $(SHLIB_LINK) -o $@ $(R_X11_la_LDFLAGS) $(R_X11_la_OBJECTS) $(R_X11_la_LIBADD) $(LIBS)
---

>     $(SHLIB_LINK) -o $@ $(R_X11_la_LDFLAGS) $(R_X11_la_OBJECTS) $(R_X11_la_LIBADD)
  

...

Adding $(LIBS) at the end of line 54 in the R-2.2.1 X11 makefile caused the loading error above to go away, but I don't know if this is what I should be doing ...

After editing that makefile, I was able to plot in R-2.2.1 but eventually encountered a similar error on the vfonts module during make check   


> Vf <- c("serif", "plain")
> text(4, 2, "\\#J2438\\#J2421\\#J2451\\#J2473", vfont = Vf)
  
Warning: unable to load shared library '/home/js36954/src/R-2.2.1/modules/vfonts.so':
  rtld: 0712-001 Symbol cos was referenced
      from module /home/js36954/src/R-2.2.1/modules/vfonts.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol sin was referenced
      from module /home/js36954/src/R-2.2.1/modules/vfonts.so(), but a runtime definition
      of the symbol was not found.
Error in text.default(4, 2, "\\#J2438\\#J2421\\#J2451\\#J2473", vfont = Vf) : 
    Hershey fonts cannot be loaded

A diff on the R-2.0.1 and R-2.2.1 vfonts module makefiles,
 
diff ~/src/R-2.0.1/src/modules/vfonts/Makefile ~/src/R-2.2.1/src/modules/vfonts/Makefile
51c51
<       $(SHLIB_LINK) -o $@ $(vfonts_la_LDFLAGS) $(vfonts_la_OBJECTS) $(vfonts_la_LIBADD) $(LIBS)
---

>     $(SHLIB_LINK) -o $@ $(vfonts_la_LDFLAGS) $(vfonts_la_OBJECTS) $(vfonts_la_LIBADD)
  

...

I added $(LIBS) at the end of the R-2.2.1 vfonts makefile, and the above error went away the next time I ran make check. 

So, where I am currently at is that I can get R-2.2.1 to pass make check on my AIX 5.2 with the above two makefile edits, but I am not sure how harmful that may be overall ... 

E.g. the plots I now get in R-2.2.1, after editing the X11 and vfonts makefiles, appear with darker axis labels and tick marks than in R-2.0.1, say.

Any advice to help clean things up would be greatly appreciated. I would be happy to provide any additional details.  

Thanks,
Jagat     




Jagat K. Sheth         1000 Technology Drive           
> Mortgage Analytics    Third Floor, Mail Station 55
> CitiMortgage, Inc.    O'Fallon, MO 63368-2240
> Tel:(636)261-1407     FAX:(636)261-1312
> 
> Email: jagat.k.sheth at citigroup.com
> 
> 
> 
> 
> 
>



[Rd] X11 and vfonts modules on AIX 5.2
Sheth, Jagat K