- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any way to tell VS2008 to use a different method to invoke the ifort compiler? We have a client who requires us to compile our files for them using a batch file (acomp.bat) they have provided. I guess it basically does a bunch of stuff, calls ifort, then does more stuff afterwards. I don't necessarily want to have to get into what it does.
In our old batch build system, this is easy as I just replace ifort with icomp.bat in the build process' batch files. However I am porting this to Dev Studio 2008 and want to tell devenv to use icomp.bat instead of ifort.
In our old batch build system, this is easy as I just replace ifort with icomp.bat in the build process' batch files. However I am porting this to Dev Studio 2008 and want to tell devenv to use icomp.bat instead of ifort.
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use the Intel Fortran compiler outside of VS2008 - I do that a lot for small programs (I find using VS 2008 for programs of one source file a bit heavy).
I simply open a DOS box described as "Fortran Build Environment for IA-32" from the Start menu
and then the environment variables are set to the correct values.
The secret is that ifortvars.bat is run with the argument "ia32". You find that in the bin subdirectory
of the installation directory. If you include that batch file in "icomp.bat", then it should work fine.
(Probably best to putsetlocal/endlocal commands in there to prevent the environment from growing
each time you invoke icomp.bat)
Regards,
Arjen
I simply open a DOS box described as "Fortran Build Environment for IA-32" from the Start menu
and then the environment variables are set to the correct values.
The secret is that ifortvars.bat is run with the argument "ia32". You find that in the bin subdirectory
of the installation directory. If you include that batch file in "icomp.bat", then it should work fine.
(Probably best to putsetlocal/endlocal commands in there to prevent the environment from growing
each time you invoke icomp.bat)
Regards,
Arjen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Arjen, that's essentially what I have already: a build environment outside of VS2008. However I'm trying to standardize all our build systems to use VS2008, but this particular build falls a little outside the rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, that was not clear to me - I can not help with that particular type of question.
Regards,
Arjen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It may be possible to do this, but I haven't tried it. The key is that VS will issue the "ifort" command in an environment where PATH is set up using the list of directories shown under Tools > Options > Intel Visual Fortran > Compilers > Executable Files. If you could arrange it so that this list had an added folder at the top which contained an ifort.exe or ifort.bat which then did what you wanted, it might work. Your substitute "ifort" would need to pass along the complete command line.
A problem I see is that your client's acomp.bat is probably not prepared to get a long list of options as VS will supply. Is there perhaps another way to accomplish this by having a "Custom Build Step" or maybe a Pre-Buid and Post-Build event?
A problem I see is that your client's acomp.bat is probably not prepared to get a long list of options as VS will supply. Is there perhaps another way to accomplish this by having a "Custom Build Step" or maybe a Pre-Buid and Post-Build event?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using the Custom Steps to do the link, as they have a special alink.bat as well. This is OK as I just use their alink.bat in the pre-Link step and throw away the results of the regular link. However I can't do the compilation step this way as this requires executing acomp.bat for each of the source files. I suppose I could put the entire list of Fortran files in the pre-Link step, but that sounds horribly messy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What does this batch file do? I haven't played with this too much, you may be able to do something with a custom build step which can run a specified command on an indivisual source file, though I think it is only a file that it doesn't already know what to do with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I dissected the compiler batch file and extracted the compiler arguments. I have put those into Visual Studio and used ifort, and I'm checking now to see if that works. In terms of the link batch file, I can't dissect that so I'm using their link as a pre-link step, whcih seems to work. The real link fails, but I don't need it. It would be good if I could avoid performing this link somehow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Back to this: is there any way to cleanly stop the build process after the PreLink Event? ie. to not do the actual link. At the moment I force an ErrorLevel 1 which stops the Build.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page