Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29249 Diskussionen

Compiler directives with 8.1 under WinXP

connell
Einsteiger
519Aufrufe

I have some library routines that have been compiled with the options -Gm and -iface:nomixed_str_len_arg. I cannot change the compiler options on my main program so am defining an interface with compiler directives. I am using:


cDEC$ATTRIBUTES NOMIXED_STR_LEN_ARG,CVF ::ad45rdgrid

the compiler does not seem to recognise CVF and gives

ifort -unix -fpp:"-m" -DIWIN32 -O2 -I:../../nplot3d/inc -I:../../lib/fileio -I:V:/aero_win32x/esp/include -I:IWIN32 -I:V:/aero_win32x/esp/include/mod -I:C:/Apps/Tcl/include -I:C:/Apps/Tcl/include -I:/src/include -c -nologo -convert:big_endian -fpe:3 -traceback -MD -recursive hdf_util.F object:IWIN32/hdf_util.o
hdf_util.F(2216) : Error: Not a valid attribute for the DEC$ ATTRIBUTES directive. [CVF]
cDEC$ATTRIBUTES NOMIXED_STR_LEN_ARG,CVF ::ad45rdgrid
------------------------------------^

0 Kudos
3 Antworten
Steven_L_Intel1
Mitarbeiter
519Aufrufe

There is no such attribute CVF. There should be, but there isn't. Use this instead:

!DEC$ ATTRIBUTES STDCALL,REFERENCE,NOMIXED_STR_LEN_ARG,DECORATE,ALIAS:"AD45RDGRID" :: ad45rdgrid

connell
Einsteiger
519Aufrufe

I tried this and have another problem. Consider the following main routine

interface
subroutine sub1(ch,int,real)
#if defined (IWIN32)
cDEC$ATTRIBUTES STDCALL,REFERENCE,NOMIXED_STR_LEN_ARG :: sub1
cDEC$ATTRIBUTES DECORATE :: sub1

cDEC$ATTRIBUTES ALIAS:'SUB1' :: sub1


#endif
character*32 ch
integer int
real real
end subroutine sub1
end interface

character*32 ch

ch = 'character test'
int = 1
real = 999.0
call sub1(ch,int,real)
stop
end

and the subroutine

subroutine sub1(ch,int,real)
character*(*) ch
write(6,*)ch,int,real
return
end

If I compile the subroutine with -iface:cvf and the main routine without -iface:cvf then it links but will not run

connell
Einsteiger
519Aufrufe
Forget my last post - I think something is messed up in the library
Antworten