Hi Kenny,
I first have to execute the ifortvars.bat in the dos window but then it works fine.
Compiler/linker environments that need a
setup batch file to be run first can be a little more problematic to configure
The good news is they can be configured quite easily by wrapping the
setup batch file within a special compiler/link batch file
For example this is how I get Zeus to compile a c/c++ file using the
MSVC++ compiler.
The
MSVC++ compiler is similar in that for the compile and link to work the
vsvars32.bat needs to be run first to setup the environment. Below is the batch file code that I use to make this work within Zeus.
Assume the following batch code lives in a file calle
zcc.cmd and it is saved to the
Zeus install directory:
Code: Select all
@echo off
rem Setup the build path details
call "c:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
rem Check for a temp folder (note: MSVC needs a temp folder)
if not exist d:\temp\ goto next1
set tmp=d:\temp
set temp=d:\temp
:next1
rem Check for a temp folder
if not exist c:\temp\ goto next2
set tmp=c:\temp
set temp=c:\temp
:next2
rem Name a file to capture the errors
set ErrorFile=%1.err
rem Delete the error file if it exists
if exist %ErrorFile% del %ErrorFile%
rem Run the build
cl.exe -W4 %1 > %ErrorFile%
rem Display the error output
if exist %ErrorFile% type %ErrorFile%
rem Delete the error output file
if exist %ErrorFile% del %ErrorFile%
Now to get Zeus to compile a
MSVC c/c++ file all that needs to be done is set this batch file as the
compiler option for the c/c++
document type as follows:
The
$fn becomes the
%1 variable of the batch file and the compiler errors are written to
$fn.err error file. At the end of the batch file the errors file is then piped to standard output and hence will also be displayed inside of Zeus
The command line within the compiler in Zeus is:
c:\"Program Files"\intel\Compiler\Fortran\10.0.025\IA32\Bin\ifort $FN
So to make this work for your
Fortran environment I would guess all you need do is change this batch file slightly.
Change these lines of the batch code:
Code: Select all
rem Setup the build path details
call "c:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
to be something like this:
Code: Select all
rem Setup the build path details
call "c:\Program Files\intel\Compiler\Fortran\10.0.025\IA32\Bin\ifortvars.bat"
to these lines of batch code:
Code: Select all
rem Run the build
cl.exe -W4 %1 > %ErrorFile%
to be something like this:
Code: Select all
rem Run the build
ifort.exe -options %1 > %ErrorFile%
Where
-options shown above represents any extra command line options that you may need to give the fortran compiler.
If there are no extra options then the command line should be something like:
Code: Select all
rem Run the build
ifort.exe %1 > %ErrorFile%
This may be a dumb question but I cannot get my code to link by using the command line under the compiler options.
To get the linker to work I would create a
second linking batch file similar to the
zcc.cmd above. You could then create a workspace for you Fortran project and add this linker batch file to the
build options of the
Workspace, Options menu.
One final hint is to use the
Options, Editor Options menu and turn on the
Debug tools, macros and executables option. With this option enabled Zeus will send the command lines to the Zeus debug output window.
When I have a DOS command line that is not working inside Zeus, what usually helps is copying the command from the Zeus debug window, opening a DOS prompt using the Zeus
Tools, Dos Shell menu and then try running the command at the DOS prompt command line
Cheers Jussi