WordPress informs me Creating fortran DLL in microsoft visual studio with intel fortran compiler is my top post of 2011!!
This is one post I did just to let people know how to use visual studio to get fortran DLL and use it in excel.
I thought I should revisit that topic again.
I believe many won’t and don’t use visual studio. They just want to use intel fortran compiler to create their fortran dll’s.
So here’s a non GUI way that show how to create fortran dll’s via the command line using intel compiler.
I will be using this make batch file to create a dll from a fortran program.
No visual studio. Just the intel compiler is enough.
The make batch file automates the following steps.
Compile
ifort /nologo /iface:stdcall /libs:dll /threads /c filename.f
Link
link /NOLOGO /SUBSYSTEM:WINDOWS /manifest /dll /out:filename.dll filename.obj
Generate manifest
mt /nologo “/outputresource:filename.dll;#2″ /manifest filename.dll.manifest
Here’s the zip file containing the example of that fortran dll and the excel file using it.
Enjoy. Any queries or suggestion, drop in your comments.
Dear Sukhbinder,
This is not specifically to this current post. It is really great that you are doing your bits to keep alive the art of FORTRAN programming. In this context, you may also visit, http://cdeaglejr.wordpress.com/ if you have not done so already.
Waiting for your next post, but till then with best wishes,
Priyankar
LikeLike
Thanks for sharing… Good share indeed…
LikeLike
Pingback: Fortran DLL and Excel « SukhbinderSingh.com
Pingback: 2012 in Review « SukhbinderSingh.com
This topic is a lifesaver! Thank you very much!
Daniel
LikeLike
Do you have any example fortran code of a dynamic library called from excel 2011 vba in osx?
Do you know a good place to get gfortran 32bit for osx 10.9.2?
If using intel fortran in osx:
I am having trouble determining where to place a compiled *.dylib for excel to see. I’m not sure this is even the right way to create the dynamic library.
Thanks for your help.
-Bryan
LikeLike
Thanks Bryan. Haven’t tried it so far, but I think these links in the blog should help…..
Installing gfortran on Mac OS X Mavericks
https://sukhbinder.wordpress.com/2013/11/25/installing-gfortran-on-mac-os-x-mavericks/
Few Toy Programs to Mesh Excel and Fortran together
https://sukhbinder.wordpress.com/2014/02/07/few-toy-programs-to-mesh-excel-and-fortran-together/
LikeLike