How to create fortran dll in commandline with intel fortran compiler?

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.


ifort /nologo /iface:stdcall /libs:dll /threads /c filename.f


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.

Download the example and batch file

7 thoughts on “How to create fortran dll in commandline with intel fortran compiler?

  1. Pingback: Fortran DLL and Excel «

  2. Pingback: 2012 in Review «

  3. 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.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s