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

7 responses to “How to create fortran dll in commandline with intel fortran compiler?”

  1. collisionavoidance Avatar

    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

    Like

    1. sukhbinder Avatar

      Thanks for sharing… Good share indeed…

      Like

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

    Like

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

    Like

  4. Daniel Avatar
    Daniel

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

    Like

  5. Bryan Baker Avatar
    Bryan Baker

    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

    Like

    1. sukhbinder Avatar

      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

      Installing gfortran on Mac OS X Mavericks

      Few Toy Programs to Mesh Excel and Fortran together

      Few Toy Programs to Mesh Excel and Fortran together

      Like

Leave a comment

I’m Sukhbinder

Welcome to my blog, my corner of the internet dedicated to all things that touches my life.

Let’s connect

Design a site like this with WordPress.com
Get started