Community
cancel
Showing results for 
Search instead for 
Did you mean: 
grimgort
Beginner
124 Views

option compilation not added with Intel fortran compiler + msvc

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
Valued Contributor III
112 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.

grimgort
Beginner
105 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
mecej4
Black Belt
94 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.

grimgort
Beginner
76 Views

i have fix error but not fix problem