[comp.unix.aix] Problem with new release of Fortran compiler on RS/6000

wross@caen.engin.umich.edu (Wendy Ross) (02/07/91)

Anyone else noticed a problem with newer Fortran compiler/library 
when linking?  skylab is running the older version; the program compiles 
and links happily.  elvedore is running the newer version; the compiler 
bombs out at link time with unresolved symbols.  The reason is that the 
/usr/lib/libxlf.a library was changed between the two versions.  When I 
took the older version of the library and used it with the newer version 
of the compiler, things worked fine.

The nitty gritty details are as follows:
OLDER VERSION OF FORTRAN:
skylab% lslpp -h
...
xlfrte.obj           INACTIVE   COMMIT     11/27/90  01.01.0000.0000 root
                     INACTIVE   APPLY      11/27/90  01.01.0000.0001 root
                     ACTIVE     COMMIT     11/27/90  01.01.0000.0001 root
xlfrtemEn_US.msg     ACTIVE     COMMIT     11/27/90  01.01.0000.0000 root
xlfcmp.obj           INACTIVE   COMMIT     11/27/90  01.01.0000.0000 root
                     INACTIVE   APPLY      11/27/90  01.01.0000.0001 root
                     ACTIVE     COMMIT     11/27/90  01.01.0000.0001 root
...

skylab% xlf /tmp/p.f
** main   === End of Compilation 1 ===
** ttyint   === End of Compilation 2 ===
** pttyin   === End of Compilation 3 ===
1501-510  Compilation successful for file p.f.
skylab% 

skylab% nm /usr/lib/libxlf.a | grep -i getenv
         U getenv
00001b90 T .getenv
00001b90 t .getenv
00000378 d getenv
         U .getenv
00000008 d .+GETENV_
00000000 T .getenv_
0000000c d GETENV_
00000000 D getenv_
         U .getenv
00000000 D #GETENV
0000000c d #GETENV
00000000 T .#GETENV
00000008 d .+#GETENV

NEWER VERSION OF FORTRAN: 
elvedore% lslpp -h
...
xlfrte.obj           INACTIVE   COMMIT     11/27/90  01.01.0000.0000 root
                     INACTIVE   APPLY      11/27/90  01.01.0000.0001 root
                     INACTIVE   COMMIT     11/27/90  01.01.0000.0001 root
                     INACTIVE   APPLY      11/30/90  01.01.0001.0002 root
                     ACTIVE     COMMIT     11/30/90  01.01.0001.0002 root
xlfrtemEn_US.msg     ACTIVE     COMMIT     11/27/90  01.01.0000.0000 root
xlfcmp.obj           INACTIVE   COMMIT     11/27/90  01.01.0000.0000 root
                     INACTIVE   APPLY      11/27/90  01.01.0000.0001 root
                     INACTIVE   COMMIT     11/27/90  01.01.0000.0001 root
                     INACTIVE   APPLY      11/30/90  01.01.0001.0004 root
                     ACTIVE     COMMIT     11/30/90  01.01.0001.0004 root
xlfcmpmEn_US.msg     ACTIVE     COMMIT     11/27/90  01.01.0000.0000 root
...

elvedore% xlf /tmp/p.f
** main   === End of Compilation 1 ===
** ttyint   === End of Compilation 2 ===
** pttyin   === End of Compilation 3 ===
1501-510  Compilation successful for file p.f.
0706-317 ERROR: Unresolved or undefined symbols detected:
                 Symbols in error (followed by references) are
                 dumped to the load map.
.#GETENV
.#SIGNAL
elvedore% 

elvedore% nm /usr/lib/libxlf.a | grep -i getenv
         U getenv
00001b90 T .getenv
00001b90 t .getenv
00000370 d getenv
         U ._getenv
00000008 d .+GETENV_
00000000 T .getenv_
0000000c d GETENV_
00000000 D getenv_
         U ._getenv
00000008 d .+GETENV
00000000 T .getenv
0000000c d GETENV
00000000 D getenv

Where /tmp/p.f is as follows:
      character*10 C
C
C     integer getenv
C     i=getenv('SHELL',C)
C
      call getenv('SHELL',C)

      write(6,'(a10)') C
      call ttyint
      pause
      stop
      end

      subroutine ttyint 
      external pttyin   
C IBMRS/6000
C     call signal(2,pttyin) 
C Apollos/Suns/Decs5000
      integer signal    
      k=signal(2,pttyin,-1)

      return 
      end 

      subroutine pttyin
      write(6,'(a32)') '**** Interrupt signal caught ...'
      write(6,*) 'enter a number'
      read(5,*) i
      write(6,*) 'number was ',i
      return
      end

 
Hello Austin???
 
Wendy Ross               wross@caen.engin.umich.edu
Computer Aided Engineering Network
University of Michigan, Ann Arbor
 
<Insert amusing quip here>

shair@ux1.cso.uiuc.edu (Bob Shair) (02/07/91)

wross@caen.engin.umich.edu (Wendy Ross) writes:

>Anyone else noticed a problem with newer Fortran compiler/library 
>when linking?  

I just had this come across my desk... it's probably not in quite 
the right format to send out on an external (non-IBM) forum like
this, but I don't have enough knowledge to fix it, and the need
for the information may well be urgent.
 
=  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =

TITLE: 910116 XLF V1 ON AIX V3 (ICRA UPDATE 3003)


There exist some differences between the XL Fortrans on releases of AIX
prior to the ICRA update, and XL Fortran as available on the ICRA
update.   These differences can cause programs and/or libraries compiled
prior to the ICRA update to fail at runtime and/or linktime on a
RISC/6000 on which the ICRA update (3003) is installed.

If you have routines or programs which use any of the following
extensions to Fortran, you must take specific steps BEFORE installing
the ICRA update:

1. getenv
2. signal
3. system

It is best to perform the preemptive steps outlined here before
attempting to install ICRA:

1.  Login as root, or become the superuser.
2.  Create a directory.
3.  "cd" to the new directory.
4.  Extract the following members from the current (3002) XL Fortran
    library:  getenv.o, signal.o, system.o.  The command to do so is:
    "ar vx /usr/lib/libxlf.a getenv.o signal.o system.o"
5.  The output of the extraction should say:
    "x - getenv.o
     x - signal.o
     x - system.o"
6.   Back up the extracted library members using your favorite backup
     utility (tar, backup, dd...).

After installation of the ICRA update, you should restore the extracted
files to some directory on your path, and makefiles should be modified
to include these 3 routines.

There have been examples of C language code used to extend or supplement
XL Fortran which fail when recompiled on systems using the ICRA updates.
Here is an example of such code with the corrected code to the right:

/* 3002, not 3003 */       /* 3003 and 3002 */
#include <sys/types.h>       #include <sys/types.h>
long int loc(var)            long int loc(var)
long int var;                 int *var;
{                              {
     long int loc;                long int loc;
     loc = (long int)&var;       loc = (long int)var;
     return(loc);                 return(loc);
}                              }

---------- ---------- ---------- --------- ---------- ----------

-- 
Bob Shair                          shair@chgvmic1.iinus1.ibm.com
Scientific Computing Specialist    SHAIR@UIUCVMD (bitnet)
IBM Champaign