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

Intel Compiler + Visual Studio Integration

richard_adas
Beginner
1,316 Views

Hello everyone,
I recently started to pick up Fortran using the intel compiler in the microsoft visual studio environment. I set up a bunch of projects (following the book modern fortran - building efficient parallel applications) by milan curic. Recently i encountered the first bug which i did not understand:
So far i have always put my modules in separate files (like mod_initial.f90). If i understand it correctly, the intel compiler automatically scans the project for those definitions, creating .mod files out of these definitions before compiling the .exe file out of the .f90 file which contains the program definition. For a new project, which i set up totally similarly, the compiler kept throwing errors like
error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MOD_DIFF]
I tried to remove the mod.f90 files in question by deleting them and adding new definitions and excluding/including them from the build in the file properties, but but could not resolve the problem. the .mod files were not created when compiling. i can circumvent this problem by putting my module definition in the same .f90 file as the program definition (in that case the .mod file is getting created as intended and the program can use the functions and subroutines as defined). but i figure for bigger projects it would be better to organise the modules in seperate files. do you have any trouble-shooting hints why this behaviour occurs? i am especially puzzled since the automatic .mod file generation worked fine in previous projects.
thanks for your kind help

Richard

0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
1,061 Views

Richard,

You should read your error message. They should give you some insight as to what is happening.

Follow @andrew_4619 advice and build the Solution (or if you wish the project when solution has only one project).

In reading your build log (sans options):

Compiling with Intel® Fortran Compiler 2025.3.2 [Intel(R) 64]...
ifx C:\Users\Richard\source\repos\tsunami\tsunami.f90
C:\Users\Richard\source\repos\tsunami\tsunami.f90(51):

error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MOD_INITIAL]
use mod_initial, only: set_gaussian
------------^
C:\Users\Richard\source\repos\tsunami\tsunami.f90(50):

error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MOD_DIFF]
use mod_diff, only: diff =&gt diff_centered
------------^
C:\Users\Richard\source\repos\tsunami\tsunami.f90(117):

error #6404: This name does not have a type, and must have an explicit type. [DIFF]
u = u - (u * diff(u) + g * diff(h)) / dx * dt ! update velocity using finite difference and array operations
-------------------------^
C:\Users\Richard\source\repos\tsunami\tsunami.f90(50):

error #6581: Unresolved rename. [DIFF]
use mod_diff, only: diff =&gt diff_centered
----------------------------^
C:\Users\Richard\source\repos\tsunami\tsunami.f90(51):

error #6580: Name in only-list does not exist or is not accessible. [SET_GAUSSIAN]
use mod_initial, only: set_gaussian
-------------------------------^
compilation aborted for C:\Users\Richard\source\repos\tsunami\tsunami.f90 (code 1)


tsunami - 6 error(s), 0 warning(s)

 

It is clear that you are only compiling tsunami.f90 and not the whole Solution (and all the projects (1) held within).

 

Jim Dempsey

View solution in original post

0 Kudos
6 Replies
andrew_4619
Honored Contributor III
1,270 Views

hard to know what you are doing and what the problem is. In The project to a clean and then a build to build everything. Post the buildlog.html file. That will at least produce something concrete for people to look at.

0 Kudos
richard_adas
Beginner
1,174 Views

hello Andrew,
I tried the clean and rebuild and it unfortunately did not work.
i attached the BuildLog and a zip file with my project inside. hope it clarifies something.
highly appreciate the help!

best regards
Richard

0 Kudos
andrew_4619
Honored Contributor III
1,112 Views

Well I downloaded your project and it builds OK

 

Screenshot 2026-03-05 092240.png

 

I looked at your build log. You tried to compile tsunami.f90 and it fails because mod_initial.f90 and mod_diff.f90 contain modules that tsunami.f90 uses. These must first have been successfully compiled for it to work.

 

But that is the wrong approach, build the *project*  and it should build all the things that are out of date that need building in an order that works. Building an individual file will only work if all the dependencies have been already built.

 

 

 
 

 

jimdempseyatthecove
Honored Contributor III
1,234 Views

>>I set up a bunch of projects... i have always put my modules in separate files

Assuming the module files are located in a separate project from the main (PROGRAM) project, then in the Project Dependencies of the main project, you must check the other projects:

 
 

Screenshot 2026-03-04 095326.png

 

Jim Dempsey

 

 

 

0 Kudos
richard_adas
Beginner
1,174 Views

hello Jim,
Apologies for the confusion. before I just added new mod files by right-clicking a folder in my project and adding a fortran free-form file (.f90). The compiler would compile the module definitions inside and therefore create the .mod files. since this week, the compiler does not compile files i add with this method to my project anymore.

 
 

2026-03-05 10_43_05-tsunami - tsunami.f90 - Microsoft Visual Studio.png

any ideas how i can ensure compilation of all files in my project? according to the developer guide the compiler should scan all source files in the projects for module definitions in the use/include statement
https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2025-3/create-a-new-project.html

thanks for the help!

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,062 Views

Richard,

You should read your error message. They should give you some insight as to what is happening.

Follow @andrew_4619 advice and build the Solution (or if you wish the project when solution has only one project).

In reading your build log (sans options):

Compiling with Intel® Fortran Compiler 2025.3.2 [Intel(R) 64]...
ifx C:\Users\Richard\source\repos\tsunami\tsunami.f90
C:\Users\Richard\source\repos\tsunami\tsunami.f90(51):

error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MOD_INITIAL]
use mod_initial, only: set_gaussian
------------^
C:\Users\Richard\source\repos\tsunami\tsunami.f90(50):

error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MOD_DIFF]
use mod_diff, only: diff =&gt diff_centered
------------^
C:\Users\Richard\source\repos\tsunami\tsunami.f90(117):

error #6404: This name does not have a type, and must have an explicit type. [DIFF]
u = u - (u * diff(u) + g * diff(h)) / dx * dt ! update velocity using finite difference and array operations
-------------------------^
C:\Users\Richard\source\repos\tsunami\tsunami.f90(50):

error #6581: Unresolved rename. [DIFF]
use mod_diff, only: diff =&gt diff_centered
----------------------------^
C:\Users\Richard\source\repos\tsunami\tsunami.f90(51):

error #6580: Name in only-list does not exist or is not accessible. [SET_GAUSSIAN]
use mod_initial, only: set_gaussian
-------------------------------^
compilation aborted for C:\Users\Richard\source\repos\tsunami\tsunami.f90 (code 1)


tsunami - 6 error(s), 0 warning(s)

 

It is clear that you are only compiling tsunami.f90 and not the whole Solution (and all the projects (1) held within).

 

Jim Dempsey

0 Kudos
Reply