Portable, Extensible Toolkit for Scientific Computation
Installation Instructions for PETSc 2.0
Welcome to PETSc 2.0. Please let us know of any difficulties in installing and using the software. See the file docs/bugreporting.html for information on reporting bugs and installation problems. Installing PETSc can be the hardest part of using the software, since each machine's configuration is slightly different. If problems crop up, first, consult
the troubleshooting.html guide and
http://www.mcs.anl.gov/petsc/petsc-patches.html
through which most users can solve their problems. We are always willing to assist with an installation if a problem remains unresolved. If installing PETSc has taken more than a few hours and you've gone through the troubleshooting.html guide, please refer to bugreporting.html. We will help everyone with installation problems on any of the machines listed below.
This release has been tested on
On variants of the OS on the above machines, a little tweaking may be necessary. This information is usually present in the files petsc/bmake/${PETSC_ARCH}/base. (changes in compiler options, libraries supplied by the OS), or in any source files that fail to compile, or in the PETSc bug fixes file, http://www.mcs.anl.gov/petsc/petsc-patches.html
Separate installation instructions are below for UNIX and Window plaftorms.
PETSc 2.0 requires a MINIMUM of 25 megabytes of disk space to install for a single operating system. The UNIX command "df" can be used to determine the amount of available disk space. See the PETSc FAQ for tips on reducing required space.
PETSc MUST be compiled with an ANSI C compiler (or C++ compiler). Many older Sun workstations have the Sun-bundled C compiler, which is NOT ANSI C and cannot be used. The Gnu compiler gcc can often be used as a replacement for systems that do not have a native ANSI C compiler.
Required Software:
Prior to installing PETSc 2.0, the machine must have:
For users who are interested ONLY in running PETSc sequentially, we have included a stripped-down version of MPI that allows PETSc to be compiled without installing an external version of MPI. This setup allows the user to run ONLY uniprocessor PETSc programs, not parallel ones.
Optional Packages:
PETSc provides an interface to several software packages.. These packages are not developed, maintained, or supported by the PETSc team! We merely provide an interface to them. To use any of these optional packages, obtain the following prior to installing PETSc:
Before compiling BlockSolve95 make sure that the BlockSolve file src/makefile
has at the bottom
CFLAGS = ${BS_INCLUDE} ${MPI_INCLUDE} -DMLOG
The -DMLOG is extremely important.
Installing PETSc:
Note:
If installing ONLY a uniprocessor version of PETSc, then an installation of an
MPI implementation is not required. Instead, the following MPI locations can be used in
the ${PETSC_DIR}/bmake/${PETSC_ARCH}/base.site file:
MPI_LIB = ${PETSC_DIR}/lib/lib${BOPT}/${PETSC_ARCH}/libmpiuni.a
MPI_INCLUDE = -I${PETSC_DIR}/src/sys/src/mpiuni
MPIRUN = ${PETSC_DIR}/src/sys/src/mpiuni/mpirun
- IBM rs6000: the definition of CLINKER as indicated in these files must be changed (unless using an IBM SP).
- Solaris using the GNU compilers: then do
mv bmake/solaris bmake/solaris.cc
mv bmake/solaris_gnu bmake/solaris- IBM rs6000 using the GNU compilers: then do
mv bmake/rs6000 bmake/rs6000.cc
mv bmake/rs6000_gnu bmake/rs6000- Sun4 machines: if using the Sun ANSI-C compiler, these files must be edited accordingly.
- CRAY t3d: make sure the enviornmental variable TARGET is set to cray-t3d
On HP-UX machines we highly recommend using Gnu make (which can be installed if not already available) rather than the native make . To switch to using gnumake in the PETSc makefiles, define OMAKE to be the path of gnumake in the file ${PETSC_DIR}/bmake/${PETSC_ARCH}/base.
Test programs:
Fortran Users:
The PETSc Fortran libraries are built automatically during the installation outlined above..
PETSc Fortran programs can use the suffix .F rather than the traditional suffix .f, so that the PETSc header files can be easily included in Fortran programs. See the Fortran chapter within the users manual for additional details regarding the Fortran interface. In order to use the suffix .f instead of .F, the user must edit the file ${PETSC_DIR}/include/foldinclude/petsc.h to hardwire the path for the local MPI include file. See the chapter 'PETSc Fortran Users' in the users manual for more information.
Multiple Installations:
When building PETSc for two or more machine types that share a common filesystem, for example sun4 and hpux, multiple PETSc directory trees are NOT needed. Only a single PETSc directory can (and should) be used; PETSc automatically places the libraries for each machine in a different location. In particular, the libraries for a given BOPT and PETSC_ARCH are installed in the directory, ${PETSC_DIR}/lib/lib${BOPT}/${PETSC_ARCH}.
Shared Libraries:
PETSc supports the use of shared libraries for the machines sun4, solaris, alpha, IRIX, IRIX64, and linux to enable faster linking and smaller executables. These libraries are built automatically during installation.
Installation under Windows 95/NT
We currently provide instructions for installing PETSc under Windows 95/NT using Microsoft Visual C++ 5.0 compilers, for uniprocessor use. Once a more stable MPI is available we will provide instructions for parallel use. See http://www.mcs.anl.gov/petsc/petsc-patches.html and troubleshooting.html for help with problems. Currently complex version of PETSc libraries cannot be built.under Windows 95/NT.
Installing PETSc:
Running Examples from a Shell:
Running Examples from Microsoft Visual Studio: (using a Project)
Two project files, one for C libraries, and the other for the C++ libraries, are provided with the PETSc distribution.They are located in c:\petsc-2.0.22\projects\[c,c++]\sles\ex2 directory. To build and run the example file using the project provided:
To Create a project for your files
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; developing a windows application requires creating a new project.
Fortran Users:
If you have the Digitial Visual Fortran compiler (with the latest patches) you can compile PETSc Fortran code
Running Fortran examples from Developer Studio:
Currently this is not possible, as we need to use the build targes provided in the PETSc base files.
Rebuilding Libraries
The Windows version of PETSc comes with the C and C++ version libraries pre-built. If, for some reason you need to rebuild the libraries, you can do the following:
Using Microsoft Visual C/C++ Compiler from the Command Line:
If the commands nmake and vc do not work from the DOS command line, but you do have Microsoft Developer Studio installed, you can either
Installing PETSc Using gcc/g77:
PETSc can be installed on Windows NT/95 using gnu-win32 tools from Cygnus Solutions, (which contains bash and make) and EGCS version of gcc, g++, g77 compilers. Currently we use gnu-win32 version beta-19 and EGCS compilers for gnu-win32 beta 19.