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

Is there anyway to stop the DEFTOFD tool from creating the $_win32 variable

Ray_R_1
Beginner
558 Views

Hello, I have a large fortran project with 14 resource files, each with its own header file (all with different names). When I use the deftofd tool to convert the .h files to .fd files, the deftofd tool creates a $_win32 variable and sticks it in each .fd file, which causes a problem when I include more than one .fd file in a subroutine, is there any way to tell the tool not to create that variable? And what is it used for anyways?

Thanks

0 Kudos
8 Replies
Steven_L_Intel1
Employee
558 Views
That's a very good question. I was not aware it was doing this, but I see that it is. No idea what it is used for - I will ask. For now, I suggest that you put each INCLUDE of the .fd files in a separate module and USE the module. This will avoid problems with the duplicate symbol, as long as you don't reference it. Issue ID is DPD200234030.
0 Kudos
Ray_R_1
Beginner
558 Views
Thank you. As a work around for now I have written my own translator for the h to fd files. Not pretty but works.

I am still interested in what that variable is?
0 Kudos
Udit_P_Intel
Employee
558 Views
I believe this variable just specifies that the current operating system is WIN32. There should be a command line switch which can either enable or disable this behaviour. We are looking at this.
Best!
-Udit
0 Kudos
Udit_P_Intel
Employee
558 Views
More investigation reveals that using the /u switch disables the creation of $_WIN32 . Using a recent version of deftofd on a Win32 machine, I find the following: [bash]x:/cq/testing$ cat whizzy.h end x:/cq/testing$ deftofd whizzy.h temp.fd x:/cq/testing$ cat temp.fd ! ! temp.fd generated from whizzy.h ! integer, parameter :: $_WIN32 = 1 x:/cq/testing$ deftofd whizzy.h temp.fd /u x:/cq/testing$ cat temp.fd ! ! temp.fd generated from whizzy.h ![/bash] I think all you need is /u upon invoking deftofd. Best! -Udit
0 Kudos
Steven_L_Intel1
Employee
558 Views
Note that in Visual Studio, deftofd is invoked as a custom build step for the .h file. You can edit the command used there to add the /u.
0 Kudos
Ray_R_1
Beginner
558 Views
Thank you, is there any documentation showing what the command options are for deftofd?
0 Kudos
Steven_L_Intel1
Employee
558 Views
There's no user documentation on options. We're going to change deftofd to not put out that symbol.
0 Kudos
Steven_L_Intel1
Employee
558 Views
The definition will be removed in an update later this year (October would be my guess.)
0 Kudos
Reply