comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Building sharable object libraries for CALL_EXTERNAL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Building sharable object libraries for CALL_EXTERNAL [message #14591] Fri, 12 March 1999 00:00 Go to next message
Octavi Fors is currently offline  Octavi Fors
Messages: 13
Registered: March 1999
Junior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hello,
<p>This is my first trial calling a C-routine from IDL with CALL_EXTERNAL,
and I have some problems with building <i>routine.so</i> file. It's just
a test, so the routine it's very simple:
<p><font size=-1>#include &lt;math.h></font>
<br><font size=-1>#include &lt;stdio.h></font>
<br><font size=-1>#include &lt;stdlib.h></font>
<br><font size=-1>#include &lt;fcntl.h></font>
<br><font size=-1>#include &lt;sys/types.h></font>
<br><font size=-1>#include &lt;sys/stat.h></font>
<br><font size=-1>#include &lt;string.h></font><font size=-1></font>
<p><font size=-1>float** routine(argc,argv)</font>
<br><font size=-1>int argc;</font>
<br><font size=-1>void *argv[];</font>
<br><font size=-1>{</font>
<br><font size=-1>int n, x, y;</font>
<br><font size=-1>float *input;</font>
<br><font size=-1>float **output;</font>
<br><font size=-1>int i,j;</font><font size=-1></font>
<p><font size=-1>&nbsp;input = (float *) argv[0];</font>
<br><font size=-1>&nbsp;n=*(int *) argv[1];</font>
<br><font size=-1>&nbsp;x=*(int *) argv[2];</font>
<br><font size=-1>&nbsp;y=*(int *) argv[3];</font><font size=-1></font>
<p><font size=-1>&nbsp;output=(float **)malloc(4*n);</font>
<br><font size=-1>&nbsp;for(i=0;i&lt;n;i++) output[i]=(float*)malloc(4*x*y);</font><font size=-1></font>
<p><font size=-1>for(j=0;j&lt;n;++j)</font>
<br><font size=-1>for(i=0;i&lt;x*y;++i)</font>
<br><font size=-1>output[j][i]=input[i];</font><font size=-1></font>
<p><font size=-1>return(output);</font>
<br><font size=-1>}</font>
<p>First, I try to create routine.o with:
<br><font size=-1>$ cc -pic -fsingle -c routine.c</font>
<br>no problem.
<p>Second, when I try to create routine.so with:
<br><font size=-1>$ ld -o routine.so -z text routine.o (changing '-assert
pure-text' to '-z text' because it's a SunOS Version 5.5.1)</font>
<br><font size=-1> Undefined&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& amp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& amp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& amp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
first referenced</font>
<br><font size=-1> &nbsp;symbol&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
in file</font>
<br><font size=-1> malloc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
routine.o&nbsp; (symbol belongs to implicit dependency /usr/lib/libc.so.1)</font>
<br><font size=-1> .mul&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;
routine.o&nbsp; (symbol belongs to implicit dependency /usr/lib/libc.so.1)</font>
<br><font size=-1> mcount&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
routine.o</font>
<br><font size=-1>ld: fatal: Symbol referencing errors. No output written
to routine.so</font><font size=-1></font>
<p>It seems to need /usr/lib/libc.so.1. So I add it in the command line:
<br><font size=-1>$ ld -o routine.so -z text routine.o /usr/lib/libc.so.1</font>
<br><font size=-1> Undefined&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& amp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& amp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& amp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
first referenced</font>
<br><font size=-1> &nbsp;symbol&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
in file</font>
<br><font size=-1> mcount&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
routine.o</font>
<br><font size=-1>ld: fatal: Symbol referencing errors. No output written
to routine.so</font><font size=-1></font>
<p>Malloc error is gone, but mcount (?) remains. Does anybody know what's
wrong with it?
<p>Thans in advance,
<p>Octavi.
<pre>--&nbsp;
============================================================ =====

Octavi Fors Aldrich

Astronomy Department</pre>

<pre>Physics Faculty</pre>

<pre>Avgda. Diagonal 647
08028 Barcelona
SPAIN

Telf: 34-934021122
Fax:&nbsp; 34-934021133
e-mail: octavi@fajnm1.am.ub.es

============================================================ ===== </pre>
&nbsp;</html>
Re: Building sharable object libraries for CALL_EXTERNAL [message #14635 is a reply to message #14591] Wed, 17 March 1999 00:00 Go to previous messageGo to next message
rmlongfield is currently offline  rmlongfield
Messages: 68
Registered: August 1998
Member
In article <36E9649A.7F5C8B65@fajnm1.am.ub.es>,
Octavi Fors <octavi@fajnm1.am.ub.es> wrote:
> Hello,
>
> This is my first trial calling a C-routine from IDL with CALL_EXTERNAL,
> and I have some problems with building routine.so file. It's just a
> test, so the routine it's very simple:

Hello Octavi, I am a few days late, but do not know if you have solved your
problem. I work on an SGI and have the following Makefile,where grouptest is
your example program. I recall that it took a lot of testing and searching in
the SGI man pages to find the right flags. It was a lot simpler than the
sample programs provided by IDL. --------------------------------- LDFLAGS=
-lm

OBJS = grouptest.o

grouptest : $(OBJS)
ld -shared -o grouptest.so $(OBJS) $(LDFLAGS)

grouptest.o : grouptest.c
cc -c -KPIC grouptest.c -o grouptest.o


This compiles ok on my SGI. When run from IDL, the only problem is with the
returned value of output.

--IDL sample file ---->
pro grouptest
a = FLOAT(1.4)
b= LONG(2)
c = LONG(7)
d = LONG(9)
output = CALL_EXTERNAL('grouptest.so','grouptest',a,b,c,d)
print,'Returned value from group test: ',output
end
-------------------------

If you can search back in this newsgroup a couple of months (Dejanews, for
example, can be used to search archives) you will find a lot of discussion
about CALL_EXTERNAL and pointers. Maybe it is different for a SUN, but I am
pretty sure that you cannot pass a pointer with the C return statement. Note
also that all memory for variables sent through CALL_EXTERNAL must first be
specified in IDL. This may also be a source of error. Another note is that,
if you change your C code, you must exit IDL before running again from within
IDL.

I use CALL_EXTERNAL with C and Fortran programs in a simple way which works.
Please feel free to ask further questions and I will try to help.

Good Luck!
Rose

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Re: Building sharable object libraries for CALL_EXTERNAL [message #14654 is a reply to message #14591] Mon, 15 March 1999 00:00 Go to previous messageGo to next message
korpela is currently offline  korpela
Messages: 59
Registered: September 1993
Member
In article <36EAAE98.8F975873@fajnm1.am.ub.es>,
Octavi Fors <octavi@fajnm1.am.ub.es> wrote:
>
> I tried your advice with -G flag:
>
> $ld -o routine.so -z text -G routine.o
> Text relocation remains referenced
> against symbol offset in file
> <unknown> 0x1c routine.o
> <unknown> 0x20 routine.o
> .mul 0xb0 routine.o
> .mul 0x120 routine.o
> mcount 0x28 routine.o
> ld: fatal: relocations remain against allocatable but non-writable sections

Hmmmm. I just tried your routine with gcc, (we don't have Sun's compilers)
% uname -a
SunOS sagan 5.6 Generic_105181-09 sun4u sparc SUNW,Ultra-5_10
% gcc -fPIC -c routine.c
% /usr/ucb/ld -o t1.so -z text -G routine.o

Under gcc, -fPIC and -fpic generate different code. Could that be the
problem?

Eric
--
Eric Korpela | An object at rest can never be
korpela@ssl.berkeley.edu | stopped.
<a href="http://sag-www.ssl.berkeley.edu/~korpela">Click for home page.</a>
Re: Building sharable object libraries for CALL_EXTERNAL [message #14670 is a reply to message #14591] Sat, 13 March 1999 00:00 Go to previous messageGo to next message
Octavi Fors is currently offline  Octavi Fors
Messages: 13
Registered: March 1999
Junior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
"Eric J. Korpela" wrote:
<blockquote TYPE=CITE>In article &lt;36E9649A.7F5C8B65@fajnm1.am.ub.es>,
<br>Octavi Fors&nbsp; &lt;octavi@fajnm1.am.ub.es> wrote:
<br>>
<br>>Hello,
<br>>
<br>>This is my first trial calling a C-routine from IDL with CALL_EXTERNAL,
<br>>and I have some problems with building routine.so file. It's just
a
<br>>test, so the routine it's very simple:
<br>>
<br>>Second, when I try to create routine.so with:
<br>>$ ld -o routine.so -z text routine.o (changing '-assert pure-text'
to
<br>>'-z text' because it's a SunOS Version 5.5.1)
<p>I think you need to specify the -G flag to ld when creating a shared
<br>object file under Solaris.</blockquote>
I tried your advice with -G flag:
<p><font size=-1>$ld -o routine.so -z text -G routine.o<br>
Text relocation remains&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
referenced<br>
&nbsp;&nbsp;&nbsp; against symbol&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
offset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in file<br>
&lt;unknown> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
0x1c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; routine.o<br>
&lt;unknown> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
0x20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; routine.o<br>
.mul&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;
0xb0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; routine.o<br>
.mul&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;
0x120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp; routine.o<br>
mcount&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0x28&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; routine.o<br>
ld: fatal: relocations remain against allocatable but non-writable sections</font><br>
<BR>
<br>but it also seems to fail. The error message seems to indicate some
problem with
<br>relocations. What do you think?
<br>Taking a look at the routine.c code (it's in the first message), I
noticed that the
<br>**pointer (output) I'm passing back to IDL is malloced in the C-routine,
in line:
<p><font size=-1>output=(float **)malloc(4*n);</font>
<br><font size=-1>&nbsp;for(i=0;i&lt;n;i++) output[i]=(float*)malloc(4*x*y);</font><font size=-1></font>
<p>Is there something wrong with this?
<br>I tried not to malloc output inside routine.c (commenting previous
lines), but last
<br>error messages still remains.
<p>Any ideas are welcome.
<p>Octavi.
<p>--&nbsp;<br>
============================================================ ===== <br>
<br>
Octavi Fors Aldrich<br>
<br>
Astronomy Department
<br>Physics Faculty
<br>Avgda. Diagonal 647<br>
08028 Barcelona<br>
SPAIN<br>
<br>
Telf: 34-934021122<br>
Fax:&nbsp; 34-934021133<br>
e-mail: octavi@fajnm1.am.ub.es<br>
<br>
============================================================ =====
<br>&nbsp;</html>
Re: Building sharable object libraries for CALL_EXTERNAL [message #14697 is a reply to message #14591] Mon, 22 March 1999 00:00 Go to previous message
Dr. G. Scott Lett is currently offline  Dr. G. Scott Lett
Messages: 14
Registered: February 1998
Junior Member
I don't think this is true. Functions like IDL_MakeStruct(),
IDL_ImportArray() and IDL_ImportNamedArray(),
are handy for building IDL variables with memory you allocate.

However, the following code will most likely not produce the desired
results. Reading the External Development Guide is a recommended first
step, especially the chapter on IDL Internals: Variables.

> output=(float **)malloc(4*n);
> for(i=0;i<n;i++) output[i]=(float*)malloc(4*x*y);


Scott


>
> I thought it was a no-no to allocate memory inside of an external
> routine, that is to be passed back to IDL. The Advanced Developer's
> Guide has always stated that all memory must be allocated prior to
> calling the routine. Is that not always the case?
>
> Even if you get this to compile, I would be very wary of the results.
>
> 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
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
Re: Building sharable object libraries for CALL_EXTERNAL [message #14699 is a reply to message #14670] Mon, 22 March 1999 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Octavi Fors wrote:

> Taking a look at the routine.c code (it's in the first message), I
> noticed that the
> **pointer (output) I'm passing back to IDL is malloced in the
> C-routine, in line:
>
> output=(float **)malloc(4*n);
> for(i=0;i<n;i++) output[i]=(float*)malloc(4*x*y);
>
> Is there something wrong with this?

I thought it was a no-no to allocate memory inside of an external
routine, that is to be passed back to IDL. The Advanced Developer's
Guide has always stated that all memory must be allocated prior to
calling the routine. Is that not always the case?

Even if you get this to compile, I would be very wary of the results.

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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
Re: Building sharable object libraries for CALL_EXTERNAL [message #14727 is a reply to message #14591] Thu, 18 March 1999 00:00 Go to previous message
Octavi Fors is currently offline  Octavi Fors
Messages: 13
Registered: March 1999
Junior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
"Eric J. Korpela" wrote:
<blockquote TYPE=CITE>In article &lt;36EAAE98.8F975873@fajnm1.am.ub.es>,
<br>Octavi Fors&nbsp; &lt;octavi@fajnm1.am.ub.es> wrote:
<br>>
<br>>I tried your advice with -G flag:
<br>>
<br>>$ld -o routine.so -z text -G routine.o
<br>>Text relocation remains&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
referenced
<br>>&nbsp;&nbsp;&nbsp; against symbol&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
offset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in file
<br>>&lt;unknown> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
0x1c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; routine.o
<br>>&lt;unknown> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
0x20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; routine.o
<br>> .mul&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;
0xb0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; routine.o
<br>> .mul&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;
0x120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp; routine.o
<br>> mcount&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0x28&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; routine.o
<br>>ld: fatal: relocations remain against allocatable but non-writable
sections
<p>Hmmmm.&nbsp; I just tried your routine with gcc, (we don't have Sun's
compilers)
<br>% uname -a
<br>SunOS sagan 5.6 Generic_105181-09 sun4u sparc SUNW,Ultra-5_10
<br>% gcc -fPIC -c routine.c
<br>% /usr/ucb/ld -o t1.so -z text -G routine.o
<p>Under gcc, -fPIC and -fpic generate different code.&nbsp; Could that
be the
<br>problem?
<p>Eric
<br>--
<br>Eric Korpela&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|&nbsp; An object at rest can never be
<br>korpela@ssl.berkeley.edu &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|&nbsp; stopped.
<br>&lt;a href="<a href="http://sag-www.ssl.berkeley.edu/~korpela">http://sag-www.ssl.berkeley.edu/~korpela</a>">Click
for home page.&lt;/a></blockquote>
Hello!
<p>Talking with my system manager, he told me that the right compilation
option is SunSolaris instead SusOs (in IDL Users Guide 4.0 they are considered
separately). In that way, I proceed with the SunSolaris options, described
in the IDL Users Guide:
<p><font size=-1>$ uname -a</font>
<br><font size=-1>SunOS mizar 5.5.1 Generic_103640-05 sun4u sparc SUNW,Ultra-Enterprise</font>
<p><font size=-1>$ cc -G -Kpic -c routine.c</font>
<br><font size=-1>$ ld -G -o routine.so routine.o</font><font size=-1></font>
<p>and no problem!
<p>Thanks all!
<pre>--&nbsp;
============================================================ =====

Octavi Fors Aldrich

Departament d'Astronomia i Meteorologia
Facultat de Fisica
Avgda. Diagonal 647
08028 Barcelona
SPAIN

Telf: 34-934021122
Fax:&nbsp; 34-934021133
e-mail: octavi@fajnm1.am.ub.es

============================================================ ===== </pre>
&nbsp;</html>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Writing on X without X device (!)
Next Topic: Re: Colour maps ... (BYTE_SCALE)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:46:43 PDT 2025

Total time taken to generate the page: 0.00834 seconds