Software Archive
Read-only legacy content
17061 Discussions

Mixed mode linking

Intel_C_Intel
Employee
237 Views
Hi

We create a library of subroutines compiled using all of the defaults for names, underscores etc

We have a customer who wishes to link to this library but his in-house
conventions mean that he needs to compile using

/assume:underscore
/iface:nomixed_str_len_arg
/iface:cref
/names:lowercase

He has got around most of the problems by creating some wrappers
like this

SUBROUTINE dienam_(IDENUM,INAME,IUNT,IEXIT)
DIMENSION INAME(*)
CALL DIENAM(IDENUM,INAME,IUNT,IEXIT)
RETURN
END

which he compiles with /names:as_is

The problem is with character arguments. We cannot work out how
to compile his code with /iface:nomixed_str_len_arg

an access our code with 'string length after argument'

Any suggestions would be most welcome

TIA

Geoff
0 Kudos
2 Replies
Steven_L_Intel1
Employee
237 Views
One way would be for you to provide a MODULE with INTERFACEs to your routines - and for each routine, add:

!DEC$ ATTRIBUTES DEFAULT

to its interface block. This was new in 6.1A, so you need to be at that version or higher.

The customer would then have to USE your module to get the declarations, instead of the wrappers.

Another way is to write the wrapper something like this:

SUBROUTINE somesub_ (CHARARG,INTARG)
CHARACTER*(*) CHARARG
INTEGER INTARG
CALL SOMESUB (%REF(CHARARG),%VAL(LEN(CHARARG)),INTARG)
END


If the %REF doesn't work, use %VAL(LOC(CHARARG))

Steve
0 Kudos
Intel_C_Intel
Employee
237 Views
Steve

Thanks for the ideas, I will give them a go.

Geoff
0 Kudos
Reply