Skip to content

[BUG] linter.modOutput not working for Intel compilers #538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
gnikit opened this issue Jun 18, 2022 · 12 comments · Fixed by #539
Closed
1 task done

[BUG] linter.modOutput not working for Intel compilers #538

gnikit opened this issue Jun 18, 2022 · 12 comments · Fixed by #539
Assignees
Labels

Comments

@gnikit
Copy link
Member

gnikit commented Jun 18, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Description

Module output flag for Intel compilers is not working, thus .mod files are output in the source file directory.

Screenshots

No response

Expected Behaviour

-module outputModDir to result into .mod files being output into outputModDir instead of source root.

Version of Modern Fortran

v3.1.0

Version of Visual Studio Code

v1.69.0-insider, fbf1cf3832d43088e27837dbb68d24ab65a098c1

Platform and Architecture

Linux x64 5.4.0-120-generic

Additional Information

No response

@avysk
Copy link

avysk commented Jun 15, 2023

It still does not work with ifort on Windows. I have f90 file in src subfolder; my linter mod output is set to ${workspaceFolder}\build. If I choose gfortran as linter, mod file goes into build and if I choose ifort then the mod file is generated right next to the source.

Modern Fortran 3.2.0, VSCode 1.79.1, Windows 11, though you probably do not need it. Notice:

❯ ifort -module foo
[...blah...]
ifort: command line warning #10155: ignoring option '/module'; argument required
[...blah...]

On Windows the right incantation is -module:foo with :.

@avysk
Copy link

avysk commented Jun 15, 2023

I did not check but I suspect that it may apply to include path as well.

@gnikit
Copy link
Member Author

gnikit commented Jun 15, 2023

Please post the relevant details, like versions of the extension, and vscode and vscode settings.

@avysk
Copy link

avysk commented Jun 15, 2023

I believe I did post the versions of extension and VSCode, didn't I? What exactly VSCode settings do you need?

@gnikit
Copy link
Member Author

gnikit commented Jun 15, 2023

I believe I did post the versions of extension and VSCode, didn't I?

Sorry I missed them in the original message.
Try installing the pre-release instead.

What exactly VSCode settings do you need?

All Modern Fortran settings i.e. "fortran."...

@avysk
Copy link

avysk commented Jun 15, 2023

You do pass -module foo to ifort, don't you? It ignores such an option. How installing pre-release vscode might help?

❯ ag fortran C:\Users\alexe\AppData\Roaming\Code\User\settings.json
209:  "fortran.formatting.formatter": "fprettify",
210:  "fortran.formatting.fprettifyArgs": ["-l", "80"],
211:  "fortran.fortls.maxLineLength": 80,
212:  "fortran.fortls.maxCommentLineLength": 80,
213:  "fortran.fortls.nthreads": 8,
214:  "fortran.linter.includePaths": ["${workspaceFolder}\\build"],
216:  "fortran.linter.modOutput": "${workspaceFolder}\\build",

No local settings.

@gnikit
Copy link
Member Author

gnikit commented Jun 16, 2023

There have been multiple bug fixes and features added since the last official release. All these are included in the pre-release of the extension.

@avysk
Copy link

avysk commented Jun 16, 2023

Ah, I misunderstood you. Pre-release of the extension not vscode. Will try today.

@avysk
Copy link

avysk commented Jun 16, 2023

Exactly the same behaviour with pre-release extension v3.4.2023053001. Not a big surprise, as you still pass -module<SPACE> to ifort and it does not work on Windows. Let me quote the extension output: [INFO - <time>] [build.single] Compiler query command line: <path to ifort.exe> -syntax-only -fpp -warn all -module<SPACE><blah...>. This is wrong on Windows.

@gnikit
Copy link
Member Author

gnikit commented Jun 16, 2023

This issue is seems to be its own separate thing, it is now tracked in #919. I will have to rethink the Linter interfaces, since I don't want to make a hack fix.

PS I was always under the impression that even though the Intel docs say to use /module: you could always pass the UNIX equivalent and it would silently work.

Support for Windows should be improving in the next major release (which is hopefully soon), since I am adding tests and improving the Python tool interactions.

@avysk
Copy link

avysk commented Jun 16, 2023

You indeed can pass -blah instead of /blah but if the option requires a parameter : is required: -blah:param.

@avysk
Copy link

avysk commented Jun 16, 2023

If it will be needed, I can help with testing things on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants