PETSc |
|
||
|
|
|||
Quick instructions:Invoke the following commands from the top level PETSc directory [using bash shell]export
PETSC_DIR=$PWD
./configure
--with-cc=gcc
--with-fc=gfortran
--download-f-blas-lapack=1
--download-mpich=1
make
all
test
Detailed instructions: [Check here for MS
Windows Installation]
|
|||
Example Usages:
PETSC_DIR and PETSC_ARCH are a couple of variables control the configuration and build process of PETSc. These variables can be set as envirnment variables or specified on the command line [to both configure and make]
PETSC_DIR: this variable should point to the location of the PETSc installation that is used. Multiple PETSc versions can coexist on the same file-system. By changing PETSC_DIR value, one can switch between these installed versions of PETSc. PETSC_ARCH: this variable gives a name to a configuration/build. Configure uses this value to stores the generated config makefiles in ${PETSC_DIR}/${PETSC_ARCH}/conf. And make uses this value to determine this location of these makefiles [which intern help in locating the correct include and library files]. Thus one can install multiple variants of PETSc libraries
- by
providing different PETSC_ARCH values to each configure
build. Then one
can switch
between using these variants of libraries [from make] by
switching the
PETSC_ARCH value used. If configure doesn't find a PETSC_ARCH value [either in env variable or command line option], it automatically generates a default value and uses it. Also - if make doesn't find a PETSC_ARCH env variable - it defaults to the value used by last successful invocation of previous configure. Return to Installation Instructions Compilers:
Specify compilers and compiler options used to build PETSc
[and perhaps
external packages]
Return to Installation Instructions External
Packages:
PETSc provides interfaces to various external packages.
Blas/Lapack and MPI are generally required packages - but
one can
optionally use external
solvers
like Hypre, MUMPS etc.. from within PETSc aplications. PETSc configure has the ability to download and install these external packages. Alternatively if these packages are already installed, then configure can detect and use them. The following modes can be used to install/use external
packages with configure. --download-PACKAGENAME=1
: Download specified package and install it. Then
configure PETSc to
use this package.
--download-PACKAGENAME=/PATH/TO/package.tar.gz
: If ./configure cannot automatically download the package
[due
to
network/firewall issues], one can download the package by
alternaive
means [perhaps wget or scp via some other machine]. Once
the tarfile is
downloaded, the path to this file can be specified to
configure with
this option. Configure will proceed to install this
package and then
configure PETSc with it.
--with-PACKAGENAME-dir=PATH
: If the external package is already installed - specify
its location
to configure [it will attempt to detect, include, library
files from
this location.] Normally this corresponds to the top-level
installation
dir for the package.
--with-external-packages-dir=PATH : By default, external packages will be installed in ${PETSC_DIR}/externalpackages. However one can choose a different location where these packages are installed. Return to Installation Instructions BLAS/LAPACK: these packages provide some basic numeric kernels used by PETSc.
Return to Installation Instructions MPI: This software provides the parallel functionality for PETSc.
Open MPI defaults to building shared libraries for MPI. However, the binaries generated by MPI wrappers mpicc/mpif77 etc require LD_LIBRARY_PATH to be set to the location of these libraries. Due to this Open MPI restriction one has to set LD_LIBRARY_PATH correctly [per Open MPI installation instructions], before running PETSc configure. The same issue might exist with LAM as well. Notes:
Return to Installation Instructions Microsoft Windows Installation With MS/Intel/Compaq Compilers:Microsoft windows OS does not provide the same unix shell
enviornment as the other OSes. Also the default
MS/Intel/Compaq
compilers behave differently than other unix compilers.
And PETSc
primarily relies on a unix envirment for build tools. So
to install
PETSc on windows - one has to install cygwin
[for the unix enviornment] and use win32fe
[part of PETSc sources,to interface to MS/Intel/Compaq
compilers]. Install Cygwin: Please
download
and install cygwin package from http://www.cygwin.com
Make sure
the following cygwin components are installed.
Remove Cygwin link.exe: Cygwin
link.exe
can
conflict
with
Intel
ifort
and
Comapq
F90
compilers.
If
you
are using these compilers - please do [from cygwin/bash
shell]:
Setup cygwin bash shell with Working Compilers: We require the compilers to be setup properly in a cygwin bash command shell, so that "cl foo.c" or "ifort foo.f" works from this shell. For example - if using VS2005 C and Intel 10 Fortran one can do:
Example Configure usage with Windows Compilers:
./configure --with-cc='win32fe cl' --with-fc='win32fe ifort' --with-cxx='win32fe cl' --download-f-blas-lapack=1 If fortran usage is not required, use: Using Compaq F90: Using Microsoft C/C++ 6.0 & Compaq Fortran 6.0 with
MPICH2
configure command to use: Note: MPICH2 mpif.h needs a fix for it to work with Compaq F90 [specifically remove line with MPI_DISPLACEMENT_CURRENT - which uses 'integer*8' - which is unsupported by Compaq F90] ExternalPackages: --download-package
option does not
work with many external packages. Project Files: We
cannot provide Microsoft Visual Studio project files for
users as they
are specific to the configure options, location of
external packages,
compiler versions etc. used for any given build of PETSc,
so they
are potentially different for each build of PETSc. So if
you need a project file
for use with PETSc - please do the following.
Debugger: Running
PETSc
probrams with -start_in_debugger is not supported on this
platform, so debuggers will need to be initiated manually.
Make sure
your environment is properly configured to use the
appropriate debugger
for your compiler. The debuggers can be initiated using
Microsoft
Visual Studio 6: msdev ex1.exe, Microsoft
Visual Studio
.NET: devenv ex1.exe, Intel Enhanced
Debugger: edb ex1.exe,
or GNU Debugger gdb ex1.exe. Using Cygwin gcc/g++/gfortran: One
can
install
and
use
PETSc
with
gcc/gfortran
compilers
from
cygwin.
In
this
case follow the regular instructions. PETSc Win32 front end - win32fe: This tool is used as a wrapper to Microsoft/ Borland/ Intel compilers and associated tools - to enable building PETSc libraries using cygwin make and other UNIX tools. For additional info, run ${PETSC_DIR}/bin/win32/win32fe without any options. Return
to
Installation
Instructions Installing PETSc in /usr/local or /opt where sudo or root previledges are required:If one wants to install PETSc [with sources] in a common
system location like /usr/local or /opt, then we suggest
creating a dir
for
PETSc in the required location with user privileges, and
then do the
PETSc install [as a regular/non-root
user]. i.e
One can also use the gnu
prefix-install mode.
Installing on machine requiring cross compiler or a job scheduler, such as IBM SP or IBM Blue Gene:If one has to use a cross compiler - or go through the
job
scheduler to use MPI on a
given machine - use the configure option '--with-batch=1' as
follows:
Installing with TAU Instrumentation package:TAU
package and the prerequisite PDT
packages need to be installed separately. PETSc provides a
wrapper
compiler for TAU. This needs to be invoked with the
correct information
for the installed TAU and PDT packages. For eg: ./configure
--with-mpi-dir=/home/petsc/soft/linux-rh73/mpich-1.2.4 --with-fc=0
--with-cxx=0
-PETSC_ARCH=linux-tau --with-cc="`pwd`/bin/taucc.py
-cc=gcc
-pdt_parse=/homes/petsc/soft/linux-rh73/pdtoolkit-2.2b1/linux/bin/cparse
-tau_lib_dir=/homes/petsc/soft/linux-rh73/tau-2.11.18/i386_linux/lib" To install TOPS components one has to download and
install CCA
Tools. [linux only]
Installing PETSc to use NVidia GPUs (aka CUDA)
make ex19 ./ex19 -da_vec_type mpicusp -da_mat_type mpiaijcusp -pc_type none -dmmg_nlevels 1 -da_grid_x 100 -da_grid_y 100 -log_summary -mat_no_inode -preload off -cusp_synchronize We only have experience using Nvidia GPUs on Apple machines and Intel Xeon servers running Ubuntu 10.04 x86_64 NVidia GT200 [Tesla C1060] Installing PETSc to use PThreads
make ex19 ./ex19 -da_vec_type pthread -da_mat_type aijpthread -pc_type none -dmmg_nlevels 1 -da_grid_x 100 -da_grid_y 100 -log_summary -mat_no_inode -preload off -cusp_synchronize Return
to
Installation Instructions |
||||||
|
|