Call_External and Re-Compiling C programs [message #12546] |
Thu, 20 August 1998 00:00  |
rmlongfield
Messages: 68 Registered: August 1998
|
Member |
|
|
Hi Everyone,
I've had some suucess using CALL_EXTERNAL to input IDL data to
a C program and recieve a result.
My problem is, when I use SPAWN to compile a C program, the
executable is not redefined within IDL. When I edit the C program and wish to
recompile, it doesn't work. I have to exit IDL to get rid of it.
-----------------------------
The IDL program is as follows:
PRO test
sh_command = 'testfile.sh'
c_command = 'testp'
SPAWN,sh_command
x=23
y=33
result = CALL_EXTERNAL('testp.so','testp',x,y)
print,'Result passed to IDL: ',result
help,/routines
end
++++++The shell program testfile.sh is:
rm *.o
rm *.so
echo Object files removed
cc -c -KPIC testp.c
ld -shared -o testp.so testp.o -lm
echo Finished compiling
# produces testp.o and testp.so
+++++++The output for all of this is:
IDL> test
Object files removed
Finished compiling
*__________________________________________
*____Value of argc: 2
*____Value of argv: 23
*____Value of argv: 33
*___________________________________________
Result passed to IDL: 56
Compiled Procedures:
$MAIN$
TEST
Compiled Functions:
Question: Does anyone know how to un-define the compiled procedures?
Thanks
Rose Dlh... (dlhopols@DELETE_THISknmi.nl)
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
|
|
|
Re: Call_External and Re-Compiling C programs [message #12609 is a reply to message #12546] |
Mon, 24 August 1998 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
rmlongfield@my-dejanews.com wrote:
>
> Hi Everyone,
> I've had some suucess using CALL_EXTERNAL to input IDL data to
> a C program and recieve a result.
>
> My problem is, when I use SPAWN to compile a C program, the
> executable is not redefined within IDL. When I edit the C program and wish to
> recompile, it doesn't work. I have to exit IDL to get rid of it.
As far as I know, there is no way to get around this. When you
recompile a shared-object module, you must exit IDL and start
over.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|