Which OS and newbie questions.

Which OS and newbie questions.

Hello everybody,

I am interested in numerical problems and am trying the evaluate version of the Intel Fortran compiler.

I have been an old Fortran 77 user and  I would like to switch back to fortran, since now it also adheres to most of the modern programming paradigms.

I am running the  evaluate version of the Intel® Fortran Composer XE 2013 for OS X*, on my MacBookPro6,2; i5 2.4 GHz with 4GB RAM. I have tried the famous 'hello world' on XCode using a .f90 extension and it compiled and had been executed successfully.

Question: what reference would you reccommend to catch up with Fortran and see how it evolved with dynamic allocation, pointers, OOP etc?

I have just ordered "Modern Fortran Explained (Numerical Mathematics and Scientific Computation) " by Metcalf; do you have any other suggestions to have a quick start with Fortran also as a OO language and specifically on how to leverage to squeeze performance?

Moreover: do you have any reading to suggest (and/or reference) for the numerical libraries included in the Fortran Composer package? How do I call Lapack's libraries, e.g.? Would you be so kind to provide me with some toy examples and/or to point me to some tutorials/online reference/books?

Also, I have been a VS user (C#): is it possilbe to have a similar structure in XCode with Intel Fortran to build projects with several classes etc?

Would it be possible to have a dual boot on my Mac and install some LInux distribution and then Fortran for linux? Similarly, I would like to pose the same question about WIndows: what version of Windows would be preferrable to install Fortran Studio on my Mac running Windows? The reason for asking this is that I am not a big fan of XCode; can you propose me other solutions, under Mac OS X? Or do you reccommend switching to another OS?

Finally, how does intel Fortran compare with gfortran? I am definitely interested in proceeding and buying it but I would like to be sure that it is the right tool and that I have a good grasp to start writing some toy numerical problems, to start with.

Thank you very much indeed  for your help and sorry for the long post.



12 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

MFE is an excellent reference.  There is some material on optimization in the docs which come with ifort; if more is needed, I should add it to my post-retirement project.

Much of MKL library, including lapack, blas, and fftw, is usage compatible with the open source versions and relies on documentation which you should find by a web search.

As several of the most important Fortran compilers are available in similar versions for linux and Mac, it's not obvious what you would gain by adding a linux option.  As Windows 7 X64 runs well under boot camp, it seems a reasonable choice, but you would be paying double or more to run both OS and commercial compilers on both Windows and Mac.

Current versions of gfortran are excellent; you should start by installing Apple gcc then upgrading.  You could check sites such as polyhedron.com for feature and performance comparisons.  ifort gives you a much better selection of performance libraries, while with gfortran you rely largely on building open source versions yourself.


Thank you very much indeed for answering all my questions in such detailed and clear way.

I think I will stick to old Mac OS X, then. I am looking forward to reading MFE and getting my hands dirty.

By the way, when you refer to the docs which come with ifort, are these docs also availabe during the evaluation period? Thank you very much again for your availability.

Yes, all the docs are available during evaluation period.  Some are available on line.  Remember to add site:software.intel.com in your web search if you are looking for those posted by Intel.


Thanks again.

I have some more basic questions.

How to use external modules in a program? How to make use of intel Math's library?

For example:

SUppose I have the following code

file : 'main.f90'

program main

use subMod

print *, k

end program main

and the following file:


module subMod

real :: k = 2.0

end module subMod

I have both files under the same folder and I am using XCode 4.6.1

If I try to compile I have the following error:

error#7013 this module was not generated by any release of this compiler.

Do I have to compile the module beforehand? How to perform this?

Another question: I use Fortran Free Format File, with extension .f90 to have Xcode recognize fortran keywords, but it fails to auto-indent; any advice about the issue?

Finally, please can you point me to a link where it is explained how to use intel  math's library under Mac OS X? I have found

this: http://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/..., but in the example area I have not been able to find examples using XCode, only scripting based. Is it possible to link external libraries from XCode, without getting into scripting?

Sorry for the very basic questions, but I have issues in finding the appropriate documentation.

Thank you very much indeed.



Do not name Fortran source files with the suffix .mod! Rename your second source file to, say, mymod.f90, and compile using the command

$ ifort mymod.f90 main.f90

The compiler will output the module file "submod.mod" and build the a.out executable file.

To use MKL, in simple cases just use the -mkl compiler option. For more complex cases, use the MKL Link Line Advisor.

As mecej4 explained, you must reserve .mod for files created by the compiler.  The same message about "not created by this compiler" would be produced if a .mod file were created by gfortran or some other compiler.

You might take advantage of web search on the subject of Xcode Fortran auto-indentation.  There seems to be agreement that it's not as satisfactory as emacs.  Most of us have our hands full with tools which aren't restricted to Mac platforms.


Thank you very much for your help.

Very useful.

Apparently renaming submod.mod into submod.f90 made the trick, also from XCode.

I have found the MKL Link LIne Advisor and will try experimenting with it. THanks a lot


Thank again, so much.

Can you recommend any other IDE under Mac OS X, to create modular code with iFortran? I am looking for something supporting auto-indentation and plug and play inclusion of external libraries (both Intel's and modules I will write).

Thanks again,


>>$ ifort mymod.f90 main.f90
>>The compiler will output the module file "submod.mod" and build the a.out executable file.

 The compiler may (usually) produce an object file as well (mymod.o).

Jim Dempsey

Photran may work, as it is supported for Xcode gfortran, and some people reported success with ifort on other OS. I don't know anyone who had experience with it, and Intel has not been able to support it directly.


Thank you for pointing this out.


Thank you as usual. I will give it a try.

Leave a Comment

Please sign in to add a comment. Not a member? Join today