I am using CVF 6.6A on a P3/P4 win 2k/xp system. I have the F95 check enabled. the following dll imports don't work:

!DEC$ ATTRIBUTES STDCALL, ALIAS : '_MPI_SubmitPassword@12', DLLIMPORT :: MPI_SubmitPassword

and generate these errors:
C:TempFORTRAN CRYPTOMARX_MPI.F90(157) : Warning: This directive is not standard F95.
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_MPI_SubmitPassword@12', DLLIMPORT :: MPI_SubmitPassword
C:TempFORTRAN CRYPTOMARX_MPI.F90(166) : Warning: This directive is not standard F95.
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_MPI_ErasePassword@4', DLLIMPORT :: MPI_ErasePassword

What is the new format for these? it appears to not like ATTRIBUTES directive. Honesly, this scares me as to why it wouldn't support this now. I what is the new syntax/requirements to do what i need done?



5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Yes, the DLLIMPORT directives do work. The compiler correctly warns you that they are not standard Fortran 95, but they still function.

We choose to treat directives as if they were statement extensions for the purpose of standards checking because they alter the semantics of the program. You can think of directives as statements with a funny syntax.

My advice is to isolate the interface blocks with the directives in a module, which you then compile without standards checking enabled. Or, put up with the warnings.


Retired 12/31/2016

So if i were to adhere 100% to Fortran 95, it is not possible to call .dll's?

No reason to be worried about -- !DEC$ATTRIBUTES still work, but they've never been part of the Fortran standard and that's what compiler is saying. I'm not sure whether this was checked in earlier versions, but I feel it should be -- although a non-Compaq compiler will ignore them (since they appear as comments), without them semantics of the code will not be the same.

I recommend that you switch off F95 checking when working with mixed-language/dlls. I wish warnings for some stuff could be selectively added/removed :-(...

Your program isn't 100% Fortran 95 because it is calling a DLL from another language. You can get away with not using DLLIMPORT when calling DLL routines, but it looks as if you still need the ALIAS attribute in your code.

As I suggested earlier, you should isolate your non-standard code to a module, so that the rest of the application can be checked for standard conformance.


Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today