Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28633 Discussions

ifort compiler options for Ansys Programe

haijunwu
Beginner
1,233 Views

Hi, 

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

1. what are the options:  -D__EFL -DNOSTDCALL -DARGTRAIL -DPCWINNT_SYS -DPCWIN64_SYS -DPCWINX64_SYS -DCADOE_ANSYS /DFORTRAN?

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,

0 Kudos
1 Solution
Lorri_M_Intel
Employee
1,233 Views

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)
...
#endif

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 "/"  :-)

           --Lorri

 

View solution in original post

0 Kudos
4 Replies
Lorri_M_Intel
Employee
1,234 Views

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)
...
#endif

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 "/"  :-)

           --Lorri

 

0 Kudos
haijunwu
Beginner
1,233 Views

Lorri, 

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.

0 Kudos
TimP
Honored Contributor III
1,233 Views

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.

0 Kudos
Steven_L_Intel1
Employee
1,233 Views

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

0 Kudos
Reply