ifort compiler options for Ansys Programe

ifort compiler options for Ansys Programe


I am learning to use Intel FORTRAN command line to compiler ANSYS supplied demonstration programs. 

One of the compiler examples is:

ifort -D__EFL -DNOSTDCALL -DARGTRAIL -DPCWINNT_SYS -DPCWIN64_SYS -DPCWINX64_SYS -DCADOE_ANSYS -Qfpp -4Yportlib -4Ya /nologo /c /Fo.\ /DFORTRAN /MD /include:"%ipath%" %srcfiles%

I get get help and understand the meaning of options:  /nologo, /c, /Fo.\,  /MD, /include

But I have few questions for the the rest


2. As conventions in ifort, options prefixed with dash are for Linux and OS X, and prefixed with slash are for windows OS. Why do they (such as -Qfpp and /c) appear simultaneously?

In addition, I want to link the library created by gfortran compiler. What are the corresponding compiler options of the above command line in gfortran?

Can someone give explanations in details of the above ifort compiler options?

Thanks in advance!

PS: the IVF compiler version is:

Intel(R) Visual Fortran Composer XE 2013 Update 5 Integration for Microsoft Visual Studio* 2012, 13.0.3636.11,

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

Command line options that begin with the letter D (Capitalized D) define macros used by the preprocessor.   The letters following the "D" are the macro that is defined for the preprocessor.

In your code you might have a construct that looks like this:
#if defined (NOSTDCALL)

and the preprocessor would enable the code in-between the #if and #endif because you had passed the /DNOSTDCALL on the command line. That command line switch defines the macro called "NOSTDCALL".

RE: / vs -

Yes, it is true that the Windows convention is to use "/" and the Linux convention is to use "-".   It is an interesting behavior of the Windows version of ifort that it will accept either "/" or "-".  Although we do not advertise that behavior, nor encourage it, sometimes people will post the "-" in examples.

Please use "/"  :-)




Thanks for your reply. Any suggestions for the command line options in gfortran compiler?

There is another static library I need to used is created by gfortran compiler. But the IVF compiler can not link it. I think the alternative way to combine them together is to convert the command lines options in gfortran form and compile it.

You're unlikely to be able to use libraries built by gfortran and ifort together, unless there are no gfortran run-time library dependencies.  The Abaqus distribution for ifort of course has many ifort run time library dependencies. You'd be well outside the range of what Abaqus could support, and this forum is hardly a substitute for Abaqus support.

If you're asking in general whether it may be possible to link Microsoft .obj and .lib files with a gfortran linking setup (and which might be a suitable choice among the gfortran implementations), that goes well beyond the scope of this forum.  It's not simply a matter of command line options.  You might start by looking up how people may have linked MKL with a Windows gfortran.

You cannot link together ifort-compiled objects and gfortran-compiled objects. Please don't try. All Fortran sources must be recompiled by Intel Fortran.

Retired 12/31/2016

Leave a Comment

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