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

Obtaining an executable fortran file within visual studio 2019

galli_m
新分销商 I
2,809 次查看

I am new to VS 2019 . (Had older version)

I have recently installed (on Windows 10 pro..)

1) VS 2019 - community
2) compiler - intel oneAPI base toolkit
3) parallel processing - intel oneAPI hpc toolkit

 

In command prompt (intel oneapi, x64) I compiled
a simple FORTRAN program "ifort test1.f",
obtained and ran test1.exe successfully.

 

After a lot of time on the web for help,
I still cannot do the same within VS 2019.
That is .... getting an executable file...

 

Here is a recent detailed approach...
* launched VS (continue without code)
* file>new>fortran project from existing code...
* file>open>file ...test1.f
* build> configuration manager ... (debug, x64)
* build> build solution (0 errors, 0 warnings - only get BuildLog.htm)

 

Also tried...
* launched VS (create new project)
* >'all languages' to 'fortran'
* >'all project types' to 'console'
* > selected 'empty project'...'next'
* project name (console1)...location e:\IVS test)... create
* project>add existing items from folder...chose 'test1.f'
* build>build solution

in Output I get...

 

Build started...
1>------ Build started: Project: Console1, Configuration: Debug Win32 ------
1>Compiling with Intel® Fortran Compiler Classic 2021.2.0 [IA-32]...
1>test1.f
1>Linking...
1>Embedding manifest...
1>
1>Build log written to "file://E:\IVS%20test\Console1\Debug\BuildLog.htm"
1>Console1 - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


How can I get 'test1.exe' within VS? What am I missing?

 
0 项奖励
1 解答
Steve_Lionel
名誉分销商 III
2,752 次查看

You did get test1.exe. The output in the build window doesn't say so explicitly. You can now run or debug the program from the Debug menu within VS. If you want to debug, set a breakpoint on an executable line first.

在原帖中查看解决方案

0 项奖励
4 回复数
andrew_4619
名誉分销商 III
2,781 次查看
Rather than open the file you need to add the source file to the project. In solution explorer there are right click on the project menu options that is one route.
0 项奖励
jimdempseyatthecove
名誉分销商 III
2,759 次查看

The files might not be located where you expect them to be. With a Solution located in

C:\test

I see:

C:\test\Console1
C:\test\Console1\Console1
C:\test\Console1\Console1.sln
C:\test\Console1\.vs\Console1
C:\test\Console1\.vs\Console1\v16
C:\test\Console1\Console1\Console1.f90
C:\test\Console1\Console1\Console1.vfproj
C:\test\Console1\Console1\Debug
C:\test\Console1\Console1\ReadMe.txt
C:\test\Console1\Console1\Debug\BuildLog.htm
C:\test\Console1\Console1\Debug\Console1.exe
C:\test\Console1\Console1\Debug\Console1.exe.intermediate.manifest
C:\test\Console1\Console1\Debug\Console1.obj
C:\test\Console1\Console1\Debug\Console1.pdb
C:\test\Console1\Console1\Debug\vc160.pdb

Note the path to the Consol1.exe

Does the default console application (Hello World) build and run?

Jim Dempsey

0 项奖励
Steve_Lionel
名誉分销商 III
2,753 次查看

You did get test1.exe. The output in the build window doesn't say so explicitly. You can now run or debug the program from the Debug menu within VS. If you want to debug, set a breakpoint on an executable line first.

0 项奖励
galli_m
新分销商 I
2,744 次查看

Thank you all for the feedback. It works.

0 项奖励
回复