Hello,
I am having problems using the extension "!MS$ATTRIBUTES ALIAS" with
Intel's Linux compiler (version 6) inside an INTERFACE, used for
interfacing with C, and am wondering if someone has an idea why.
I want to have a C routine called AllocateTestArray_real and I do not
want to mangle its name to allocatetestarray_real_ on the C side.
According to the manual, the ALIAS attribute will do this. So I try the
interface:
INTERFACE AllocateTestArray
FUNCTION AllocateTestArray_real(n,double_precision)
RESULT(c_pointer)
USE ISO_C_BINDING
!MS$ATTRIBUTES
ALIAS:'AllocateTestArray_real'::AllocateTestArray_real
INTEGER(KIND=C_SIZE_T),INTENT(IN)::n
LOGICAL(KIND=C_BOOL),INTENT(IN)::double_precision
INTEGER(KIND=C_ADDRESS)::c_pointer
END FUNCTION AllocateTestArray_real
END INTERFACE
and then try to call the function:
c_pointer=AllocateTestArray(n*n,(r_wp==r_dp))
and get this very strange error:
In function/entry ALLOCATETESTARRAY_REAL with result name C_POINTER,
ALLOCATETESTARRAY_REAL is specified or referenced illegally
If I remove the attributes line (and mangle the name on the C side),
everything works fine.
What is wrong here?
Thanks,
Aleksandar
--
__________________________________
Aleksandar Donev
Complex Materials Theory Group (http://cherrypit.princeton.edu/)
Princeton Materials Institute & Program in Applied and Computational Mathematics
@ Princeton University
Address:
419 Bowen Hall, 70 Prospect Avenue
Princeton University
Princeton, NJ 08540-5211
E-mail: [log in to unmask]
WWW: http://atom.princeton.edu/donev
Phone: (609) 258-2775
Fax: (609) 258-6878
__________________________________
|