Article 137138 of comp.os.vms:
Path: nntpd.lkg.dec.com!depot.mro.dec.com!news.jrd.dec.com!tbjnws.tbj.dec.com!news.dec-j!spin-hsd0-tky!spinnews!wnoc-tyo-news!news.imnet.ad.jp!usenet.seri.re.kr!news.kreonet.re.kr!overload.lbl.gov!agate!howland.reston.ans.net!tank.news.pipex.net!pipex!newsfeed.internetmci.com!in1.uu.net!news00.sunet.se!sunic!mn6.swip.net!seunet!mn4.swip.net!front!lennartb
From: lennartb@front.se (Lennart Börjeson)
Newsgroups: comp.os.vms
Subject: Re: migrating from DEC C 5.0 on Vax to DEC C 5.2 on Alpha
Message-ID: <1996Jan3.155747.5244@front>
Date: 3 Jan 96 15:57:47 MET
References: <9512282100.AA9644@worldcom-45.worldcom.com>
Distribution: world
Organization: Front Capital Systems AB, Sweden
Lines: 92

In article <9512282100.AA9644@worldcom-45.worldcom.com>, Cedric Norsigian <Cedric_Norsigian@onesource.com> writes:
> Recently I successfully migrated a large database production system, written in 
> C, from our Vax cluster (running VMS 5.2 and Vax C 3.2) to a standalone Vax 
> running OpenVms 6.2 and DEC C 5.0.  Now that the system is running the way I 
> want it to on the standalone Vax, I have moved all of the source code built 
> using DEC C 5.0 to a new Alpha machine that we have recently acquired for a 60 
> day trial.  So far, I have rebuilt all of the object libraries on the Alpha 
> running DEC C 5.2 with very little trouble, but have now run into the familiar 
> "%LINK-W-USEUNDEF, undefined symbol" warning when trying to build virtually all 
> of our production executables:
> 
>  %LINK-W-NUDFSYMS, 4 undefined symbols:
> %LINK-I-UDFSYM,         DECC$VA_COUNT
> %LINK-I-UDFSYM,         DECC$VA_START
> %LINK-I-UDFSYM,         MTH$CVT_DA_GA
> %LINK-I-UDFSYM,         MTH$CVT_GA_DA
> 
> Note that in trying to build approximately 65 executables, these are the only 
> symbols that are giving me problems.
> The first two functions, DECC$VA_COUNT and DECC$VA_START, are part of the DEC C 
> RTL, so why they aren't being
> picked up by the linker is a mystery to me.
> 
> The functions MTH$CVT_GA_DA and MTH$CVT_DA_GA are part of the OpenVms RTL, and 
> are declared in the following 
> two header files on the system disk:
> 
> [SYS0.SYSCOMMON.DECC$LIB.REFERENCE.SYS$STARLET_C]MTH$ROUTINES.H;1
> [VMS$COMMON.DECC$LIB.REFERENCE.SYS$STARLET_C]MTH$ROUTINES.H;1
>  
> Again, I don't know why the above functions are not being recognized by the 
> linker.
> 
> [...deleted...]

Neither of these routines are part of the RTL on Alpha/VMS. The DECC$VA_COUNT
and DECC$VA_START routines on Vax/VMS are hidden behind the macros in varargs.h.
On Alpha/VMS, the very same macros expand differently, using compiler builtin
routines---i.e. the compiler itself inserts the code to implement the routines.

If your code references these routines, it must mean that the code calls them
directly, without using the macros in varargs.h. This would be a coding error
which you must find and correct.

The MTHRTL is superceded on Alpha/VMS by the DPML library. This library contains
entries for MTH$-routines as well, but the MTH$CVT_DA_GA and MTH$CVT_GA_DA entries
are absent. Why, I cannot guess. The MTH$CVT_D_G and MTH$CVT_G_D entries are
present, so you might work around your problem by implementing the missing
routines yourself. Something simple like

extern double MTH$CVT_D_G(double* d);
extern double MTH$CVT_G_D(double* g);

double * MTH$CVT_DA_GA(double src[], double dest[], int *siz)
{
  int i,n;
  n = siz ? *siz : 1;
  for (i=0;i<n;i++) {
    dest[i] = MTH$CVT_D_G(&src[i]);
  }
  return dest;
}

double * MTH$CVT_GA_DA(double src[], double dest[], int *siz)
{
  int i,n;
  n = siz ? *siz : 1;
  for (i=0;i<n;i++) {
    dest[i] = MTH$CVT_G_D(&src[i]);
  }
  return dest;
}


might suffice. On the other hand, please make sure that the code really uses
the floating point format you expect. Check out CC/FLOAT=<floating-format>.

> 
> Cedric Norsigian
> OneSource Information Services, Inc.
> Cambridge, MA.

-- 
!++
! Lennart Börjeson
! Front Capital Systems AB
! World Trade Centre, Kungsbron 1, box 70351
! S-107 24 Stockholm
! tel: +46-8-454 00 00, fax: +46-8-454 00 10
! email: lennartb@front.se
! PSImail: PSI%24037104026::LENNARTB
!--


