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

How to create custom build for fortran source file

tung_nguyen1
Beginner
458 Views

I have fortran project file where I need to have custom build for some of the source files. How can I do that?

Thanks,

0 Kudos
5 Replies
jimdempseyatthecove
Honored Contributor III
458 Views

Nguyen,

If you wish to use the configurations Debug and Release but wish to have either a project or some of the files in a project have different options than for the general settings for that configuration then select the desired configuration and in the solution browser right click on either the project or file/files within the project, pick properties, and set the desired options for the selected project or files. You may have to do this one project or fileat a time.

You can also create your own special configurations with the configuration manager (New Configuration). When doing this you can elect to copy in settings from other configuration.

My preferences are to have

Debug Full Debugging with full run time checks (array bounds etc...)
DebugFast Full Debugging with most run time checks off
DebugOpenMPOpenMP + Full Debugging with full run time checks (array bounds etc...)
DebugOpenMPFast
Release
ReleaseOpenMP

If you require different custom build proceedures then look at the documented technique (hack) that is used to produce the dialog.FD file for a dialog box.

Jim Dempsey

0 Kudos
tung_nguyen1
Beginner
458 Views

Thanks Jim, what I need is to be able to run external program on the fortran source file prior to get it compile. Is this information in the documented technique that is used to produce the dialog.FD file... If yes, where can I find that document?

Tung Nguyen

0 Kudos
Steven_L_Intel1
Employee
458 Views
The documentation you're looking for is under Building Applications > Using Windows Features > Using Dialog Boxes > Using the Resource Editor > Designing a Dialog Box, about three-quarters down the page. I am not sure how much this helps you as this step won't be possible on a Fortran source file.

Perhaps what you can do is under Project Properties, select Custom Build Step. Click the ? button on this page to bring up the Visual Studio help which will explain it in more detail.
0 Kudos
jimdempseyatthecove
Honored Contributor III
458 Views

Nguyen,

If you are unable to find a solution to your problem there is another potential way (or hack as some might call it) and that is if you are NOT using the Fortran Preprocessor FPP that you could add to the PATH, preceeding the Fortran binaries directory, (or possibly use the project directory)a directorythat contains FPP.BAT that you write to invoke the custom build step. Then in the solution explorer mark the project or file(s) within the projectas to require preprocessing by FPP, which hopefully calls on your FPP.BAT.

Note, if VS (or IVF) looks for FPP.EXE instead of FPP then try renaming yourFPP.BAT to FPP.EXE. I think this will work since the program loader looks at the contents of the file in order to determine how to run what was specified. You may have to rename it back if you require to edit it.

You may need to run a test batch file to see how the file names and options are passed.

:FPP.BAT
ECHO TEST FPP.BAT
:LOOP
IF "%1"=="" GOTO DONE
ECHO %1
SHIFT
GOTO LOOP
PAUSE

Jim Dempsey

0 Kudos
jimdempseyatthecove
Honored Contributor III
458 Views

I forgot to add, you may need to determine how IVF uses temp file names.

Jim Dempsey

0 Kudos
Reply