Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
23 Views

Fortran static lib projects in Visual Studio slow to compile

Hi

I am moving a large Fortran/C++ application to Visual Studio 2015 Professional and Intel Parallel Studio XE 2017 Professional Edition.

I currently have 35 projects in the Visual Studio solution which are a mixture of Fortran static libs, C/C++ static libs, C/C++ DLLs and an C++ MFC application project.

Visual Studio freezes for a while before starting to build solution.  I wonder if it is because there are a lot of Fortran files.  One Fortran static lib project has over 2000 files each one small, the largest is 90Kbytes, about 20 Kbytes on average.  There are also thousands of Fortran interface files, one interface declaration per file.

Is it the number of files slowing down the compiler?  It seems that it is looking for dependencies in all the files. Just a build on one Fortran project itself can lock up Visual Studio for a minute or so, before it starts building.  Visual Studio is not responsive during that minute.

Some Fortran projects will just randomly fail to build, I get an "Error: the operation could not be completed".  The only solution I found is to shutdown visual studio and restart.  Closing visual studio takes a while and it is not responsive while it tries to shutdown.  It takes minutes to shutdown and a minute or more to load the solution.

I found another discussion on the "Error: the operation could not be completed" in the forum but there was no resolution.

What I would like is the ability to make a small change and tell Visual Studio to build solution.  Since it is a small change, Visual Studio understands what needs to compile, compile it and done.  Instead it seems to take a minute or more to determine what changed and then compile.  Sometimes a Fortran project just fails for unknown reason.  "Error: the operation could not be completed"

I know that Visual Studio has issues with large number of projects which Microsoft has improved in Visual Studio 2017.  However, I can't seem to improve my experience in VS2015 .  I have reduced the number of projects from 81 to 35 but Visual Studio is still sluggish.  Maybe the next task is to reduce the number of Fortran files?

Thanks

Tim

 

 

 

0 Kudos
3 Replies
Highlighted
Black Belt Retired Employee
23 Views

From what you describe, the compiler isn't involved. Instead, it's Visual Studio's build dependency analyzer which, with callouts to Intel-provided Fortran-specific code, determines the proper order to build projects. If you would like Intel to investigate, I'd suggest opening a ticket at Intel Premier Support and attaching a ZIP of the project and sources.

A possible workaround might be to divide the project into multiple static library projects and have one "main" library project that has the option Librarian > Link library dependencies set to Yes. This merges the subsidiary libraries (the name of this option is a bit confusing in this context.)

0 Kudos
Highlighted
Beginner
23 Views

Thanks Steve for your response.

Unfortunately because of IP concerns I can't give Intel a copy of the source and projects.

Because of how the source has been configured in the past, I have a project that consists of just Fortran interface files, thousands of them.  They are all in one folder, separate from the Fortran files that define the subroutines and functions.  It is not easy to move these interface files to live in the same project, it is hard to sort them.  This is all Fortran 77, no modules.

So does each Fortran static lib project (which I have 6 now) must analyze this interface project for any changes?  Using Visual Studio build dependency feature, each is only dependent on the Interface project.  So the analyzer must review the up to thousands of Fortran files in the project plus the Interface project.  

The Fortran code was written with one or maybe a few subroutines in each file.  So I have lots of *.for files but each mostly small.

Thanks

Tim

0 Kudos
Highlighted
Black Belt Retired Employee
23 Views

Each project is analyzed independently, then the project dependencies are used to determine project build order.

0 Kudos