Docs: Installation |
![]() |
Example Usages:
PETSC_DIR: - this environment/make variable should point to the location of the PETSc installation that is used. You can add export PETSC_DIR=value in your .profile or .sh file or setenv PETSC_DIR value in your .cshrc or .tcshrc file. Multiple PETSc versions of PETSc can coexist on the same file-system. By changing PETSC_DIR value one can switch between the versions PETSC_ARCH: this environment/make variable is used to specify the configuration that should currently be used. It corresponds to the configuration files in bmake/${PETSC_ARCH}. Multiple variants of PETSc libraries can be installed - each variant corresponding to a different PETSC_ARCH. One can switch between using these variants - by changing the value of PETSC_ARCH BOPT: this environment/make variable is used to distinguish debug/optimized or c/c++/complex versions of PETSc libraries. One can install, any/all variants of the libraries, and switch between them by changing the value of BOPT. The table below explains the most common BOPT values.
example usage - assuming ex1.c is user code, and a makefile with a target to
compile ex1 exists: Return to Installation Instructions bmake/${PETSC_ARCH}/packages: this configuration file, corresponding to the PETSC_ARCH used, contains the configuration for all external software packages - PETSc is installed with. The specification is in the compiler notation for include paths, library paths, library names.
bmake/${PETSC_ARCH}/variables: this file contains the configuration for the C, C++, fortran compilers - that are associated with the PETSC_ARCH used. Return to Installation Instructions Cygwin: it provides UNIX tools on windows - which enable PETSc install on windows. When installing cygwin make sure you install the patch utility (for some strange reason this is not installed by default). Cygwin also has GNU compilers - which can be used if Microsoft compilers are not available
Return to Installation Instructions BLAS/LAPACK: these packages provide basic numeric kernels used by PETSc. This is available from the following sources
Return to Installation Instructions MPI: This software provides the parallel functionality for PETSc. This is available from the following sources
Return to Installation Instructions I don't want to use MPI: You can build (sequential) PETSc without an MPI.
Return to Installation Instructions Downloading PETSc and applying Patches:
Return to Installation Instructions Instead of manually editing bmake/${PETSC_ARCH}/* files one can use config/configure.py to create these files - for the specified PETSC_ARCH Configure is implemented in python and requires python version 2.2 or newer. With configure build, the PETSC_ARCH should be chosen from the suggested value by 'bin/petscarch -suggest'. For example, on a linux box, to use configure one should use linux-gnu, or linux-gnu-foobar etc. examples:
We provide some default configure examples in ${PETSC_DIR}/config, for example: on Mac OS X, a sample configure file is ${PETSC_ARCH}/config/configure_darwin6.6.py Currently configure cannot handle most of the optional packages so after running configure you should manually add them to the bmake/${PETSC_ARCH}/packages file Return to Installation Instructions Optional Packages: PETSc can be installed with various optional packages - including SuperLU, Spooles, Matlab etc.. The optional package information is specified in bmake/${PETSC_ARCH/packages file. An example specification is as follows: PARMETIS_INCLUDE = -I/home/petsc/soft/solaris-9/ParMetis-3.0 PARMETIS_LIB = -L/home/petsc/soft/solaris-9/ParMetis-3.0 -lparmetis -lmetis PETSC_HAVE_PARMETIS = -DPETSC_HAVE_PARMETIS Notice that the include, library paths, library files are specified, and a flag is set - to enable the package within PETSc. For more example usage for any other package, check out the default bmake/*/packages files in the distribution Return to Installation Instructions Aditional Windows Notes:Compilers: Support Microsoft (win32_ms*), Intel (win32_intel), Borland (win32_borland), Gnu compilers (win32_gnu) Project Files: We provide default project files that work with PETSC_ARCH=win32_ms_mpich. They are located at ${PETSC_DIR}/projects. Be sure to build the libraries that correspond to the project configuration you are using. To use a C++ project with Debug configuration, BOPT=g_c++ libraries are required. 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. 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 make and other UNIX tools. For additional info, run ${PETSC_DIR}/bin/win32/win32fe without any options. Return to Installation Instructions I got PETSc from the BitKeeper site: If manually editing the bmake/${PETSC_ARCH}/packages file we recommend creating a new PETSC_ARCH - for example: linux_local(i.e copy files from bmake/linux over to bmake/linux_local) and make edits suitable for your configuration in this copy - this way you don't have to edit sources in BitKeeer.
|