Docs: Installation: Windows
Currently the following compilers are supported on Windows
- win32_borland : Borland C/C++
- win32_gnu : Cygnus C/C++/Fortran
- win32_intel : Intel C/C++/Fortran
- win32_ms : Microsoft Visual C/C++ with Compaq Visual Fortran
Also, the following base files are provided for using PETSc with the currently available implementations of MPI with
Microsoft/Compaq compilers.
- win32_ms_hpvm: HPVM - an implementation of MPI from
University of Illinois at Urbana-Champaign and University of California, San Diego. This implementation of MPI works on Windows
NT/2000 only.
- win32_ms_mpich: MPICH - an implementation of MPI from
Argonne National Laboratory. This implementation of MPI works on Windows NT/2000 only.
- win32_ms_mpipro: MPIPro - an implementation of MPI from MPI
Software Technology
- win32_ms_wmpi: WMPI - an implementation of MPI from
Critical Software. This implementation of MPI works on all Windows systems.
The Widows installation is now same as the Unix installation. The following additional instructions should clarify the
procedure further.
Installing PETSc:
- Install Cygnus tools: PETSc
install uses various unix like tools from this package including make,
sh, sed, grep etc. We recommend
installing this package in c:\software\cygwin
If installing the full version is not practical, a minimum set
of tools can be installed from cygwin-petsc.exe.
Extract the files into a temporary location and run the setup choosing
the option 'Install from Local Directory'. The drawback of using this package is - it could be out of date with the currently
available packages from Cygwin.
Note: add c:\software\cygwin\bin to your PATH
- Compilers should be useable from command line. i.e the
compilers and tools should be available in the path, and the appropriate environment variables -
LIB, INCLUDE should be set correctly. This can be done during install time for
some compilers. If the compiler's setup program does not update these
variables (which is true on Windows 95/98/ME), use the following
alternatives:
If using Compaq Fortran Compiler, run the 'Fortran Command Prompt' from the Program Files Menu. This sets the environment to use both
the Microsoft C/C++ compilers and the Compaq Fortran Compiler.
If using only the Microsoft compiler (on Windows 95/98/Me) - create a
shortcut with the following entry (with ~1 changed to correct value on
your machine):
command.com /E:4098 /K
c:\progra~1\micros~1\vc98\bin\vcvars32.bat
- Install Blas/Lapack. If using win32_ms* or win32_intel, we recommend obtaining and
installing "Math Kernel Library" (MKL) - an
optimized implementation of BLAS and LAPACK from Intel.
Note: add c:\progra~1\intel\mkl\ia32\bin to your PATH
If MKL is not available, or if using win32_borland install f2cblaslapack.
If using win32_gnu we recommend installing fblaslapack.
Note: If using f2cblaslapack or fblaslapack, PETSc
should be configured first, so that the compiler and other information is available to build the blaslapack libraries.
- Download PETSc. also
obtain the patches. Untar using Cygnus tar as: tar
-xzf petsc.tar.gz We recommend installing PETSc in
c:\software\petsc-2.1.5
- Note: If using Winzip to untar the distribution, you must
use version 8.
- Check the bmake files. Edit the appropriate bmake files, and make sure the correct
information is present. For eg:, if installing for win32_ms, the appropriate files are
variables and packages in petsc-2.1.5\bmake\win32_ms
- Set the proper environment variables. This can be done by the
following commands in a command prompt.
set PETSC_ARCH=win32_ms
set PETSC_DIR=c:/software/petsc-2.1.5
Note: The path is specified using '/' and not '\'. This way, the
Cygnus tools use the path correctly.
Note: The above variables can be set in autoexec.bat for Windows 95/98/ME or in Control Panel->System->Environment Variables on
Windows NT/2000 Note: In Windows NT/2000, when a new command window is opened, the updated environment variables should be available in
the new window.
- Compile. Build the libraries and run the test suite.
cd c:\software\petsc-2.1.5
make BOPT=g all
make BOPT=g testexamples_uni
Additional Notes:
- PETSc Win32 Front End - win32fe: This tool is used as a wrapper to Microsoft/Compaq/Borland/Intel
compilers, and the corresponding libtools, to enable PETSc libraries to be built using make and other unix tools.
For additional info, run c:\petsc-2.1.5\bin\win32\win32fe.exe without any options.
- MPI for Gnu/Intel compilers: PETSC_ARCH=win32_gnu and
win32_intel default to using MPICH
- MPI for Borland Compilers: With Borland compilers, it is currently not possible to use any
implementation of MPI
- Complex Version of PETSc: Using complex version of PETSc requires a c++ compiler - to compile
PETSc, and a complex version of blaslapack. The complex blaslapack functions are available in both Intel MKL, and fblaslapack
package. However, using fblaslapack requires a Fortran compiler. Compaq, Cygnus and Intel provide fortran compilers, which work with
win32_ms, win32_gnu, win32_intel respectively.
- Project Files for Microsoft Visual Studio/Compaq Digital Fortran:
Three project files, one for a C example using BOPT=g,O, and the other for
a c++ example using BOPT=g_c++ and O_c++, and the third for fortran
example using BOPT=g,O are provided with the PETSc
distribution. They are located in c:\petsc-2.1.5\projects directory. To build and
run the example file using the project provided:
Make sure that the environment variables PETSC_ARCH and PETSC_DIR are set correctly and are accessible to the Visual Studio.
Load the project file ex2.dsw into Microsoft Visual Studio.
To compile the example, use Menu ->Build -> Build ex2.exe (F7)
To run the example, use Menu -> Build -> Execute ex2.exe (Ctrl-F5)
Creating a project for your files: From c:\petsc-2.1.5\projects\[c,c++]\sles\ex2 Copy the files - ex2.dsw and
ex2.dsp, to the location of your project directory. Rename the files to your desires project name - say - my_prj.dsw and my_prj.dsp Load
the new project file my_prj.dsw into Microsoft Visual Studio. From file view stub, remove the source file ex2.[c,cpp] From Menu Project
-> add to project -> files, add the user source files to the project.
Program Arguments: can be set in Developer Studio from the Menu Project -> settings ->Debug -> program arguments.
Currently we only provide project examples using console applications, and for PETSC_ARCH=win32_ms only. If developing a windows
application or, if using any other PETSC_ARCH, the appropriate project files have
to be created manually.