Skip to content

Disable automatic creation of .mod files #187

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
llamm-de opened this issue Jul 22, 2020 · 5 comments
Closed

Disable automatic creation of .mod files #187

llamm-de opened this issue Jul 22, 2020 · 5 comments

Comments

@llamm-de
Copy link

It seems like the app provides some functionality, which automatically creates .mod files as soon as one opens a module source file.
This can get really annoying if you are working on a large project with lots of modules, which are not supposed to live within the same directory as the source files (e.g. by using CMake's Fortran_MODULE_DIRECTORY flag).

Is there a way to turn this automatic creation off? If not, I would like to suggest to implement such a feature.

Thank's for your help.

@han190
Copy link
Contributor

han190 commented Jul 22, 2020

Hi, go to settings.json and type the following

// Fortran
"fortran.gfortranExecutable": "",

It should work.

@llamm-de
Copy link
Author

llamm-de commented Jul 23, 2020

Hey,

thanks for this small hack. Unfortunately, the solution comes with the drawback of not getting any compiler errors displayed within vs code. It would therefore be great, if there would be another solution.

@pedro-ricardo
Copy link
Collaborator

pedro-ricardo commented Dec 14, 2020

@llamm-de, .mod are generated by the compiler so .. to prevent that, there should be a flag for it. But I didn't found it ...
Therefore the hack I use is to set the -J compiler option that controls the output folder for .mod files ...

"fortran.linterExtraArgs": [
        "-J/dev/null"
    ]

By setting this to /tmp or /dev/null you will achieve what you want ... I think 😄

Although for best use of the linter, you shoud set the .mod file creation to your code's bin folder and also add a -I flag to the same folder. This way the compiler can see other modules and correctly show errors and warnings of their usage.

@gnikit
Copy link
Member

gnikit commented Jun 1, 2021

@llamm-de did that solve your problem? If so are you happy with closing the issue?

@gnikit
Copy link
Member

gnikit commented Oct 3, 2021

I suspect this issue has been resolved, so I will be closing it. Feel free to reopen if you are still having problems.

@gnikit gnikit closed this as completed Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants