- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know that it is possible to compile in IVF from CMD by using the ifort command. However, that command only compiles and does not run the executable upon finishing compiling. The .exe needs to be run sequentially by hand.
Is there any automatic option in the ifort driver to compile and run the .exe automatically?
Thanks in advance.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is trivial to do by writing a batch file. For example, file run.bat could contain:
ifort %1.f90 %1
and you could use it as
run hello
It is possible to expand this to account for the failure of the compilation, by deleting %1.exe before compiling, testing for the existence of %1.exe, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
or...
ifort fred.f90 && fred.exe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Batch files are fine for simple compile and run situations. As your compile requirements get more complicated (many source files, different libraries, etc...) consider using MAKE or NMAKE as this is what these tools are designed to do.
Another option you have is the CMD processor has a command history capability. By entering UpArrow or DownArrow you can navigate through the command history. This will save you retyping the command the second time.
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page