Welcome to iraf.net Monday, May 06 2024 @ 11:23 PM GMT


 Forum Index > Help Desk > Systems New Topic Post Reply
 porting to 64-bit
   
duvall
 07/14/2010 08:09PM (Read 2254 times)  
+++--
Chatty

Status: offline


Registered: 03/08/2006
Posts: 59
I did succeed in getting a simple task that generates large images to compile and run to generate images of 4 GB. So, then I tried to compile a large package with about 105 tasks and got a number of errors. After fixing the ones that I could figure out, I'm left with a bunch of errors that look like:libpkg.a(l_to_theta.o): In function `tltota_':
/home/duvall/cedpub1_iraf/travelt/l_to_theta.x:48: relocation truncated to fit: R_X86_64_32 against symbol `mem_' defined in *ABS* section in /tmp/T_x_travelt.e.s9OwzbAfter looking at the 'Porting Guide' and studying the code, I'm not sure what is going on. The task in question is reasonably short (90 lines) and so I append it at the end of this message. It's also available at http://sun.stanford.edu/~duvall/Data/l_to_theta.x.
Help!
Thanks.
Tom# L_TO_THETA: Convert a zonal mode picture (l,t) to real space (t,theta)
# by generating the Legendre polynomials at equal increments of theta.include <imhdr.h>procedure t_l_to_theta()
char inname[SZ_FNAME] # Input file name.
char outname[SZ_FNAME] # Output file name.
real dtheta # Increment in colatitude.
real degrees_per_radian# Conversion constant.
int ntheta # Number of output points in theta.
pointer im_in # To input image.
pointer im_out # To output image.
int lmax # Maximum degree.
pointer pl # To array of Legendre polynomials.
int line # Index to input line.
pointer inline # To input line data.
pointer outline # To output line data.
int itheta # Index to thetareal clgetr() # Cl get parameter, real.
int clgeti() # Cl get parameter, int.
pointer immap() # Image open.
pointer imgl2r() # Image get line real.
pointer impl2r() # Image put line real.
real adotr() # Dot product of two vectors, real.
begin
# Cl input.
call clgstr ("input", inname, SZ_FNAME)
call clgstr
# Setup Legendre polynomial image.
im_in = immap (inname, READ_ONLY, 0)
lmax = IM_LEN(im_in,1) - 1
call malloc (pl, (lmax+1)*ntheta, TY_REAL)
call plgen (Memr[pl], lmax+1, ntheta, dtheta)# Setup output image.
im_out = immap (outname, NEW_COPY, im_in)
IM_LEN(im_out,1) = ntheta# Do the calculation.
for (line=1; line<=IM_LEN(im_in,2); line=line+1)
{ inline = imgl2r (im_in, line)
outline = impl2r (im_out, line)
for (itheta=0; itheta<ntheta; itheta=itheta+1)
Memr[outline+itheta] = adotr (Memr[inline],
Memr[pl+itheta*(lmax+1)], lmax+1)
}# Clean up.
call imunmap (im_in)
call imunmap (im_out)
call mfree (pl, TY_REAL)
end
# *********************************************************
procedure plgen (ar, nl, ntheta, dtheta)
int nl # Number of degrees (lmax+1)
int ntheta # Number of colatitude values.
real ar[nl,ntheta] # Output array of coefficients.
real dtheta # Colatitude increment (radians)int lmax # Maximum degree.
int itheta # Index in the theta direction
real ctheta # Cos(current theta).
real pl_minus_1 # Value of pl in previous iteration.
real pl # Current value of pl.
int l # Index for degree.
begin
lmax = nl - 1 for (itheta=1; itheta<=ntheta; itheta=itheta+1)
{ ctheta = cos (dtheta * (itheta-1))
pl_minus_1 = 1
pl = ctheta
ar[1,itheta] = pl_minus_1
ar[2,itheta] = pl
for (l=1; l<=lmax-1; l=l+1)
{ ar[l+2,itheta] = ((2*l+1)*ctheta*pl - l*pl_minus_1) / (l+1)
pl_minus_1 = pl
pl = ar[l+2,itheta]
ar[l+2,itheta] = ar[l+2,itheta] * sqrt ((2.*l+3)/2)
}
ar[1,itheta] = ar[1,itheta] * sqrt (1/2.)
ar[2,itheta] = ar[2,itheta] * sqrt (3/2.)
}
end

 
Profile Email
 Quote
fitz
 07/14/2010 08:09PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Tom, The message was reported a few times before and seems to be somewhat related to the use of AMD machines and/or certain versions of GCC (specificall 4.2 or newer). We don't have a wide variety of 64-bit machines here so I haven't been able to fully test how to build in the most cross-platform manner. In any event.... This appears to be a compiler optimizer bug of some kind, but I haven't tracked down specifically what's getting screwed up or where. In any case, all you should need to do is edit the hlib$mkpkg.inc file and add a "-x" flag to the XFLAGS definition for the linux64 arch, i.e.[code:1:a9d2d08647]
:
$else $ifeq (MACH, linux64) then
$set XFLAGS = "-x -c -w -/g -/m64" # default XC compile flags
:
[/code:1:a9d2d08647]If you still see the problem after this let me know (don't forget to remove the existing binaries in the package!).Cheers,
-Mike

 
Profile Email
 Quote
duvall
 07/14/2010 08:09PM  
+++--
Chatty

Status: offline


Registered: 03/08/2006
Posts: 59
Mike,
Thanks, that fixed the problem. I'm now able to get an executable. Now to test 105 tasks!
Tom

 
Profile Email
 Quote
   
Content generated in: 0.12 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login