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

option compilation not added with Intel fortran compiler + msvc

grimgort
Beginner
1,266 Views

Hello,

I have a big problem to add compilation options with the compiler intel fortran +msvc .
When I add compilation options, they are not taken into account in visual studio (see picture). A certain number of options are put in “additional Option”.

2021-02-11 11_18_53-Matisse - Microsoft Visual Studio.png

in my code, I wrote :

    list(APPEND f_compile_flags /names:lowercase /iface:cref /assume:underscore /libs:static /INCREMENTAL:NO /assume:byterecl /Qinit:zero /MT)
target_compile_options(ck_io_fortran PRIVATE ${f_compile_flags})

We can notice that /iface:cref is taken into account but not the other options. What is my error?

0 Kudos
4 Replies
Arjen_Markus
Honored Contributor I
1,254 Views

This looks suspiciously like a VS project you generate with CMake. I am not familiar with the default options that CMake produces, but I can imagine that /iface:cref is introduced as a default rather than anything selected from your settings.

To test that: leave out the list(...) command - or the target_compile_options(...) command and try again. I do not know what is going wrong, but the problem is definitely on the side of CMake, not VS or the Intel compiler.

0 Kudos
grimgort
Beginner
1,247 Views
I have already do that. Cref option is not set if i leave blank ligne. I think option is take but not in ihm interface
0 Kudos
mecej4
Honored Contributor III
1,236 Views

Whether it is Cmake or some other culprit in the build system, I am not able to tell, but the command line options are seriously messed up.

In your screen shot, in the upper pane, you have /I"NCREMENTAL:NO". It appears that some options intended for use by the linker are being sent to the compiler, instead, but also with additional corruption because of the quotation marks. If you wish to specify compiler and linker options in a single command line, you need to place all the compiler options first, then a /link option, followed by the linker options.

The compiler interprets the string following /I as an include directory; /INCREMENTAL:NO, without any embedded quotation marks, is a linker option.

0 Kudos
grimgort
Beginner
1,218 Views

i have fix error but not fix problem

0 Kudos
Reply