-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
!DEC$ attributes dllexport
is not standard Fortran
#70
Comments
yes, fortran does not seem to have a standard way to export symbols for windows (which allows for shared libs) |
In gtk-fortran, we have similar directives for GFortran: !GCC$ ATTRIBUTES DLLEXPORT :: destroy I guess the standard says nothing about linking, which is a mechanism related to compilers and OS. |
Thank you @vmagnin for your comments and for sharing your experiences. @jschueller is proposing a fix with a |
In the PLplot project on SourceForge (https://plplot.sourceforge.net/) we use .def files as well to control this. Compiler directives are by definition compiler-specific and the linking mechanism that is responsible is independent of what a language standard like Fortran's covers. Note that .def files themselves are also specific - for instance because they should contain the externally visible name of the routines, which includes the name of the module. |
Thank you @arjenmarkus for your sharing! Welcome to give comments on the PR by Julien. |
Thanks @arjenmarkus for pointing this functionality. I will read those docs: |
WINDOWS_EXPORT_ALL_SYMBOLS wont work |
This team may want to follow up again with Intel Fortran support at their forum for their current thinking and feedback on this and decide on the best course of action. My recommendation is to avoid cluttering Fortran code with preprocessor directives as much as possible. In the case of Windows OS and dynamic (shared) library exported symbols, I recommend the Microsoft module definition .DEF file solution as shown here. Note the warning is issued by the Intel Fortran compiler when the compiler option module m
contains
subroutine sub()
!dir$ attributes dllexport :: sub
end subroutine
end module
|
Hi @FortranFan , thank you for your comments and detailed instructions. According to
the opinion of Intel seems quite clear to me. I am not sure re-posting the same question would change it a lot. Thanks. Zaikun |
No worries. In this context at least the The point with the Intel team is the opinion dates back more than a decade and perhaps the current team sees it differently now. I always felt Intel's opinion and warning was rather lame in the context of standards checking, for the standard is clear the comment line has no interpretation from a standard point-of-view. |
Hi @jschueller Julien and @amontoison Alexis,
!DEC$ attributes dllexport
is not standard Fortran.For example, with 6e9b334 , running
we will get
How to fix this? Is there a standard-conforming way to do the same?
In general, PRIMA does not tolerate warnings --- each warning is considered a (future) bug. In addition, PRIMA uses only standard Fortran, conforming to F2008 as of September 2023.
Thanks.
Zaikun
The text was updated successfully, but these errors were encountered: