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.

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.

Download the example and batch file

About these ads

Tagged: , , ,

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

  1. collisionavoidance January 21, 2012 at 7:06 am Reply

    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

    • sukhbinder January 27, 2012 at 1:24 pm Reply

      Thanks for sharing… Good share indeed…

  2. […] How to create fortran DLL with intel compiler without visual studio? […]

  3. 2012 in Review « SukhbinderSingh.com January 4, 2013 at 4:20 pm Reply

    […] How to create fortran dll in commandline with intel fortran compiler? […]

  4. Daniel January 15, 2014 at 11:00 pm Reply

    This topic is a lifesaver! Thank you very much!
    Daniel

  5. Bryan Baker March 12, 2014 at 7:23 pm Reply

    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

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,026 other followers

%d bloggers like this: