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

Home » Public Forums » archive » Re: gcc and call_external on solaris ?
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
Re: gcc and call_external on solaris ? [message #3556] Thu, 23 February 1995 16:06 Go to next message
roughan is currently offline  roughan
Messages: 2
Registered: June 1994
Junior Member
In article <3id6r7$8gr@hammer.msfc.nasa.gov>, chaganti@ssl.msfc.nasa.gov writes:
Path: vail.levels.unisa.edu.au!fang.dsto.gov.au!yoyo.aarnet.edu.au !harbinger.cc.monash.edu.au!msunews!agate!howland.reston.ans .net!news.moneng.mei.com!uwm.edu!news.alpha.net!news.mathwor ks.com!news.duke.edu!convex!bcm!news.msfc.nasa.gov!sslmor.ms fc.nasa.gov!not-for-mail
From: chaganti@ssl.msfc.nasa.gov
Newsgroups: comp.lang.idl-pvwave
Subject: gcc and call_external on solaris ?
Date: Wed, 22 Feb 95 03:41:03 GMT-9:30
Organization: Space Science Lab, Marshall Space Flight Center, Huntsville, Al
Lines: 6
Message-ID: <3id6r7$8gr@hammer.msfc.nasa.gov>
Reply-To: chaganti@ssl.msfc.nasa.gov
NNTP-Posting-Host: sslmor.msfc.nasa.gov

> Hi! IDL GURUS

> Could some one give me an example for makeing sharable object for IDL
> call_external with SOLARIS OS.

> We have only gcc/g++ compiler. The IDL document does not mention
> about gcc.

I'd like to know how to do the same thing on a DEC ALPHA AXP, running
OSF/1.

Thanks,
Matt

--
============================================================ ============
Matthew Roughan
Cooperative Research Center for Sensor Signal and Information Processing
SPRI Building,Technology Park Adelaide,The Levels,South Australia, 5095
PH: (+61 8) 302 3587 FAX: (+61 8) 302 3124
EMAIL: roughan@cssip.edu.au
============================================================ ============
Re: gcc and call_external on solaris ? [message #3735 is a reply to message #3556] Tue, 28 February 1995 02:22 Go to previous message
sjt is currently offline  sjt
Messages: 72
Registered: November 1993
Member
Matt Roughan (roughan@vail.cssip.edu.au) wrote:

: In article <3id6r7$8gr@hammer.msfc.nasa.gov>, chaganti@ssl.msfc.nasa.gov writes:
: Path: vail.levels.unisa.edu.au!fang.dsto.gov.au!yoyo.aarnet.edu.au !harbinger.cc.monash.edu.au!msunews!agate!howland.reston.ans .net!news.moneng.mei.com!uwm.edu!news.alpha.net!news.mathwor ks.com!news.duke.edu!convex!bcm!news.msfc.nasa.gov!sslmor.ms fc.nasa
.gov!not-for-mail
: From: chaganti@ssl.msfc.nasa.gov
: Newsgroups: comp.lang.idl-pvwave
: Subject: gcc and call_external on solaris ?
: Date: Wed, 22 Feb 95 03:41:03 GMT-9:30
: Organization: Space Science Lab, Marshall Space Flight Center, Huntsville, Al
: Lines: 6
: Message-ID: <3id6r7$8gr@hammer.msfc.nasa.gov>
: Reply-To: chaganti@ssl.msfc.nasa.gov
: NNTP-Posting-Host: sslmor.msfc.nasa.gov

: >Hi! IDL GURUS

: >Could some one give me an example for makeing sharable object for IDL
: >call_external with SOLARIS OS.

: >We have only gcc/g++ compiler. The IDL document does not mention
: >about gcc.

: I'd like to know how to do the same thing on a DEC ALPHA AXP, running
: OSF/1.

: Thanks,
: Matt

: --
: ============================================================ ============
: Matthew Roughan
: Cooperative Research Center for Sensor Signal and Information Processing
: SPRI Building,Technology Park Adelaide,The Levels,South Australia, 5095
: PH: (+61 8) 302 3587 FAX: (+61 8) 302 3124
: EMAIL: roughan@cssip.edu.au
: ============================================================ ============


The following are extracts from the Solaris/gcc and OSF1 Makefiles for an
I/O system accessed via call_external:

Solaris/gcc:
hsioshr.so: ${HSIO}/hs.c ${HSIO}/hs.h ${HSIO}/hsi.h SUN_5_SET
gcc -fPIC -G -DSOLARIS -o hsioshr.so -I$(HSIO) $(HSIO)/hs.c

OSF1/cc:
hsioshr.so: ${HSIO}/hs.c ${HSIO}/hs.h ${HSIO}/hsi.h OSF_1_SET
cc -DALPHA -c -I$(HSIO) $(HSIO)/hs.c
ld -o example.so -shared example.o


I don't have gcc on an Alpha available.

For various practical reasons (namely that the package must also be
usable from Fortran and C) the C code makes call through stub routines
(e.g.:

#if defined(SUN) || defined(ALPHA)
/*---------------------------------------------------------- ----+
| iu_open_lanfile is a stub routine for calling open_lanfile_ |
| from IDL on a SUN workstation. |
+----------------------------------------------------------- ---*/

void iu_open_lanfile (argc, argv) /*S*/
int argc; /*S*/
void *argv[]; /*S*/
{ /*S*/
open_lanfile_( (char *) argv[1], /*S*/
(int32 *) argv[2], /*S*/
(int32 *) argv[3], /*S*/
(int32 *) argv[4], /*S*/
(int) argv[5]); /*S*/
} /*S*/
#endif /* SUN */
)

SUN is defined in an include file if SOLARIS is defined

The IDL code is then:
a = call_external (shlib, entry(icode), icode, filesp, long(mode), $
findex, lrecl, l_file, value = pass)

Where shlib and entry are defined as (from a "case (!Version.os) of"):

'sunos': begin
shlib = lib_dir + '/hsioshr.so'
entry = 'iu_' + ['open', 'close', 'read', 'write', 'map', $
'seek', 'err', 'rename', 'vers'] + '_lanfile'

; VN is 4 or 5 according to whether running Sunos 4 or Solaris (defined
; in the driver script for the package).

if (getenv('VN') eq '4') then entry = '_'+entry
end
'OSF': begin
shlib = lib_dir + '/hsioshr.so'
entry = 'iu_' + ['open', 'close', 'read', 'write', 'map', $
'seek', 'err', 'rename', 'vers'] + '_lanfile'
end

The other arguments to the call_external are the arguments passed to the
routine as argv[0..argc] (The non-use of argv[0] in the stub is a
red-herring, it's used in the IBM RS6000 call where there can only be
one entry point per module it, is not a special value like in a C main
program).

I hope some of this makes sense (I'm not sure if it agrees with what the
manuals say about the use of underscores, I just know that it works => if
it doesn't match up then the manuals must be in error).

--
--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 021-414-6462. Fax: 021-414-3722 | |
+----------------------------------------------------------- --+---------+
Re: gcc and call_external on solaris ? [message #3746 is a reply to message #3556] Fri, 24 February 1995 15:04 Go to previous message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <3ij7tc$20n@vail.levels.unisa.edu.au>, roughan@vail.cssip.edu.au (Matt Roughan) writes:
>
> In article <3id6r7$8gr@hammer.msfc.nasa.gov>, chaganti@ssl.msfc.nasa.gov writes:
> Path: vail.levels.unisa.edu.au!fang.dsto.gov.au!yoyo.aarnet.edu.au !harbinger.cc.monash.edu.au!msunews!agate!howland.reston.ans .net!news.moneng.mei.com!uwm.edu!news.alpha.net!news.mathwor ks.com!news.duke.edu!convex!bcm!news.msfc.nasa.gov!sslmor.ms fc.nasa.gov!not-for-mail
> From: chaganti@ssl.msfc.nasa.gov
> Newsgroups: comp.lang.idl-pvwave
> Subject: gcc and call_external on solaris ?
> Date: Wed, 22 Feb 95 03:41:03 GMT-9:30
> Organization: Space Science Lab, Marshall Space Flight Center, Huntsville, Al
> Lines: 6
> Message-ID: <3id6r7$8gr@hammer.msfc.nasa.gov>
> Reply-To: chaganti@ssl.msfc.nasa.gov
> NNTP-Posting-Host: sslmor.msfc.nasa.gov
>
>> Hi! IDL GURUS
>
>> Could some one give me an example for makeing sharable object for IDL
>> call_external with SOLARIS OS.
>
>> We have only gcc/g++ compiler. The IDL document does not mention
>> about gcc.
>
> I'd like to know how to do the same thing on a DEC ALPHA AXP, running
> OSF/1.
>

Look at your IDL distribution! There are example makefiles for BOTH Solaris and
OSF/1 provided with the IDL distribution in the $IDL_DIR/misc/dynamic_link
directory.

____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Aitoff Projections
Next Topic: Button (etc.) events

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

Current Time: Fri Oct 10 06:01:14 PDT 2025

Total time taken to generate the page: 1.43827 seconds