- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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”.
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?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page