Welcome to iraf.net Sunday, May 12 2024 @ 08:39 AM GMT


 Forum Index > Help Desk > Systems New Topic Post Reply
 Compiling with xc - code using SLALIB library
   
cfarage
 09/18/2009 01:20AM (Read 4006 times)  
+----
Newbie

Status: offline


Registered: 09/14/2006
Posts: 4
Hi,
I have several SPP scripts that were provided to me (I don't have any experience with writing or compiling SPP code), for calling routines from the SLALIB library for correcting atmospheric refraction effects in spectra. They run ok on our x86_64/Linux computers, but produce errors with running on other systems, which I have been told indicates that they need to be recompiled appropriately for different architectures. I'm having trouble compiling them, however. On my Mac laptop (MacBookPro/Snow Leopard), the task wfpa.x below:[code:1:a5e8817c66]#-------------------------------------------
task wfpa = t_paprocedure t_pa ()double ha, dec, phi
double pa, slpa
double clgetd ()
double clputd ()begin
ha = clgetd ("ha")
dec = clgetd ("dec")
phi = clgetd ("phi")

pa = slPA (ha, dec, phi)
pa = clputd ("pa", pa)end
#-------------------------------------------[/code:1:a5e8817c66]appears to compile successfully as follows:
[code:1:a5e8817c66]wifes> xc -/m32 -lslalib wfpa.x
wfpa.x:
sys_runtask:
t_pa:
wfpa.f:
sysruk:
tpa:
link:[/code:1:a5e8817c66]but when run just exits with: "ERROR: floating point invalid operation".When I try to recompile on the Linux/x86 system, the error below occurs:
[code:1:a5e8817c66]wifes> xc -/m32 -lslalib -d wfpa.x
wfpa.x:
debug: /scisoft/share/iraf/iraf/unix/bin.redhat/xpp.e -R wfpa.x
sys_runtask:
t_pa:
debug: /scisoft/share/iraf/iraf/unix/bin.redhat/rpp.e wfpa.r >wfpa.f
/scisoft/share/iraf/iraf/unix/hlib/f77.sh -c -u -x -f2c /scisoft/share/iraf/iraf/unix/bin.redhat/f2c.e -O -m32 -I/scisoft/share/iraf/iraf/unix/hlib/libc wfpa.f
wfpa.f:
sysruk:
tpa:
link:
gcc -Wl,--defsym,mem_=0 -o T_wfpa.e -m32 -I/scisoft/share/iraf/iraf/unix/hlib/libc /iraf/iraf/bin.redhat/libslalib.a wfpa.o /iraf/iraf/bin.redhat/libmain.o /iraf/iraf/bin.redhat/libex.a /iraf/iraf/bin.redhat/libsys.a /iraf/iraf/bin.redhat/libvops.a /scisoft/share/iraf/iraf/unix/bin.redhat/libos.a /scisoft/share/iraf/iraf/unix/bin.redhat/libf2c.a -lm /scisoft/share/iraf/iraf/unix/bin.redhat/libcompat.a
wfpa.o: In function `tpa_':
wfpa.c:(.text+0x54): undefined reference to `slpa_'
collect2: ld returned 1 exit status[/code:1:a5e8817c66]I think that I just don't know what compiler flags are required for the different systems.
Any help would be much appreciated.Catherine.

 
Profile Email
 Quote
fitz
 09/18/2009 01:20AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
There are known problems with compiling on a 64-bit system, in general it doesn't work however for this little program I was able to compile locally using your exact command line. What we usually suggest is that you build a binary on a 32-bit system and move it, I've done that and put the result for this task in ftp://iraf.noao.edu/pub/wfpa.eI also verified that the 'slpa_' symbol does indeed exist in the iraf slalib and in the binaries distributed in at least the latest SciSoft release. You can check for your self with the command[code:1:89b8edb6cd]
% nm -o /iraf/iraf/bin.redhat/libslalib.a | grep -i slpa
1737:/iraf/iraf/bin.redhat/libslalib.a:pa.o:00000000 T slpa_
1743:/iraf/iraf/bin.redhat/libslalib.a:pav.o:00000000 T slpav_
[/code:1:89b8edb6cd]I do find it strange that your final command line includes both /iraf/iraf and /scisoft/share/iraf/iraf paths to the libraries. This may be a scisoft configuration error but since there is no equivalent /scisoft path to slalib it may also mean your '$iraf' is set incorrectly (i.e. it defines /iraf/iraf but that is an invalid path). Does your .cshrc file source any scisoft setups or do you define things directly? -Mike

 
Profile Email
 Quote
cfarage
 09/18/2009 01:20AM  
+----
Newbie

Status: offline


Registered: 09/14/2006
Posts: 4
Hi Mike,Thanks for your very quick reply. When I copy the 32-bit version that you've compiled and try to run the program (either on my MacBook or the IRAF on the network machines at my institution), the error: "Cannot open connected subprocess (wifes$wfpa.e)" occurs.I would have to ask someone in our IT group about how IRAF is set up on our network (which is the version I was using to try to compile and that produced the error that I provided in my first message). I've been told that it's Scisoft IRAF, but I'm not sure how it's set up. I don't have to make sure that the Scisoft setup is sourced in my .cshrc file, but I expect that's taken care of elsewhere by default for network users. On the Linux machines, the '$iraf' variable is set to /iraf/iraf, but this seems to point to a scisoft directory:
--> /pkg/linux/scisoft-7.3.1/share/iraf/iraf
that contains all the usual IRAF directories (including bin and bin.redhat).
I can find out more details from the system administrators if it would help. Not sure if this is all of any use, but thanks very much for your help.
Catherine.

 
Profile Email
 Quote
   
Content generated in: 0.11 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